Skip to content

Commit

Permalink
add unit test for SVCallRecord create from CTX variant
Browse files Browse the repository at this point in the history
  • Loading branch information
epiercehoffman committed Jun 28, 2024
1 parent 36448cb commit 808d708
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public class GATKSVVariantContextUtils {

public static final Allele BND_ALLELE = Allele.create("<BND>");
public static final Allele CPX_ALLELE = Allele.create("<CPX>");
public static final Allele CTX_ALLELE = Allele.create("<CTX>");

/**
* Build the list of called alleles based on reference and called copy numbers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,17 @@ public class SVCallRecordUtilsUnitTest {
private static final List<Allele> ALLELES_INS = Lists.newArrayList(Allele.REF_N, Allele.SV_SIMPLE_INS);
private static final List<Allele> ALLELES_BND = Lists.newArrayList(Allele.REF_N, GATKSVVariantContextUtils.BND_ALLELE);
private static final List<Allele> ALLELES_CPX = Lists.newArrayList(Allele.REF_N, GATKSVVariantContextUtils.CPX_ALLELE);
private static final List<Allele> ALLELES_CTX = Lists.newArrayList(Allele.REF_N, GATKSVVariantContextUtils.CTX_ALLELE);

private static final Map<String, Object> TEST_ATTRIBUTES = Collections.singletonMap("TEST_KEY", "TEST_VAL");
private static final Map<String, Object> TEST_ATTRIBUTES_CPX = Lists.newArrayList(
new AbstractMap.SimpleImmutableEntry<String, Object>("TEST_KEY", "TEST_VAL"),
new AbstractMap.SimpleImmutableEntry<String, Object>(GATKSVVCFConstants.CPX_TYPE, GATKSVVCFConstants.ComplexVariantSubtype.dDUP.toString())
).stream().collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
private static final Map<String, Object> 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))
Expand All @@ -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<SVCallRecord> RECORD_COMPARATOR = SVCallRecordUtils.getCallComparator(SVTestUtils.hg38Dict);

Expand Down Expand Up @@ -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)
},
};
}

Expand Down

0 comments on commit 808d708

Please sign in to comment.