-
Notifications
You must be signed in to change notification settings - Fork 442
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide extra CRAM container manipulations and index queries.
Added to support extra functionality to `samtools cat`. - Some internal cram functions are no longer static as they're called from cram_external.c, but they don't have HTSLIB_EXPORT and aren't an official part of the API. These are cram_to_bam, cram_next_slice - New public CRAM APIs: These facilitate manipulation at the container level, both seeking to specific byte offsets, but also being able to specify containers as the n^th container listed in the index. cram_container_get_coords returns refid, start and span fields from the opaque cram_container struct. cram_filter_container copies a container but applies region based filtering, as already specified in the cram_fd with a range request. (Note we currently also provide cram_copy_slice, but may want to add a cram_copy_container for consistency.) cram_index_extents queries an index to return byte offsets of the first and last container overlapping a specified region. cram_num_containers_between queries an index to report the number of indexed containers and their container numbers (starting at 0 for the first) covering a range. cram_num_containers is a simplified cram_num_containers_between doing only the counting operation and on the entire file. cram_container_num2offset returns the byte offset for the n^th container. cram_container_offset2num does the reverse. - A new cram_skip_container function, which is currently internal only but may potentially have use externally in the future. It's used by cram_filter_container when it detects it'll filter out everything. - cram_index_query now copes with HTS_IDX_NOCOOR (-2) and maps it over to refid -1.
- Loading branch information
1 parent
4510241
commit 3bd6c64
Showing
5 changed files
with
493 additions
and
7 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
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
Oops, something went wrong.