Skip to content

Commit

Permalink
#404 hard limit maximum assembly base quality to the max of 93 repres…
Browse files Browse the repository at this point in the history
…entable by Sanger format fastq.
  • Loading branch information
Daniel Cameron committed Dec 10, 2020
1 parent f529c82 commit af820da
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/au/edu/wehi/idsv/AssemblyFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ private static SAMRecord createAssemblySAMRecord(
record.setAttribute(SamTags.UNANCHORED, 1);
} else {
record.setReadBases(baseCalls);
for (int i = 0 ;i < baseQuals.length; i++) {
baseQuals[i] = (byte)Math.min((int)baseQuals[i] & 0xFF, 93);
}
record.setBaseQualities(baseQuals);
if (breakend.start != breakend.end) {
throw new IllegalArgumentException("Imprecisely anchored breakends not supported by this constructor");
Expand Down
7 changes: 7 additions & 0 deletions src/test/java/au/edu/wehi/idsv/AssemblyFactoryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -540,5 +540,12 @@ public void realignment_of_breakpoint_outside_of_contig_bounds_should_have_inexa
assertEquals(new BreakendSummary(0, BWD, 1), re.getBreakendSummary().localBreakend());
assertEquals(new BreakendSummary(1, FWD, 212, 202, 222), re.getBreakendSummary().remoteBreakend());
}
@Test
public void basequal_range_should_be_limited() {
SAMRecord r = AssemblyFactory.createAnchoredBreakend(
getContext(), AES(), new SequentialIdGenerator("asm"), BWD, null,null,
0, 1, 2, B("GTACC"), new byte[] { 92,93,(byte)254,-1,94 });
assertArrayEquals(new byte[] { 92, 93,93,93,93}, r.getBaseQualities());
}
}

0 comments on commit af820da

Please sign in to comment.