Skip to content

Commit

Permalink
Merge pull request #114 from charite/develop
Browse files Browse the repository at this point in the history
Release v0.12.
  • Loading branch information
holtgrewe committed Feb 2, 2015
2 parents 05d06fb + 10e7edb commit 0c00932
Show file tree
Hide file tree
Showing 254 changed files with 8,581 additions and 4,124 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ cov-int*
*.jannovar
*.vcf
*.vcf.idx
*.ped
log.txt
data
# built manual
manual/_build
# Java Mission Control flight recorder files
*.jfr
.attach_pid*
50 changes: 50 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
**develop**

*jannovar-htsjdk*

* Started bridge module between Jannovar and HTSJDK.

*jannovar-filter*

* Started tool for mode of inheritance--based filters.

*jannovar-cli*

* Splitting out bridge module between jannovar-core and HTSJDK to
jannovar-htsjdk.
* Adding implementation of variant annotation standard 1.0.
* Adding unit tests for jannovar-cli.
* Fixing problem with empty `INFO` fields in output.
* Adding back `--output-dir` to jannovar-cli.
* Writing output parallel to input file by default.
* Adding `-v` and `-vv` command line options.
* Fixing problems with block substitution (delins) case (#87).

*jannovar-core*

* Adding initial support for the transcript support level feature of the new VCF
annotation standard (only in very recent ENSEMBL releases, apparently).
* `TranscriptModel#geneID` is now a `String`
* Update in various classes, e.g. Annotation.
* Fixing bug in PED parsing (empty lines are properly skipped now).
* More tests and fixes for the inheritance compatibility checkers.
* Updating `Annotation` for the variant annotation standard.
* `TranscriptPosition` and `TranscriptInterval` use zero-based positions now.
* Reordering values of `VariantType`.
* Somewhat renaming `VariantType` method names.
* Removing the `VariantType#size` function in favor of a `static public`
`final` member.
* Using log4j/slf4j for I/O in jannovar-core.
* Adding `PrintStream` as parameter to `JannovarOptions#print`.
* Compressing serialized file.
* Changing namespace to `de.charite.compbio.jannovar`.
* Making `VariantType#priorityLevel` a non-static member.
* Renaming `TranscriptInfo` to `TranscriptModel`.
* Moving `HG19RefDictbuilder` from tests to main.
* Using `ImmutableMap` in `Translator` for small performance improvements.
* Using `StringBuilder`-based concatenation of strings for generation of HGVS
strings etc. since this is much faster than using `String#format`.
* `GenomePosition` and `GenomeInterval` use zero-based coordinates internally
now.

**v0.11**
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![Build Status](https://travis-ci.org/charite/jannovar.svg?branch=master)](https://travis-ci.org/charite/jannovar)
[![Documentation](https://travis-ci.org/charite/jannovar.svg?branch=master)](https://readthedocs.org/projects/pip/badge/?version=master)
[![Documentation](https://readthedocs.org/projects/jannovar/badge/?version=master)](http://jannovar.readthedocs.org/)

Jannovar
========
Expand Down
3 changes: 3 additions & 0 deletions jannovar-cli/examples/delins.vcf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
##fileformat=VCFv4.1
#CHROM POS ID REF ALT QUAL FILTER INFO
X 103041654 . AGGTGATC AA . . .
53 changes: 42 additions & 11 deletions jannovar-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>de.charite.compbio</groupId>
<artifactId>Jannovar</artifactId>
<version>0.11</version>
<version>0.12</version>
</parent>

<properties>
Expand Down Expand Up @@ -51,6 +51,33 @@
<artifactId>jannovar-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>de.charite.compbio</groupId>
<artifactId>jannovar-htsjdk</artifactId>
<version>${project.version}</version>
</dependency>
<!--Logging framework -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.7</version>
</dependency>
<!-- Logging -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>${log4j.version}</version>
</dependency>
</dependencies>

<build>
Expand All @@ -76,28 +103,32 @@
<!-- set useUniqueVersions=false in order that the classpath has the
SNAPSHOT instead of the build number prefixed to the dependency -->
<useUniqueVersions>false</useUniqueVersions>
<mainClass>jannovar.Jannovar</mainClass>
<mainClass>de.charite.compbio.jannovar.Jannovar</mainClass>
</manifest>
</archive>
<compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<!-- Specify the dependencies to copy -->
<!-- More JAR building -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
<artifactId>maven-shade-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
<goal>shade</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>de.charite.compbio.jannovar.Jannovar</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
package jannovar;
package de.charite.compbio.jannovar;

/** Command line functions from apache */
import jannovar.cmd.CommandLineParsingException;
import jannovar.cmd.HelpRequestedException;
import jannovar.cmd.JannovarCommand;
import jannovar.cmd.annotate_pos.AnnotatePositionCommand;
import jannovar.cmd.annotate_vcf.AnnotateVCFCommand;
import jannovar.cmd.db_list.DatabaseListCommand;
import jannovar.cmd.download.DownloadCommand;
import jannovar.reference.TranscriptInfo;
import de.charite.compbio.jannovar.JannovarException;
import de.charite.compbio.jannovar.JannovarOptions;
import de.charite.compbio.jannovar.cmd.CommandLineParsingException;
import de.charite.compbio.jannovar.cmd.HelpRequestedException;
import de.charite.compbio.jannovar.cmd.JannovarCommand;
import de.charite.compbio.jannovar.cmd.annotate_pos.AnnotatePositionCommand;
import de.charite.compbio.jannovar.cmd.annotate_vcf.AnnotateVCFCommand;
import de.charite.compbio.jannovar.cmd.db_list.DatabaseListCommand;
import de.charite.compbio.jannovar.cmd.download.DownloadCommand;
import de.charite.compbio.jannovar.reference.TranscriptModel;

/**
* This is the driver class for a program called Jannovar. It has two purposes
Expand All @@ -25,7 +27,7 @@
* <P>
* {@code java -Xms1G -Xmx1G -jar Jannovar.jar -V xyz.vcf -D $SERIAL}
* <P>
* This will annotate a VCF file. The results of jannovar annotation are shown in the form
* This will annotate a VCF file. The results of de.charite.compbio.jannovar annotation are shown in the form
*
* <PRE>
* Annotation {original VCF line}
Expand Down Expand Up @@ -109,21 +111,21 @@ else if (argv[0].equals("annotate-pos"))
* Print top level help (without any command).
*/
private static void printTopLevelHelp() {
System.err.println("Program: jannovar (functional annotation of VCF files)");
System.err.println("Program: de.charite.compbio.jannovar (functional annotation of VCF files)");
System.err.println("Version: 0.10");
System.err.println("Contact: Peter N Robinson <[email protected]>");
System.err.println("");
System.err.println("Usage: java -jar jannovar.jar <command> [options]");
System.err.println("Usage: java -jar de.charite.compbio.jannovar.jar <command> [options]");
System.err.println("");
System.err.println("Command: download download transcript database");
System.err.println(" db-list list downloadable databases");
System.err.println(" annotate functional annotation of VCF files");
System.err.println(" annotate-pos functional annotation of genomic change");
System.err.println("");
System.err.println("Example: java -jar jannovar.jar download hg19/ucsc");
System.err.println(" java -jar jannovar.jar db-list");
System.err.println(" java -jar jannovar.jar annotate data/hg19_ucsc.ser variants.vcf");
System.err.println(" java -jar jannovar.jar annotate-pos data/hg19_ucsc.ser 'chr1:12345C>A'");
System.err.println("Example: java -jar de.charite.compbio.jannovar.jar download hg19/ucsc");
System.err.println(" java -jar de.charite.compbio.jannovar.jar db-list");
System.err.println(" java -jar de.charite.compbio.jannovar.jar annotate data/hg19_ucsc.ser variants.vcf");
System.err.println(" java -jar de.charite.compbio.jannovar.jar annotate-pos data/hg19_ucsc.ser 'chr1:12345C>A'");
System.err.println("");
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package jannovar.cmd;
package de.charite.compbio.jannovar.cmd;

import jannovar.JannovarException;
import de.charite.compbio.jannovar.JannovarException;

/**
* Exception thrown on problems with the command line.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package jannovar.cmd;
package de.charite.compbio.jannovar.cmd;

import jannovar.JannovarException;
import de.charite.compbio.jannovar.JannovarException;

/**
* Thrown when the user requests help.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package jannovar.cmd;

import jannovar.JannovarException;
import jannovar.io.Chromosome;
import jannovar.io.JannovarData;
import jannovar.io.JannovarDataSerializer;
import jannovar.io.ReferenceDictionary;
package de.charite.compbio.jannovar.cmd;

import com.google.common.collect.ImmutableMap;

import de.charite.compbio.jannovar.JannovarException;
import de.charite.compbio.jannovar.io.Chromosome;
import de.charite.compbio.jannovar.io.JannovarData;
import de.charite.compbio.jannovar.io.JannovarDataSerializer;
import de.charite.compbio.jannovar.io.ReferenceDictionary;

/**
* Base class for commands needing annotation data.
*
Expand Down Expand Up @@ -39,12 +39,9 @@ public JannovarAnnotationCommand(String[] argv) throws CommandLineParsingExcepti
* when the user requested the help page
*/
protected void deserializeTranscriptDefinitionFile() throws JannovarException, HelpRequestedException {
final long startTime = System.nanoTime();
JannovarData data = new JannovarDataSerializer(this.options.dataFile).load();
this.refDict = data.refDict;
this.chromosomeMap = data.chromosomes;
final long endTime = System.nanoTime();
System.err.println(String.format("Deserialization took %.2f sec.",
(endTime - startTime) / 1000.0 / 1000.0 / 1000.0));
}
}

}
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package jannovar.cmd;

import jannovar.JannovarOptions;
package de.charite.compbio.jannovar.cmd;

import org.apache.commons.cli.GnuParser;
import org.apache.commons.cli.Option;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;
import org.apache.commons.cli.Parser;

import de.charite.compbio.jannovar.JannovarOptions;

/**
* Base class for the command line parser for the annotation commands.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
package jannovar.cmd;
package de.charite.compbio.jannovar.cmd;

import jannovar.JannovarException;
import jannovar.JannovarOptions;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.core.LoggerContext;
import org.apache.logging.log4j.core.config.Configuration;

import de.charite.compbio.jannovar.JannovarException;
import de.charite.compbio.jannovar.JannovarOptions;

/**
* Super class for all commands, i.e. the classes implementing one Jannovar execution step.
Expand All @@ -12,6 +17,8 @@ public abstract class JannovarCommand {

/** Configuration to use for the command execution. */
protected JannovarOptions options;
/** Verbosity level: (0) quiet, (1) normal, (2) verbose, (3) very verbose */
protected int verbosity = 1;

/**
* Initialize the JannovarCommand.
Expand All @@ -25,6 +32,25 @@ public abstract class JannovarCommand {
*/
public JannovarCommand(String[] argv) throws CommandLineParsingException, HelpRequestedException {
this.options = parseCommandLine(argv);
this.verbosity = options.verbosity;
setLogLevel();
}

/**
* Set log level, depending on this.verbosity.
*/
private void setLogLevel() {
LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
Configuration conf = ctx.getConfiguration();

if (verbosity <= 1)
conf.getLoggerConfig(LogManager.ROOT_LOGGER_NAME).setLevel(Level.INFO);
else if (verbosity <= 2)
conf.getLoggerConfig(LogManager.ROOT_LOGGER_NAME).setLevel(Level.DEBUG);
else
conf.getLoggerConfig(LogManager.ROOT_LOGGER_NAME).setLevel(Level.TRACE);

ctx.updateLoggers(conf);
}

/**
Expand Down
Loading

0 comments on commit 0c00932

Please sign in to comment.