Skip to content

Commit

Permalink
Excluding single binversion-like breakpoints from minSize check as th…
Browse files Browse the repository at this point in the history
…e event size is not known from just the single breakpoint
  • Loading branch information
d-cameron committed Aug 29, 2017
1 parent fb54db8 commit 9628202
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>au.edu.wehi</groupId>
<artifactId>gridss</artifactId>
<packaging>jar</packaging>
<version>1.4.2</version>
<version>1.4.3</version>
<name>gridss</name>
<url>https://github.com/PapenfussLab/gridss</url>
<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,38 @@ public VariantContextDirectedBreakpoint(GenomicProcessingContext processContext,
public Integer getEventSize() {
BreakendSummary low = getBreakendSummary().lowBreakend();
BreakendSummary high = getBreakendSummary().highBreakend();
if (low.referenceIndex != high.referenceIndex) return null;
if (low.referenceIndex != high.referenceIndex) {
return null;
}
int sizeAdjustment = -1; // assume indel
if (low.direction == high.direction) {
// inversion
sizeAdjustment = 0;
// requires a second breakpoint to explain - we're not going to assume this breakpoint exists
// as the event could be a large fold-back inversion
return null;
} else if (low.direction == BreakendDirection.Backward && high.direction == BreakendDirection.Forward) {
// tandem dup
sizeAdjustment = 1;
}
return high.nominal - low.nominal + getUntemplatedSequence().length() + sizeAdjustment;
}
/**
* Size of indel event.
* @return size of indel inferred by breakpoint, null otherwise
*/
public Integer getIndelSize() {
BreakendSummary low = getBreakendSummary().lowBreakend();
BreakendSummary high = getBreakendSummary().highBreakend();
if (low.direction == high.direction) {
// inversion
return null;
} else if (low.direction == BreakendDirection.Backward && high.direction == BreakendDirection.Forward) {
// tandem dup
return null;
}
return getEventSize();
}
@Override
public BreakpointSummary getBreakendSummary() {
return (BreakpointSummary)super.getBreakendSummary();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,12 @@ public void getEventSize_INSDEL() {
public void getEventSize_DUP() {
assertEquals(4, (int)BP("dup", new BreakpointSummary(0, FWD, 10, 0, BWD, 7)).getEventSize());
}
/**
* inversion have two breakpoints - we don't know the event size unless we actually have both of them
*/
@Test
public void getEventSize_INV() {
assertEquals(4, (int)BP("inv", new BreakpointSummary(0, FWD, 6, 0, FWD, 10)).getEventSize());
assertEquals(4, (int)BP("inv", new BreakpointSummary(0, BWD, 11, 0, BWD, 7)).getEventSize());
assertEquals(null, BP("inv", new BreakpointSummary(0, FWD, 6, 0, FWD, 10)).getEventSize());
assertEquals(null, BP("inv", new BreakpointSummary(0, BWD, 11, 0, BWD, 7)).getEventSize());
}
}

0 comments on commit 9628202

Please sign in to comment.