Skip to content

Commit

Permalink
tools: Fix VariantContextConverterTest. #TASK-4682
Browse files Browse the repository at this point in the history
  • Loading branch information
j-coll committed Nov 7, 2024
1 parent 2187ae8 commit 2520821
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ protected static String allelesToString(Collection<String> alleles) {
}

private static String alleleToString(String a) {
return a.length() > 10 ? (a.substring(0, 10) + "...[" + a.length() + "]") : a;
return a.length() > 20 ? (a.substring(0, 10) + "...[" + a.length() + "]") : a;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ public class VariantContextConverterTest {

@Test
public void testDuplicatedAllele() throws NonStandardCompliantSampleField {
// REF : AGTATATTGTGT AGTATATTGTG
// V1 : 1000:AGTATATTGT/A A---------GT -> A---------G -> AG
// V2 : 1002:TATATTGTGT/TT AGT--------T -> AGT-------- -> AGT
// V3 : 1002:TATATTGTGT/T AG---------T -> AG--------- -> AG

String studyId = "s";
Variant variant = Variant.newBuilder("1", 1000, null, "AGTATATTGT", "A")
.setStudyId(studyId)
Expand All @@ -51,9 +56,9 @@ public void testDuplicatedAllele() throws NonStandardCompliantSampleField {
.addSample("s4", "1/1", "1,10,1")
.build();

checkVcf("1 1000 . AGTATATTGT A,AGT . . . GT:AD 1/1:10,10,0,0 0/1:0,10,0,0 ./.:. 2/2:1,0,1,10", merge(norm(variant), norm(variant2)));
checkVcf("1 1001 . GTATATTGTG G,GT . . . GT:AD ./.:. ./.:. 0/1:1,10,1,0 2/2:1,1,10,0", merge(norm(variant2), norm(variant)));
checkVcf("1 1000 . AGTATATTGT A,AGT . . . GT:AD 1/1:10,10,0,0 0/1:0,10,0,0 ./.:. 2/2:1,0,1,10", merge(norm(variant), norm(variant2, 1)));
checkVcf("1 1000 . AGTATATTGTG AG,AGT . . . GT:AD 1/1:10,10,0,0 0/1:0,10,0,0 ./.:. 2/2:1,0,1,10", merge(norm(variant), norm(variant2)));
checkVcf("1 1001 . GTATATTGTG G,GT . . . GT:AD ./.:. ./.:. 0/1:1,10,1,0 2/2:1,1,10,0", merge(norm(variant2), norm(variant)));
checkVcf("1 1000 . AGTATATTGTG AG,AGT . . . GT:AD 1/1:10,10,0,0 0/1:0,10,0,0 ./.:. 2/2:1,0,1,10", merge(norm(variant), norm(variant2, 1)));
}

@Test
Expand Down

0 comments on commit 2520821

Please sign in to comment.