Search in sources :

Example 11 with SAMEvidenceSource

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

the class AllocateEvidenceTest method should_filter_if_insufficient_quality.

@Test
public void should_filter_if_insufficient_quality() throws IOException {
    final ProcessingContext pc = getCommandlineContext();
    pc.getVariantCallingParameters().minScore = 1000;
    pc.getVariantCallingParameters().minSize = 0;
    pc.getVariantCallingParameters().minReads = 0;
    createInput(RP(0, 1, 10), DP(0, 1, "5M5S", true, 1, 10, "5M", true));
    SAMEvidenceSource ses = new SAMEvidenceSource(getContext(), input, null, 0);
    ses.ensureMetrics();
    File assemblyFile = new File(testFolder.getRoot(), "assembly.bam");
    AssemblyEvidenceSource aes = new AssemblyEvidenceSource(pc, ImmutableList.of(ses), assemblyFile);
    aes.assembleBreakends(null);
    aes.ensureExtracted();
    VariantCaller caller = new VariantCaller(pc, ImmutableList.of(ses), aes);
    caller.callBreakends(output, MoreExecutors.newDirectExecutorService());
    AllocateEvidence cmd = new AllocateEvidence();
    cmd.INPUT_VCF = output;
    cmd.setContext(pc);
    cmd.setAssemblySource(aes);
    cmd.setSamEvidenceSources(ImmutableList.of(ses));
    cmd.OUTPUT_VCF = new File(testFolder.getRoot(), "annotated.vcf");
    List<VariantContextDirectedBreakpoint> vcfs = Lists.newArrayList(Iterables.filter(getVcf(output, null), VariantContextDirectedBreakpoint.class));
    List<VariantContextDirectedBreakpoint> results = Lists.newArrayList(cmd.iterator(new AutoClosingIterator<>(vcfs.iterator()), MoreExecutors.newDirectExecutorService()));
    assertEquals(0, results.size());
}
Also used : ProcessingContext(au.edu.wehi.idsv.ProcessingContext) AssemblyEvidenceSource(au.edu.wehi.idsv.AssemblyEvidenceSource) AutoClosingIterator(au.edu.wehi.idsv.util.AutoClosingIterator) VariantContextDirectedBreakpoint(au.edu.wehi.idsv.VariantContextDirectedBreakpoint) SAMEvidenceSource(au.edu.wehi.idsv.SAMEvidenceSource) VariantCaller(au.edu.wehi.idsv.VariantCaller) File(java.io.File) IntermediateFilesTest(au.edu.wehi.idsv.IntermediateFilesTest) Test(org.junit.Test)

Example 12 with SAMEvidenceSource

use of au.edu.wehi.idsv.SAMEvidenceSource 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

SAMEvidenceSource (au.edu.wehi.idsv.SAMEvidenceSource)12 ProcessingContext (au.edu.wehi.idsv.ProcessingContext)9 AssemblyEvidenceSource (au.edu.wehi.idsv.AssemblyEvidenceSource)8 Test (org.junit.Test)8 IntermediateFilesTest (au.edu.wehi.idsv.IntermediateFilesTest)6 VariantContextDirectedBreakpoint (au.edu.wehi.idsv.VariantContextDirectedBreakpoint)6 File (java.io.File)6 VariantCaller (au.edu.wehi.idsv.VariantCaller)5 AutoClosingIterator (au.edu.wehi.idsv.util.AutoClosingIterator)5 DirectedEvidence (au.edu.wehi.idsv.DirectedEvidence)3 ArrayList (java.util.ArrayList)3 DiscordantReadPair (au.edu.wehi.idsv.DiscordantReadPair)2 SAMRecord (htsjdk.samtools.SAMRecord)2 IOException (java.io.IOException)2 ExecutionException (java.util.concurrent.ExecutionException)2 DirectedEvidenceOrder (au.edu.wehi.idsv.DirectedEvidenceOrder)1 IdsvVariantContext (au.edu.wehi.idsv.IdsvVariantContext)1 NonReferenceReadPair (au.edu.wehi.idsv.NonReferenceReadPair)1 SequentialCoverageAnnotator (au.edu.wehi.idsv.SequentialCoverageAnnotator)1 SoftClipEvidence (au.edu.wehi.idsv.SoftClipEvidence)1