Skip to content

Commit

Permalink
Merge pull request #238 from TheJacksonLaboratory/release-v1.0.4
Browse files Browse the repository at this point in the history
Release v1.0.4
  • Loading branch information
ielis authored Nov 21, 2023
2 parents a256ea1 + 6fbc109 commit a4e22df
Show file tree
Hide file tree
Showing 26 changed files with 153 additions and 42 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
Changelog
=========

------
v1.0.4
------

- ``SvAnna``
- update dependency versions.
- ``svanna-io``
- Fix issue with VCF files compressed by newer compressor versions

------
v1.0.3
------
Expand Down
46 changes: 45 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,51 @@ Efficient and accurate pathogenicity prediction for coding and regulatory struct
Most users should download the latest SvAnna distribution ZIP file from
the [Releases page](https://github.com/TheJacksonLaboratory/SvAnna/releases).

Please consult the Read the docs site for detailed documentation:
## Example use

SvAnna is a standalone command-line Java application and can be run as follows:

```shell
java -jar svanna-cli.jar -d path/to/svanna/data \
-t HP:0008330 \
--vcf example.vcf.gz \
--output-format html,csv,vcf
```

The analysis will filter out common SVs and perform phenotype-driven prioritization of the remaining SVs.
The SVs are assigned with *"Pathogenicity of Structural variation"* (PSV) score and written into
one of several output formats, such as CSV table, a VCF file, or a detailed HTML report.

### HTML report

The HTML report includes a header with the analysis summary and the SVs ordered by the PSV score
with the best scores on top.

### Analysis summary

The summary presents the clinical features encoded into terms of Human Phenotype Ontology (HPO) as well as
the other analysis parameters.

![Analysis summary](img/analysis-summary.png)

### Variant counts

The report further breaks down SVs into several categories:

![Variant counts](img/variant-counts.png)

### Structural variants

Last, each SV is presented in the context of the overlapping genes and transcripts:
![Variant transcript summary](img/variant-tx-summary.png)

We also show the variant in context of the neighboring repetitive regions and genes/transcripts:
![Variant context](img/variant-tx-context.png)


## Read more

Please consult the Read the docs site for a detailed documentation:
- [stable version](https://svanna.readthedocs.io/en/master) describing the latest release at the *Releases page*, or
- [latest version](https://svanna.readthedocs.io/en/latest) summarizing the latest development on `development` branch.

Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
# The short X.Y version.
version = u'1.0'
# The full version, including alpha/beta/rc tags.
release = u'1.0.3'
release = u'1.0.4'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
Binary file added img/analysis-summary.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/variant-counts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/variant-tx-context.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/variant-tx-summary.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 13 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<module>svanna-benchmark</module>
</modules>
<groupId>org.monarchinitiative.svanna</groupId>
<version>1.0.3</version>
<version>1.0.4</version>
<name>SvAnna</name>

<parent>
Expand All @@ -34,7 +34,13 @@

<phenol.version>2.0.0</phenol.version>
<phenopacket-tools.version>1.0.0-RC2</phenopacket-tools.version>
<phenopacket-schema.version>2.0.2</phenopacket-schema.version>
<silent.genes.version>0.2.5</silent.genes.version>
<htsjdk.version>3.0.5</htsjdk.version>
<commons-csv.version>1.7</commons-csv.version>
<commons-io.version>2.8.0</commons-io.version>
<commons-net.version>3.8.0</commons-net.version>
<commons-compress.version>1.24.0</commons-compress.version>
<h2.version>1.4.200</h2.version>
</properties>

Expand Down Expand Up @@ -111,7 +117,7 @@
<dependency>
<groupId>org.phenopackets</groupId>
<artifactId>phenopacket-schema</artifactId>
<version>2.0.2</version>
<version>${phenopacket-schema.version}</version>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
Expand All @@ -131,7 +137,7 @@
<dependency>
<groupId>com.github.samtools</groupId>
<artifactId>htsjdk</artifactId>
<version>3.0.5</version>
<version>${htsjdk.version}</version>
<exclusions>
<exclusion>
<groupId>org.tukaani</groupId>
Expand All @@ -143,22 +149,22 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-csv</artifactId>
<version>1.7</version>
<version>${commons-csv.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.21</version>
<version>${commons-compress.version}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.8.0</version>
<version>${commons-io.version}</version>
</dependency>
<dependency>
<groupId>commons-net</groupId>
<artifactId>commons-net</artifactId>
<version>3.8.0</version>
<version>${commons-net.version}</version>
</dependency>
<dependency>
<groupId>info.picocli</groupId>
Expand Down
2 changes: 1 addition & 1 deletion svanna-benchmark/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>SvAnna</artifactId>
<groupId>org.monarchinitiative.svanna</groupId>
<version>1.0.3</version>
<version>1.0.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.monarchinitiative.svanna.benchmark.cmd.benchmark_case;

import org.apache.commons.compress.compressors.gzip.GzipCompressorOutputStream;
import org.apache.commons.csv.CSVFormat;
import org.apache.commons.csv.CSVPrinter;
import org.monarchinitiative.svanna.benchmark.cmd.BaseBenchmarkCommand;
Expand Down Expand Up @@ -34,6 +33,7 @@
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import java.util.zip.GZIPOutputStream;

@CommandLine.Command(name = "benchmark-case",
aliases = {"BC"},
Expand Down Expand Up @@ -191,7 +191,7 @@ private void writeOutResults(File output, BenchmarkResults results, Set<String>

// "case_name", "background_vcf", "variant_id", "rank", "vtype", "is_causal", "priority"
LOGGER.info("Writing the results for `{}`", results.caseName());
try (BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new GzipCompressorOutputStream(new FileOutputStream(output))))) {
try (BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new GZIPOutputStream(new FileOutputStream(output))))) {
CSVPrinter printer = CSVFormat.DEFAULT
.withHeader("case_name", "background_vcf", "variant_id", "rank", "vtype", "is_causal", "priority")
.print(writer);
Expand Down
2 changes: 1 addition & 1 deletion svanna-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>SvAnna</artifactId>
<groupId>org.monarchinitiative.svanna</groupId>
<version>1.0.3</version>
<version>1.0.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>svanna-cli</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
footer = Main.FOOTER)
public class Main implements Callable<Integer> {

public static final String VERSION = "svanna-cli v1.0.3";
public static final String VERSION = "svanna-cli v1.0.4";

public static final int WIDTH = 120;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.monarchinitiative.svanna.cli.writer.tabular;

import org.apache.commons.compress.compressors.gzip.GzipCompressorOutputStream;
import org.apache.commons.csv.CSVFormat;
import org.apache.commons.csv.CSVPrinter;
import org.monarchinitiative.svanna.cli.writer.AnalysisResults;
Expand All @@ -27,6 +26,7 @@
import java.util.LinkedList;
import java.util.List;
import java.util.function.Consumer;
import java.util.zip.GZIPOutputStream;

public class TabularResultWriter implements ResultWriter {

Expand Down Expand Up @@ -63,7 +63,7 @@ private BufferedWriter openWriter(Path output, String prefix) throws IOException
Path outPath = output.resolve(prefix + suffix + (compress ? ".gz" : ""));
LogUtils.logInfo(LOGGER, "Writing tabular results into {}", outPath.toAbsolutePath());
return compress
? new BufferedWriter(new OutputStreamWriter(new GzipCompressorOutputStream(new FileOutputStream(outPath.toFile()))))
? new BufferedWriter(new OutputStreamWriter(new GZIPOutputStream(new FileOutputStream(outPath.toFile()))))
: Files.newBufferedWriter(outPath);
}

Expand Down
2 changes: 1 addition & 1 deletion svanna-configuration/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>SvAnna</artifactId>
<groupId>org.monarchinitiative.svanna</groupId>
<version>1.0.3</version>
<version>1.0.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion svanna-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>SvAnna</artifactId>
<groupId>org.monarchinitiative.svanna</groupId>
<version>1.0.3</version>
<version>1.0.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion svanna-db/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>SvAnna</artifactId>
<groupId>org.monarchinitiative.svanna</groupId>
<version>1.0.3</version>
<version>1.0.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion svanna-ingest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>SvAnna</artifactId>
<groupId>org.monarchinitiative.svanna</groupId>
<version>1.0.3</version>
<version>1.0.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>svanna-ingest</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
import org.apache.commons.codec.digest.MessageDigestAlgorithms;
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
import org.apache.commons.compress.archivers.zip.ZipFile;
import org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream;
import org.apache.commons.compress.compressors.gzip.GzipCompressorOutputStream;
import org.apache.commons.csv.CSVFormat;
import org.apache.commons.csv.CSVParser;
import org.apache.commons.csv.CSVRecord;
Expand Down Expand Up @@ -87,6 +85,8 @@
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;

@CommandLine.Command(name = "build-db",
aliases = "B",
Expand Down Expand Up @@ -369,7 +369,7 @@ private static List<? extends GencodeGene> downloadAndPreprocessGenes(GeneProper
GeneParser jsonParser = parserFactory.forFormat(SerializationFormat.JSON);
Path destination = buildDir.resolve("gencode.v38.genes.json.gz");
LOGGER.info("Serializing the genes to {}", destination.toAbsolutePath());
try (OutputStream os = new BufferedOutputStream(new GzipCompressorOutputStream(Files.newOutputStream(destination)))) {
try (OutputStream os = new BufferedOutputStream(new GZIPOutputStream(Files.newOutputStream(destination)))) {
jsonParser.write(genes, os);
}

Expand Down Expand Up @@ -563,7 +563,7 @@ private static Map<Integer, Integer> parseNcbiToHgncTable(String ncbiGeneToHgnc)

private static BufferedReader openForReading(Path tablePath) throws IOException {
return (tablePath.toFile().getName().endsWith(".gz"))
? new BufferedReader(new InputStreamReader(new GzipCompressorInputStream(Files.newInputStream(tablePath))))
? new BufferedReader(new InputStreamReader(new GZIPInputStream(Files.newInputStream(tablePath))))
: Files.newBufferedReader(tablePath);

}
Expand Down
2 changes: 1 addition & 1 deletion svanna-io/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>SvAnna</artifactId>
<groupId>org.monarchinitiative.svanna</groupId>
<version>1.0.3</version>
<version>1.0.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import htsjdk.variant.vcf.VCFFileReader;
import htsjdk.variant.vcf.VCFHeader;
import htsjdk.variant.vcf.VCFHeaderVersion;
import org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream;
import org.monarchinitiative.svanna.core.LogUtils;
import org.monarchinitiative.svanna.core.filter.FilterResult;
import org.monarchinitiative.svanna.core.filter.FilterType;
Expand All @@ -23,15 +22,16 @@
import org.slf4j.LoggerFactory;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;
import java.util.Optional;
import java.util.function.Function;
import java.util.stream.Stream;
import java.util.zip.GZIPInputStream;

/**
* Parse variants stored in a VCF file. The parser is <em>NOT</em> thread safe!
Expand Down Expand Up @@ -97,20 +97,39 @@ public Stream<FullSvannaVariant> createVariantAlleles(Path filePath) throws IOEx
VCFCodec codec = new VCFCodec();
codec.setVCFHeader(header, header.getVCFHeaderVersion() == null ? VCFHeaderVersion.VCF4_1 : header.getVCFHeaderVersion());

BufferedReader reader;
if (filePath.toFile().getName().endsWith(".gz"))
reader = new BufferedReader(new InputStreamReader(new GzipCompressorInputStream(new FileInputStream(filePath.toFile()))));
else
reader = Files.newBufferedReader(filePath);
BufferedReader reader = openFileForReading(filePath);

return reader.lines()
.onClose(() -> {try {reader.close();} catch (IOException ignored) {}})
.onClose(closeReader(reader))
.map(toVariantContext(codec))
.flatMap(Optional::stream)
.map(toVariants())
.flatMap(Optional::stream);
}

private static BufferedReader openFileForReading(Path filePath) throws IOException {
BufferedReader reader;
if (filePath.toFile().getName().endsWith(".gz"))
reader = new BufferedReader(
new InputStreamReader(
new GZIPInputStream(Files.newInputStream(filePath)),
StandardCharsets.UTF_8));
else
reader = Files.newBufferedReader(filePath, StandardCharsets.UTF_8);
return reader;
}

private static Runnable closeReader(BufferedReader reader) {
return () -> {
try {
LOGGER.trace("Closing VCF file");
reader.close();
} catch (IOException e) {
LOGGER.warn("Error while closing the VCF file", e);
}
};
}

/**
* One variant context might represent multiple sequence variants or a single symbolic variant/breakend.
* This function melts the variant context to a collection of variants.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.monarchinitiative.svanna.io.service;

import org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream;
import org.monarchinitiative.svanna.core.service.GeneService;
import org.monarchinitiative.svanna.core.service.QueryResult;
import org.monarchinitiative.svanna.io.service.jannovar.IntervalArray;
Expand All @@ -23,6 +22,7 @@
import java.nio.file.Path;
import java.util.*;
import java.util.stream.Collectors;
import java.util.zip.GZIPInputStream;

public class SilentGenesGeneService implements GeneService {

Expand Down Expand Up @@ -64,7 +64,7 @@ public static SilentGenesGeneService of(GenomicAssembly assembly, Path silentGen
private static InputStream openForReading(Path silentGenesJsonPath) throws IOException {
if (silentGenesJsonPath.toFile().getName().endsWith(".gz")) {
LOGGER.debug("Assuming the file is gzipped");
return new BufferedInputStream(new GzipCompressorInputStream(Files.newInputStream(silentGenesJsonPath)));
return new BufferedInputStream(new GZIPInputStream(Files.newInputStream(silentGenesJsonPath)));
} else {
return new BufferedInputStream(Files.newInputStream(silentGenesJsonPath));
}
Expand Down
Loading

0 comments on commit a4e22df

Please sign in to comment.