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 f0bed05
Show file tree
Hide file tree
Showing 50 changed files with 1,690 additions and 166 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
2 changes: 1 addition & 1 deletion tests/hg19-chr22/Case_1_index.delly2.gts.tsv-expected
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
release chromosome chromosome_no bin chromosome2 chromosome_no2 bin2 pe_orientation start end start_ci_left start_ci_right end_ci_left end_ci_right case_id set_id sv_uuid caller sv_type sv_sub_type info num_hom_alt num_hom_ref num_het num_hemi_alt num_hemi_ref genotype
GRCh37 22 22 89 22 22 89 3to5 17400000 17700000 -29 29 -29 29 . . UUID EMBL.DELLYv1.1.3 DEL DEL {"""backgroundCarriers""":0,"""affectedCarriers""":0,"""unaffectedCarriers""":0} 0 2 1 0 0 {"""Case_1_father-N1-DNA1-WGS1""":{"""gt""":"""0/1""","""ft""":{"""LowQual"""},"""gq""":14,"""pec""":0,"""pev""":0,"""src""":34,"""srv""":4,"""cn""":2},"""Case_1_index-N1-DNA1-WGS1""":{"""gt""":"""0/0""","""gq""":35,"""pec""":0,"""pev""":0,"""src""":29,"""srv""":2,"""cn""":2},"""Case_1_mother-N1-DNA1-WGS1""":{"""gt""":"""0/0""","""gq""":67,"""pec""":0,"""pev""":0,"""src""":32,"""srv""":1,"""cn""":2}}
GRCh37 22 22 89 22 22 89 3to5 17400000 17700000 -29 29 -29 29 . . UUID EMBL.DELLYv1.1.3 DEL DEL {"""affectedCarriers""":0,"""backgroundCarriers""":0,"""unaffectedCarriers""":0} 0 2 1 0 0 {"""Case_1_father-N1-DNA1-WGS1""":{"""cn""":2,"""ft""":{"""LowQual"""},"""gq""":14,"""gt""":"""0/1""","""pec""":0,"""pev""":0,"""src""":34,"""srv""":4},"""Case_1_index-N1-DNA1-WGS1""":{"""cn""":2,"""gq""":35,"""gt""":"""0/0""","""pec""":0,"""pev""":0,"""src""":29,"""srv""":2},"""Case_1_mother-N1-DNA1-WGS1""":{"""cn""":2,"""gq""":67,"""gt""":"""0/0""","""pec""":0,"""pev""":0,"""src""":32,"""srv""":1}}
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 f0bed05

Please sign in to comment.