use of au.edu.wehi.idsv.SAMEvidenceSource in project gridss by PapenfussLab.
the class NonReferenceContigAssemblerTest method should_call_simple_fwd_RP.
@Test
public void should_call_simple_fwd_RP() {
ProcessingContext pc = getContext();
pc.getAssemblyParameters().k = 4;
SAMEvidenceSource ses = SES(100, 200);
DiscordantReadPair e = (DiscordantReadPair) NRRP(ses, withSequence("ACGTGGTCGACC", DP(0, 50, "12M", true, 1, 1, "12M", false)));
List<SAMRecord> output = go(pc, true, e);
assertEquals(1, output.size());
SoftClipEvidence ass = SoftClipEvidence.create(AES(ses), FWD, output.get(0));
assertEquals(e.getBreakendSummary().localBreakend(), ass.getBreakendSummary());
assertEquals("ACGTGGTCGACC", S(ass.getBreakendSequence()));
assertEquals("", S(ass.getAnchorSequence()));
}
use of au.edu.wehi.idsv.SAMEvidenceSource in project gridss by PapenfussLab.
the class AggregateNodeIteratorTest method should_aggregate_kmer_weights.
@Test
public void should_aggregate_kmer_weights() {
int k = 4;
SAMEvidenceSource ses = SES(30, 60);
List<DirectedEvidence> input = new ArrayList<DirectedEvidence>();
input.add(NRRP(ses, withQual(new byte[] { 1, 1, 1, 1, 1 }, withSequence("ACGTT", DP(0, 1, "5M", false, 1, 1, "5M", false)))));
input.add(NRRP(ses, withQual(new byte[] { 1, 1, 1, 1, 1 }, withSequence("ACGTT", DP(0, 2, "5M", false, 1, 1, "5M", false)))));
Collections.sort(input, DirectedEvidence.ByStartEnd);
List<KmerSupportNode> snList = Lists.newArrayList(new SupportNodeIterator(k, input.iterator(), ses.getMaxConcordantFragmentSize(), null, false, 0));
List<KmerNode> anList = Lists.newArrayList(new AggregateNodeIterator(snList.iterator()));
assertTrue(KmerNodeUtil.ByLastStart.isOrdered(anList));
assertEquals(4, snList.size());
assertEquals(6, anList.size());
}
use of au.edu.wehi.idsv.SAMEvidenceSource in project gridss by PapenfussLab.
the class AllocateEvidenceTest method should_annotate_reads.
@Test
public void should_annotate_reads() throws IOException {
final ProcessingContext pc = getCommandlineContext();
pc.getVariantCallingParameters().minScore = 0;
pc.getVariantCallingParameters().minSize = 0;
createInput(RP(0, 1, 10), DP(0, 1, "5M5S", true, 1, 10, "5M", true), DP(0, 2, "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));
// both breakends
assertEquals(2 * 1, vcfs.size());
assertSymmetrical(vcfs);
List<VariantContextDirectedBreakpoint> results = Lists.newArrayList(cmd.iterator(new AutoClosingIterator<>(vcfs.iterator()), MoreExecutors.newDirectExecutorService()));
assertSymmetrical(results);
assertEquals(vcfs.size(), results.size());
VariantContextDirectedBreakpoint e = results.get(0);
assertEquals(2, e.getBreakpointEvidenceCount());
assertEquals(2, e.getBreakendEvidenceCountSoftClip());
}
use of au.edu.wehi.idsv.SAMEvidenceSource in project gridss by PapenfussLab.
the class AllocateEvidenceTest method should_apply_filters.
@Test
public void should_apply_filters() throws IOException {
final ProcessingContext pc = getCommandlineContext();
pc.getVariantCallingParameters().minScore = 0;
pc.getVariantCallingParameters().minSize = 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));
// both breakends
assertEquals(2 * 1, vcfs.size());
assertSymmetrical(vcfs);
List<VariantContextDirectedBreakpoint> results = Lists.newArrayList(cmd.iterator(new AutoClosingIterator<>(vcfs.iterator()), MoreExecutors.newDirectExecutorService()));
assertSymmetrical(results);
// single read support
assertEquals(0, results.size());
}
use of au.edu.wehi.idsv.SAMEvidenceSource in project gridss by PapenfussLab.
the class StaticDeBruijnPathGraphGexfExporterTest method positional_should_export_dot.
@Test
@Category(Hg19Tests.class)
public void positional_should_export_dot() throws IOException {
File output = new File(super.testFolder.getRoot(), "chr12-244000.vcf");
setReference(Hg19Tests.findHg19Reference("chr12.fa"));
createInput(new File("src/test/resources/chr12-244000.tagged.bam"));
BuildBamIndex bbi = new BuildBamIndex();
bbi.instanceMain(new String[] { "I=" + input.getAbsolutePath() });
ProcessingContext pc = getCommandlineContext();
SAMEvidenceSource ses = new SAMEvidenceSource(pc, input, null, 0);
AssemblyEvidenceSource aes = new AssemblyEvidenceSource(pc, ImmutableList.of(ses), output);
aes.assembleBreakends(null);
File dir = new File(super.testFolder.getRoot(), "visualisation");
File[] export = dir.listFiles((FileFilter) new WildcardFileFilter("*.dot"));
// TODO: change graph write timing
assertTrue(export != null && export.length > 0);
}
Aggregations