Search in sources :

Example 1 with FixedSizeReadPairConcordanceCalculator

use of au.edu.wehi.idsv.FixedSizeReadPairConcordanceCalculator in project gridss by PapenfussLab.

the class ExtractSVReadsTest method hasReadPairingConsistentWithReference_should_search_for_any_concordant_pair.

@Test
public void hasReadPairingConsistentWithReference_should_search_for_any_concordant_pair() {
    FixedSizeReadPairConcordanceCalculator rpcc = new FixedSizeReadPairConcordanceCalculator(10, 20);
    List<SAMRecord> list = Lists.newArrayList(DP(0, 1, "10M", true, 1, 1, "10M", false));
    assertFalse(ExtractSVReads.hasReadPairingConsistentWithReference(rpcc, list));
    // positions are consistent but they from alternate mappings of the same read
    list.addAll(Lists.newArrayList(DP(0, 10, "10M", false, 2, 2, "10M", false)));
    assertFalse(ExtractSVReads.hasReadPairingConsistentWithReference(rpcc, list));
    list.addAll(Lists.newArrayList(DP(0, 20, "10M", false, 0, 10, "10M", false)));
    assertTrue(ExtractSVReads.hasReadPairingConsistentWithReference(rpcc, list));
}
Also used : SAMRecord(htsjdk.samtools.SAMRecord) FixedSizeReadPairConcordanceCalculator(au.edu.wehi.idsv.FixedSizeReadPairConcordanceCalculator) IntermediateFilesTest(au.edu.wehi.idsv.IntermediateFilesTest) Test(org.junit.Test)

Example 2 with FixedSizeReadPairConcordanceCalculator

use of au.edu.wehi.idsv.FixedSizeReadPairConcordanceCalculator in project gridss by PapenfussLab.

the class ExtractSVReadsTest method hasReadPairingConsistentWithReference_should_use_primary_alignment_for_split_alignments.

@Test
public void hasReadPairingConsistentWithReference_should_use_primary_alignment_for_split_alignments() {
    SAMRecord r = Read(0, 1, "5M5S");
    r.setAttribute("SA", new ChimericAlignment(Read(1, 50, "10M")).toString());
    r.setMateAlignmentStart(100);
    r.setMateNegativeStrandFlag(true);
    r.setMateReferenceIndex(1);
    r.setReadPairedFlag(true);
    r.setMateUnmappedFlag(false);
    r.setSupplementaryAlignmentFlag(true);
    Assert.assertTrue(ExtractSVReads.hasReadPairingConsistentWithReference(new FixedSizeReadPairConcordanceCalculator(0, 100), ImmutableList.of(r)));
}
Also used : ChimericAlignment(au.edu.wehi.idsv.sam.ChimericAlignment) SAMRecord(htsjdk.samtools.SAMRecord) FixedSizeReadPairConcordanceCalculator(au.edu.wehi.idsv.FixedSizeReadPairConcordanceCalculator) IntermediateFilesTest(au.edu.wehi.idsv.IntermediateFilesTest) Test(org.junit.Test)

Aggregations

FixedSizeReadPairConcordanceCalculator (au.edu.wehi.idsv.FixedSizeReadPairConcordanceCalculator)2 IntermediateFilesTest (au.edu.wehi.idsv.IntermediateFilesTest)2 SAMRecord (htsjdk.samtools.SAMRecord)2 Test (org.junit.Test)2 ChimericAlignment (au.edu.wehi.idsv.sam.ChimericAlignment)1