Skip to content

Commit

Permalink
Remove requirement that zero length reads need color space or flow si… (
Browse files Browse the repository at this point in the history
#1360)

* Remove requirement that zero length reads need color space or flow signal data.
  • Loading branch information
nh13 authored and lbergelson committed Jun 5, 2019
1 parent 6df21e5 commit adea7d1
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/main/java/htsjdk/samtools/SAMRecord.java
Original file line number Diff line number Diff line change
Expand Up @@ -2044,7 +2044,16 @@ public List<SAMValidationError> isValid(final boolean firstOnly) {
ret.addAll(errors);
if (firstOnly) return ret;
}
// TODO(mccowan): Is this asking "is this the primary alignment"?

/*
The SAM specification allows both empty bases and qualities. However, for data generated with color space
information (ex. SOLiD sequencing) or flow signal information (ex. Ion Torrent sequencing), we have enforced
that certain auxiliary tags are present: CS and CQ for color space data, and FZ for flow signal data. See section
1.6 ("Technology-specific data") in the SAM specification (dated Jan 30 2019). We have relaxed this constraint
to follow the SAM specification and a requested need to represent data in such a spec-compliant way. For more
information, see:
1. https://github.com/samtools/htsjdk/issues/1174
2. https://github.com/samtools/htsjdk/pull/1360
if (this.getReadLength() == 0 && !this.isSecondaryAlignment()) {
final Object fz = getAttribute(SAMTag.FZ.getBinaryTag());
if (fz == null) {
Expand Down Expand Up @@ -2073,6 +2082,8 @@ public List<SAMValidationError> isValid(final boolean firstOnly) {
}
}
}
*/

if (this.getReadLength() != getBaseQualities().length && !Arrays.equals(getBaseQualities(), NULL_QUALS)) {
if (ret == null) ret = new ArrayList<>();
ret.add(new SAMValidationError(SAMValidationError.Type.MISMATCH_READ_LENGTH_AND_QUALS_LENGTH,
Expand Down

0 comments on commit adea7d1

Please sign in to comment.