Skip to content

Commit 6d25eeb

Browse files
committed
Fix for issue #629 - replace commas in disease names with semicolons.
1 parent b8f1290 commit 6d25eeb

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

exomiser-core/src/main/java/org/monarchinitiative/exomiser/core/writers/VcfResultsWriter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ private String buildVariantRecord(int rank, VariantEvaluation ve, GeneScore gene
238238
fields.add(assignment.map(AcmgAssignment::acmgClassification).orElse(AcmgClassification.NOT_AVAILABLE).toString());
239239
fields.add(assignment.map(acmgAssignment -> toVcfAcmgInfo(acmgAssignment.acmgEvidence())).orElse(""));
240240
fields.add(assignment.map(acmgAssignment -> acmgAssignment.disease().diseaseId()).orElse(""));
241-
fields.add('"' + assignment.map(acmgAssignment -> acmgAssignment.disease().diseaseName().replace(" ", "_")).orElse("") + '"');
241+
fields.add('"' + assignment.map(acmgAssignment -> acmgAssignment.disease().diseaseName().replace(" ", "_").replace(",", ";")).orElse("") + '"');
242242
return "{"+ String.join("|", fields) + "}";
243243
}
244244

exomiser-core/src/test/java/org/monarchinitiative/exomiser/core/writers/VcfResultsWriterTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ void testAnnotatedVariantAcmgDiseaseNameWhitespaceIsReplacedWithUnderscore() {
388388
Disease diseaseNameWithSpaces = Disease.builder()
389389
.diseaseId("DISEASE:1")
390390
// this should not have spaces in the VCF file
391-
.diseaseName("Name with spaces")
391+
.diseaseName("Name with spaces, and a damn comma")
392392
.build();
393393

394394
GeneScore adScore = GeneScore.builder()
@@ -404,7 +404,7 @@ void testAnnotatedVariantAcmgDiseaseNameWhitespaceIsReplacedWithUnderscore() {
404404

405405
String vcf = instance.writeString(analysisResults, settings);
406406
final String expected = METADATA_HEADER + CHR_7_CONTIG_HEADER + SAMPLE_HEADER
407-
+ "7\t155604800\t.\tC\tCT\t1\tPASS\tExomiser={1|7-155604800-C-CT_AD|SHH_alpha_spaces|6469|AD|1.0000|1.0000|0.0000|0.0000|1.0000|1|0|frameshift_variant|SHH:uc003wmk.1:c.16dup:p.(Arg6Lysfs*58)|LIKELY_BENIGN|BP1_Moderate|DISEASE:1|\"Name_with_spaces\"}\tGT:RD\t0/1:30\n";
407+
+ "7\t155604800\t.\tC\tCT\t1\tPASS\tExomiser={1|7-155604800-C-CT_AD|SHH_alpha_spaces|6469|AD|1.0000|1.0000|0.0000|0.0000|1.0000|1|0|frameshift_variant|SHH:uc003wmk.1:c.16dup:p.(Arg6Lysfs*58)|LIKELY_BENIGN|BP1_Moderate|DISEASE:1|\"Name_with_spaces;_and_a_damn_comma\"}\tGT:RD\t0/1:30\n";
408408
assertThat(vcf, equalTo(expected));
409409
}
410410

0 commit comments

Comments
 (0)