diff --git a/src/main/java/org/broadinstitute/hellbender/utils/variant/GATKSVVariantContextUtils.java b/src/main/java/org/broadinstitute/hellbender/utils/variant/GATKSVVariantContextUtils.java index c21f9450d29..fec5894b966 100644 --- a/src/main/java/org/broadinstitute/hellbender/utils/variant/GATKSVVariantContextUtils.java +++ b/src/main/java/org/broadinstitute/hellbender/utils/variant/GATKSVVariantContextUtils.java @@ -12,6 +12,7 @@ public class GATKSVVariantContextUtils { public static final Allele BND_ALLELE = Allele.create(""); public static final Allele CPX_ALLELE = Allele.create(""); + public static final Allele CTX_ALLELE = Allele.create(""); /** * Build the list of called alleles based on reference and called copy numbers diff --git a/src/test/java/org/broadinstitute/hellbender/tools/sv/SVCallRecordUtilsUnitTest.java b/src/test/java/org/broadinstitute/hellbender/tools/sv/SVCallRecordUtilsUnitTest.java index bc06d225e73..183d72eec27 100644 --- a/src/test/java/org/broadinstitute/hellbender/tools/sv/SVCallRecordUtilsUnitTest.java +++ b/src/test/java/org/broadinstitute/hellbender/tools/sv/SVCallRecordUtilsUnitTest.java @@ -23,12 +23,17 @@ public class SVCallRecordUtilsUnitTest { private static final List ALLELES_INS = Lists.newArrayList(Allele.REF_N, Allele.SV_SIMPLE_INS); private static final List ALLELES_BND = Lists.newArrayList(Allele.REF_N, GATKSVVariantContextUtils.BND_ALLELE); private static final List ALLELES_CPX = Lists.newArrayList(Allele.REF_N, GATKSVVariantContextUtils.CPX_ALLELE); + private static final List ALLELES_CTX = Lists.newArrayList(Allele.REF_N, GATKSVVariantContextUtils.CTX_ALLELE); private static final Map TEST_ATTRIBUTES = Collections.singletonMap("TEST_KEY", "TEST_VAL"); private static final Map TEST_ATTRIBUTES_CPX = Lists.newArrayList( new AbstractMap.SimpleImmutableEntry("TEST_KEY", "TEST_VAL"), new AbstractMap.SimpleImmutableEntry(GATKSVVCFConstants.CPX_TYPE, GATKSVVCFConstants.ComplexVariantSubtype.dDUP.toString()) ).stream().collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); + private static final Map TEST_ATTRIBUTES_CTX = Map.of( + "TEST_KEY", "TEST_VAL", + GATKSVVCFConstants.CPX_TYPE, "CTX_PP/QQ" + ); private static final Genotype GENOTYPE_DEL_1 = new GenotypeBuilder("sample1") .alleles(Lists.newArrayList(Allele.REF_N, Allele.SV_SIMPLE_DEL)) @@ -54,6 +59,8 @@ public class SVCallRecordUtilsUnitTest { .alleles(Lists.newArrayList(Allele.REF_N, GATKSVVariantContextUtils.BND_ALLELE)).make(); private static final Genotype GENOTYPE_CPX_1 = new GenotypeBuilder("sample1") .alleles(Lists.newArrayList(Allele.REF_N, GATKSVVariantContextUtils.CPX_ALLELE)).make(); + private static final Genotype GENOTYPE_CTX_1 = new GenotypeBuilder("sample1") + .alleles(Lists.newArrayList(Allele.REF_N, GATKSVVariantContextUtils.CTX_ALLELE)).make(); private static final Comparator RECORD_COMPARATOR = SVCallRecordUtils.getCallComparator(SVTestUtils.hg38Dict); @@ -570,6 +577,15 @@ public Object[][] testCreateData() { SVTestUtils.PESR_ONLY_ALGORITHM_LIST, ALLELES_CPX, Collections.singletonList(GENOTYPE_CPX_1), TEST_ATTRIBUTES, Collections.emptySet(), null) }, + { + SVTestUtils.newVariantContext("var11", "chr1", 1000, 1000, + ALLELES_CTX, Collections.singletonList(GENOTYPE_CTX_1), -1, null, + GATKSVVCFConstants.StructuralVariantAnnotationType.CTX, SVTestUtils.PESR_ONLY_ALGORITHM_LIST, + "chrX", 2000, TEST_ATTRIBUTES_CTX, null), + new SVCallRecord("var11", "chr1", 1000, null, "chrX", 2000, null, GATKSVVCFConstants.StructuralVariantAnnotationType.CTX, GATKSVVCFConstants.ComplexVariantSubtype.CTX_PP_QQ, null, + SVTestUtils.PESR_ONLY_ALGORITHM_LIST, ALLELES_CTX, Collections.singletonList(GENOTYPE_CTX_1), + TEST_ATTRIBUTES, Collections.emptySet(), null) + }, }; }