-
Notifications
You must be signed in to change notification settings - Fork 277
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement pileup(contig=None) for unindexed/SAM files (PR #916)
Reorganise pileup() so that it chooses between IteratorColumnRegion/ IteratorColumnAllRefs/IteratorColumnAll primarily by has_coord (i.e., whether contig+etc/region was specified) and secondarily by has_index. Add IteratorColumnAll() which iterates as per HTS_IDX_REST, piling up the entire file, which works without an index and for SAM files. Fixes #915. Unfortunately sam_itr_next() does not work for SAM files (even for HTS_IDX_REST) prior to HTSlib 1.10. Instead we follow samtools mpileup's lead and special case this to use sam_read1() at the bottom level instead of an HTS_IDX_REST iterator. We duplicate __advance_all() and __advance_nofilter() functions, but __advance_samtools() is itself complicated enough that we just make it handle both cases instead.
- Loading branch information
Showing
2 changed files
with
127 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters