5 releases
Uses new Rust 2024
| 0.2.0 | Apr 22, 2026 |
|---|---|
| 0.1.3 | Apr 12, 2026 |
| 0.1.2 | Mar 6, 2026 |
| 0.1.1 | Feb 28, 2026 |
| 0.1.0 | Feb 18, 2026 |
#890 in Biology
30 downloads per month
Used in 4 crates
(3 directly)
1MB
19K
SLoC
SAM/BAM file utilities and header manipulation.
This module provides utilities for working with SAM/BAM files, including:
- Checking and validating SAM header sort orders
- Reversing and reverse-complementing per-base tag values
- Template-coordinate sorting validation
- Test utilities for building SAM/BAM records
- Record-level utilities (position mapping, FR pair detection, CIGAR parsing)
- Read-pair clipping utilities
Sort Orders
The module supports several important sort orders:
- queryname - Reads sorted by query name (required for grouping by UMI)
- template-coordinate - Special sort order from fgbio where reads are grouped by query name but ordered by genomic position within each template
Tag Manipulation
Functions are provided to reverse or reverse-complement per-base tag values when reads are mapped to the negative strand, ensuring tag values match the orientation of the read sequence.
Record Utilities
The record_utils submodule provides utilities for working with individual records:
record_utils::read_pos_at_ref_pos- Map reference position to read positionrecord_utils::is_fr_pair_from_tags- Check if read is part of FR pair using tagsrecord_utils::mate_unclipped_start/record_utils::mate_unclipped_end- Get mate boundaries from MC tagrecord_utils::num_bases_extending_past_mate- Calculate overlap with materecord_utils::parse_cigar_string- Parse CIGAR string to operations
Dependencies
~8–15MB
~302K SLoC