Skip to content

Don't look at chr "*" for unmapped-placed reads with view --fetch-pairs#2070

Merged
daviesrob merged 1 commit into
samtools:developfrom
jkbonfield:fetch-pairs-fix
Jun 20, 2024
Merged

Don't look at chr "*" for unmapped-placed reads with view --fetch-pairs#2070
daviesrob merged 1 commit into
samtools:developfrom
jkbonfield:fetch-pairs-fix

Conversation

@jkbonfield

Copy link
Copy Markdown
Contributor

The logic previously included rec->core.flag & BAM_FMUNMAP but a placed read while unmapped does have a chromesome and position. Searching in HTS_IDX_NOCOOR is both a very expensive operation and also won't actually find the pair we're looking for.

Also fixed the test data. It looks like one record was manually edited to move it to the unmapped chr "*", but none of the other fields were corrected. Hence it breaks the assertion in the man page about RNEXT, PNEXT and TLEN being correct.

Fixes #2059

The logic previously included `rec->core.flag & BAM_FMUNMAP` but a
placed read while unmapped does have a chromesome and position.
Searching in HTS_IDX_NOCOOR is both a very expensive operation and
also won't actually find the pair we're looking for.

Also fixed the test data.  It looks like one record was manually
edited to move it to the unmapped chr "*", but none of the other
fields were corrected.  Hence it breaks the assertion in the man page
about RNEXT, PNEXT and TLEN being correct.

Fixes samtools#2059
@daviesrob daviesrob self-assigned this Jun 13, 2024
@daviesrob daviesrob merged commit 972c188 into samtools:develop Jun 20, 2024
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.

samtools view with -L, -M and --fetch-pairs doing full CRAM traversal

2 participants