use of au.edu.wehi.idsv.BreakpointSummary in project gridss by PapenfussLab.
the class BreakpointHomologyTest method should_reduce_window_size_for_small_events.
@Test
public void should_reduce_window_size_for_small_events() {
BreakpointHomology bh = BreakpointHomology.calculate(SMALL_FA, new BreakpointSummary(0, FWD, 100, 0, BWD, 103), "", 100, 0);
assertEquals(2, bh.getLocalHomologyLength());
assertEquals(2, bh.getRemoteHomologyLength());
}
use of au.edu.wehi.idsv.BreakpointSummary in project gridss by PapenfussLab.
the class BreakpointHomologyTest method should_not_exceed_contig_bounds.
@Test
public void should_not_exceed_contig_bounds() {
InMemoryReferenceSequenceFile underlying = new InMemoryReferenceSequenceFile(new String[] { "0", "1" }, new byte[][] { B("CCCCCCCCCCC"), B("AAAAAAAAAAA") });
// BreakpointHomology bh0 = BreakpointHomology.calculate(ref, new BreakpointSummary(0, FWD, 1, 1, BWD, 20), "", 50, 50);
TwoBitBufferedReferenceSequenceFile ref = new TwoBitBufferedReferenceSequenceFile(underlying);
for (int b1pos = 1; b1pos <= ref.getSequenceDictionary().getSequences().get(0).getSequenceLength(); b1pos++) {
for (int b2pos = 1; b2pos <= ref.getSequenceDictionary().getSequences().get(0).getSequenceLength(); b2pos++) {
for (BreakendDirection b1dir : BreakendDirection.values()) {
for (BreakendDirection b2dir : BreakendDirection.values()) {
for (int maxBreakendLength = 1; maxBreakendLength < ref.getSequenceDictionary().getSequences().get(0).getSequenceLength() + 2; maxBreakendLength++) {
for (int margin = 0; margin < ref.getSequenceDictionary().getSequences().get(0).getSequenceLength() + 2; margin++) {
BreakpointHomology bh = BreakpointHomology.calculate(ref, new BreakpointSummary(0, b1dir, b1pos, 1, b2dir, b2pos), "", maxBreakendLength, margin);
assertEquals(0, bh.getLocalHomologyLength());
assertEquals(0, bh.getRemoteHomologyLength());
}
}
}
}
}
}
}
use of au.edu.wehi.idsv.BreakpointSummary in project gridss by PapenfussLab.
the class BreakpointHomologyTest method should_incorporate_inserted_sequence.
@Test
public void should_incorporate_inserted_sequence() {
InMemoryReferenceSequenceFile ref = new InMemoryReferenceSequenceFile(new String[] { "0", "1" }, new byte[][] { B("CCCAAAATTTGGGAAAAAATTTTTTTTTTTTTTTTTTT"), B("TTTAAAATTTGGGAAAAAAGGGGGGGGGGGGGGGGGGG") });
// CCCAAAATTT GGGAAAAAATTTTTTTTTTT TTTTTTTT"),
// TTTAAAATTT GGGAAAAAAGGGGGGGGGGG GGGGGGGG"
// MMMMMMMMMMMMMMMMMMMSSSSSSSSSSSS fwd
// SSSMMMMMMMMMMMMMMMMMMMMMMMMMMMM bwd
// 1234567890 1234567890
// >G
// <
//
BreakpointHomology bh = BreakpointHomology.calculate(ref, new BreakpointSummary(0, FWD, 10, 1, BWD, 11), "c", 20, 10);
assertEquals(7, bh.getLocalHomologyLength());
assertEquals(9, bh.getRemoteHomologyLength());
}
use of au.edu.wehi.idsv.BreakpointSummary in project gridss by PapenfussLab.
the class VariantCallingConfigurationTest method margin_should_linearly_reduce_from_margin_at_twice_margin_size_to_zero_at_1bp.
@Test
public void margin_should_linearly_reduce_from_margin_at_twice_margin_size_to_zero_at_1bp() {
VariantCallingConfiguration config = new VariantCallingConfiguration(getDefaultConfig());
config.breakendMargin = 10;
int[] size = new int[] { 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };
int[] expectedMargin = new int[] { 10, 9, 9, 8, 8, 7, 7, 6, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 0, 0 };
for (int i = 0; i < size.length; i++) {
assertEquals(new BreakpointSummary(0, FWD, 100, 100 - expectedMargin[i], 100 + expectedMargin[i], 0, FWD, 100 + size[i], 100 - expectedMargin[i] + size[i], 100 + expectedMargin[i] + size[i]), config.withMargin(new BreakpointSummary(0, FWD, 100, 100, 100, 0, FWD, 100 + size[i], 100 + size[i], 100 + size[i])));
}
}
use of au.edu.wehi.idsv.BreakpointSummary in project gridss by PapenfussLab.
the class BedpeWriter method write.
public void write(VariantContextDirectedBreakpoint variant) throws IOException {
BreakpointSummary bp = variant.getBreakendSummary();
List<String> args = new ArrayList<>();
if (includeUntemplatedSequence) {
args.add(variant.getHomologySequence());
}
if (includeGridssVcfFields) {
args.addAll(Arrays.asList(new String[] { Integer.toString(variant.getBreakpointEvidenceCountLocalAssembly()), Integer.toString(variant.getBreakpointEvidenceCountRemoteAssembly()), Integer.toString(variant.getBreakpointEvidenceCountSoftClip()), Integer.toString(variant.getBreakpointEvidenceCountReadPair()), Double.toString(variant.getBreakpointEvidenceQualLocalAssembly()), Double.toString(variant.getBreakpointEvidenceQualRemoteAssembly()), Double.toString(variant.getBreakpointEvidenceQualSoftClip()), Double.toString(variant.getBreakpointEvidenceQualReadPair()), Integer.toString(variant.getReferenceReadCount()), Integer.toString(variant.getReferenceReadPairCount()) }));
}
write(bp, variant.getID(), Double.toString(variant.getPhredScaledQual()), args.toArray(new String[0]));
}
Aggregations