Skip to content

Commit

Permalink
palindorme ITR artifact transformer skips reads whose contigs are not…
Browse files Browse the repository at this point in the history
… in sequence dictionary (#6968)
  • Loading branch information
davidbenjamin committed Jan 26, 2022
1 parent 2c167ee commit 4cbff5d
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import htsjdk.samtools.Cigar;
import htsjdk.samtools.CigarOperator;
import htsjdk.samtools.SAMSequenceDictionary;
import htsjdk.samtools.SAMSequenceRecord;
import org.apache.commons.lang3.mutable.MutableInt;
import org.broadinstitute.hellbender.engine.ReferenceDataSource;
import org.broadinstitute.hellbender.utils.BaseUtils;
Expand Down Expand Up @@ -95,7 +96,8 @@ public GATKRead apply(final GATKRead read) {

// it's possible that the read's assigned fragment length / mate start were incompatible with the contig length,
// so we explicitly check for this case to avoid errors below. We can't rely on the alignment!
if (refStart < 1 || refEnd > sequenceDictionary.getSequence(contig).getSequenceLength()) {
final SAMSequenceRecord sequenceRecord = sequenceDictionary.getSequence(contig);
if (refStart < 1 || sequenceRecord == null || refEnd > sequenceRecord.getSequenceLength()) {
return read;
}

Expand Down

0 comments on commit 4cbff5d

Please sign in to comment.