Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make BAM zero-length intervals work like CRAM #1787

Merged
merged 1 commit into from
Jun 6, 2024

Conversation

whitwham
Copy link
Contributor

@whitwham whitwham commented May 31, 2024

For a BED file with:
chr1 1000 1000

samtools view -M -L intervals.bed $infile worked with CRAM multi-region iterator but not with BAM. This change makes them work the same. Fixes samtools/samtools#2060.

NB Even though BED file format (spec) has a 0-based, half-open coordinate system, having the same beginning and end coordinate is valid.

For a BED file with:
chr1 1000 1000

Worked with CRAM multi-region iterator but not with BAM.  This change makes them work the same.  Fixes #2060.
@daviesrob daviesrob merged commit 1c8c335 into samtools:develop Jun 6, 2024
9 checks passed
@jkbonfield
Copy link
Contributor

Ironically I just hit this very same bug! (Thanks for the fix.)

The test data in samtools/samtools#2063 demonstrates this as it includes chr7 34925 34925 in the test.bed file. It worked on CRAM, but died on BAM for the same data. Curious timing, but saved me some deep diving. :)

@whitwham whitwham deleted the bam_zero_length_intervals branch September 30, 2024 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extracting reads overlapping zero-length intervals works on CRAM but not on BAM when -M is set
3 participants