Skip to content

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

Description

@acorvelo

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!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions