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

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

Closed
acorvelo opened this issue May 23, 2024 · 1 comment · Fixed by samtools/htslib#1787
Assignees

Comments

@acorvelo
Copy link

samtools 1.20
htslib 1.20
Linux 3.10.0-1160.71.1.el7.x86_64

Hi,
in samtools view, I'm getting an error when using a BED file containing zero-length intervals (for instance representing the reference span of an insertion) specified by the option -L and using the multi-region iterator -M to extract reads from BAM.

Error:

[E::hts_itr_regions] Failed to create the multi-region iterator!
samtools view: Iterator could not be created. Aborting.

Command:
samtools view -M -L intervals.bed ${BAM}

Example intervals.bed:

chr1	1000000	1000000

The same command works as intended on CRAM. It would be great to have it also working for BAM so that the workflows that depend on it work regardless of the input format.

Thanks!

@whitwham
Copy link
Contributor

Yes, beginning and end being the same point is handled differently in the BAM and CRAM code. Making them the same should be straightforward.

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 a pull request may close this issue.

2 participants