Search in sources :

Example 21 with DirectedEvidence

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

the class PositionalAssemblerTest method should_assemble_each_read_alignment_only_once.

@Test
public void should_assemble_each_read_alignment_only_once() {
    ProcessingContext pc = getContext();
    AssemblyEvidenceSource aes = AES(pc);
    pc.getAssemblyParameters().k = 4;
    String seq = "AACCGGTTAA";
    List<DirectedEvidence> input = new ArrayList<DirectedEvidence>();
    input.add(SCE(FWD, withSequence(seq, Read(0, 10, "5M5S"))[0]));
    input.add(SCE(FWD, withSequence(seq, Read(0, 10, "5M5S"))[0]));
    input.add(SCE(FWD, withSequence(seq, Read(0, 10, "5M5S"))[0]));
    input.add(IE(withSequence(seq, Read(0, 10, "5M100D5M"))[0]));
    input.add(IE(withSequence(seq, Read(0, 10, "5M100D5M"))[0]));
    input.add(IE(withSequence(seq, Read(0, 10, "5M100D5M"))[0]));
    input.sort(DirectedEvidenceOrder.ByStartEnd);
    ArrayList<SAMRecord> r = Lists.newArrayList(new PositionalAssembler(pc, aes, new SequentialIdGenerator("asm"), input.iterator()));
    assertEquals(2, ((int[]) r.get(0).getAttribute("sc"))[0]);
}
Also used : ProcessingContext(au.edu.wehi.idsv.ProcessingContext) AssemblyEvidenceSource(au.edu.wehi.idsv.AssemblyEvidenceSource) DirectedEvidence(au.edu.wehi.idsv.DirectedEvidence) SAMRecord(htsjdk.samtools.SAMRecord) ArrayList(java.util.ArrayList) SequentialIdGenerator(au.edu.wehi.idsv.SequentialIdGenerator) Test(org.junit.Test)

Example 22 with DirectedEvidence

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

the class SupportNodeIteratorTest method scrp.

public static List<DirectedEvidence> scrp(int k, String sequence, int minFragSize, int maxFragSize) {
    SAMEvidenceSource ses = SES(minFragSize, maxFragSize);
    byte[] qual = new byte[sequence.length()];
    for (int i = 0; i < qual.length; i++) {
        qual[i] = (byte) i;
    }
    List<DirectedEvidence> input = new ArrayList<DirectedEvidence>();
    for (int i = 1; i <= 100; i++) {
        input.add(SCE(FWD, ses, withQual(qual, withSequence(sequence, Read(0, i, "1S4M6S")))));
        input.add(SCE(BWD, ses, withQual(qual, withSequence(sequence, Read(0, i, "1S4M6S")))));
        input.add(NRRP(ses, withQual(qual, withSequence(sequence, DP(0, i, "1S9M1S", false, 1, 1, "11M", true)))));
        input.add(NRRP(ses, withQual(qual, withSequence(sequence, DP(0, i, "1S9M1S", false, 1, 1, "11M", false)))));
    }
    Collections.sort(input, DirectedEvidence.ByStartEnd);
    return input;
}
Also used : DirectedEvidence(au.edu.wehi.idsv.DirectedEvidence) ArrayList(java.util.ArrayList) SAMEvidenceSource(au.edu.wehi.idsv.SAMEvidenceSource)

Aggregations

DirectedEvidence (au.edu.wehi.idsv.DirectedEvidence)22 ArrayList (java.util.ArrayList)18 Test (org.junit.Test)18 ProcessingContext (au.edu.wehi.idsv.ProcessingContext)14 SAMRecord (htsjdk.samtools.SAMRecord)14 AssemblyEvidenceSource (au.edu.wehi.idsv.AssemblyEvidenceSource)9 SequentialIdGenerator (au.edu.wehi.idsv.SequentialIdGenerator)8 File (java.io.File)6 Lists (com.google.common.collect.Lists)5 List (java.util.List)5 Collectors (java.util.stream.Collectors)5 NonReferenceReadPair (au.edu.wehi.idsv.NonReferenceReadPair)4 SAMEvidenceSource (au.edu.wehi.idsv.SAMEvidenceSource)4 SoftClipEvidence (au.edu.wehi.idsv.SoftClipEvidence)4 IOException (java.io.IOException)4 Assert.assertEquals (org.junit.Assert.assertEquals)4 Assert.assertTrue (org.junit.Assert.assertTrue)4 BreakendSummary (au.edu.wehi.idsv.BreakendSummary)3 IntermediateFilesTest (au.edu.wehi.idsv.IntermediateFilesTest)3 SingleReadEvidence (au.edu.wehi.idsv.SingleReadEvidence)3