Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix CRAM region queries when CIGAR isn't being decoded.
If using the required_fields option to select columns for decoding, excluding CIGAR, then the sequence end position (cr->apos to cr->aend) is not set correctly. With CIGAR computed, ref_pos is increased by each CIGAR option. Without it it'll end up being equivalent to cr->apos-1. Now it is always minimum cr->apos itself (ie covers apos to apos inclusive). The impact of this is filtering for the entirety of a single chromosome could leave a sequence as pos 1 with apos=1 aend=0, which then rejected the sequence as aend < 1 (for region chr:1-LEN). I think this also fixes samtools/samtools#1574, but cannot be sure without confirmation.
- Loading branch information