Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
Fixing SVTYPE=CNV for DRAGEN CNV (#74)
Browse files Browse the repository at this point in the history
Closes: #74
Related-Issue: #74
Projected-Results-Impact: none
  • Loading branch information
holtgrewe committed Sep 16, 2022
1 parent 7867a46 commit 6adbf93
Show file tree
Hide file tree
Showing 23 changed files with 1,260 additions and 156 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[![Continuous Integration](https://github.com/bihealth/varfish-annotator/actions/workflows/ci.yml/badge.svg)](https://github.com/bihealth/varfish-annotator/actions?query=workflow%3Acontinuous-integration)
[![Coverage Status](https://coveralls.io/repos/github/bihealth/varfish-annotator/badge.svg?branch=main)](https://coveralls.io/github/bihealth/varfish-annotator?branch=main)
[![install with bioconda](https://img.shields.io/badge/install%20with-bioconda-brightgreen.svg?style=flat)](http://bioconda.github.io/recipes/varfish-annotator-cli/README.html)

# VarFish Annotator

Expand Down Expand Up @@ -174,3 +175,15 @@ The folder `/tests` contains some data sets that are appropriate for system (aka
You can build the data sets with the `build.sh` script that is available in each folder.
This script also serves for documenting the test data's provenance.
The Jannovar software must be available as `jannovar` (e.g., through bioconda) on your `PATH` and you will need `samtools`.

## Using JDK >=18

The **tests** use [junit5-system-exit](https://github.com/tginsberg/junit5-system-exit) for detecting `System.exit()` calls.
In JDK 18 you have to use the `-Djava.security.manager=allow` flag.
Issue [tginsberg/junit5-system-exit#10](https://github.com/tginsberg/junit5-system-exit/issues/10) tracks this issue.

## Developing on Windows

There is an issue with removing temporary directories on Windows.
Apparently, HTSJDK does not properly close files.
Set `-Djunit.jupiter.tempdir.cleanup.mode.default=NEVER` to work around this issue.
5 changes: 2 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<hamcrest.version>1.3</hamcrest.version>
<junit.jupiter.version>5.7.2</junit.jupiter.version>
<junit.platform.version>1.7.2</junit.platform.version>
<guava.version>30.0-jre</guava.version>
<junit.jupiter.version>5.9.0</junit.jupiter.version>
<guava.version>31.1-jre</guava.version>
<fmt-maven-plugin.version>2.5.1</fmt-maven-plugin.version>
<checkstyle.version>7</checkstyle.version>
<slf4j.version>1.7.24</slf4j.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,11 @@ private void annotateSvVcf(

// Write out header.
try {
gtWriter.append(Joiner.on("\t").join(gtRecordBuilder.getHeaders()) + "\n");
gtWriter.append(
GenotypeRecord.tsvHeader(
!args.getOptOutFeatures().contains(GtRecordBuilder.FEATURE_CHROM2_COLUMNS),
!args.getOptOutFeatures().contains(GtRecordBuilder.FEATURE_DBCOUNTS_COLUMNS))
+ "\n");
// Write feature-effects header.
featureEffectsWriter.append(Joiner.on("\t").join(HEADERS_FEATURE_EFFECTS) + "\n");
} catch (IOException e) {
Expand Down Expand Up @@ -481,10 +485,14 @@ private void annotateVariantContext(
}

// Write out record with the genotype.
final List<Object> gtOutRec =
final GenotypeRecord gtOutRec =
gtRecordBuilder.buildRecord(variantId, svGenomeVar, ctx, genomeVersion, i);
try {
gtWriter.append(Joiner.on("\t").useForNull(".").join(gtOutRec) + "\n");
gtWriter.append(
gtOutRec.toTsv(
!args.getOptOutFeatures().contains(GtRecordBuilder.FEATURE_CHROM2_COLUMNS),
!args.getOptOutFeatures().contains(GtRecordBuilder.FEATURE_DBCOUNTS_COLUMNS))
+ "\n");
} catch (IOException e) {
throw new VarfishAnnotatorException("Problem writing to genotypes call file.", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,11 @@ void runTest(
}
} else {
Assertions.assertEquals(
expectedDbInfos, FileUtils.readFileToString(outputDbInfoPath, "utf-8"));
Assertions.assertEquals(expectedGts, FileUtils.readFileToString(outputGtsPath, "utf-8"));
expectedDbInfos,
FileUtils.readFileToString(outputDbInfoPath, "utf-8").replaceAll("\\r\\n?", "\n"));
Assertions.assertEquals(
expectedGts,
FileUtils.readFileToString(outputGtsPath, "utf-8").replaceAll("\\r\\n?", "\n"));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,11 @@ void runTest(
}
} else {
Assertions.assertEquals(
expectedDbInfos, FileUtils.readFileToString(outputDbInfoPath, "utf-8"));
Assertions.assertEquals(expectedGts, FileUtils.readFileToString(outputGtsPath, "utf-8"));
expectedDbInfos,
FileUtils.readFileToString(outputDbInfoPath, "utf-8").replaceAll("\\r\\n?", "\n"));
Assertions.assertEquals(
expectedGts,
FileUtils.readFileToString(outputGtsPath, "utf-8").replaceAll("\\r\\n?", "\n"));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ void runTest(
}
} else {
Assertions.assertEquals(
FileUtils.readFileToString(expectedDbInfosPath, "utf-8"),
FileUtils.readFileToString(outputDbInfoPath, "utf-8"));
FileUtils.readFileToString(expectedDbInfosPath, "utf-8").replaceAll("\\r\\n?", "\n"),
FileUtils.readFileToString(outputDbInfoPath, "utf-8").replaceAll("\\r\\n?", "\n"));
Assertions.assertEquals(
FileUtils.readFileToString(expectedGtsPath, "utf-8"),
FileUtils.readFileToString(outputGtsPath, "utf-8"));
FileUtils.readFileToString(expectedGtsPath, "utf-8").replaceAll("\\r\\n?", "\n"),
FileUtils.readFileToString(outputGtsPath, "utf-8").replaceAll("\\r\\n?", "\n"));
}
}

Expand Down
Loading

0 comments on commit 6adbf93

Please sign in to comment.