dhtslib.sam

SAMRecord and SAMFile are wrappers for htslib functions relating to SAM/BAM/CRAM* files

SAMRecord is a structured representation of a SAM/BAM/CRAM* record, backed internally by htslib's bam1_t, but with convenient getters and setters for record attributes, including functions not included in vanilla htslib like returning the sequence or the qscore string (NB: actually char*)

SAMFile is a structured representation of SAM/BAM/CRAM* file, backed internally by htslib's htsFile and bam_hdr_t, but with convenient getters and setters for file and header attributes, as well as query functions accessible explicitly (query("chr1:999-9999") and by indexing (samfile["chr1", 999 .. 9999]). The file object can be iterated as an InputRange to obtain every record in the file.

Modules

header
module dhtslib.sam.header

Undocumented in source.

Public Imports

dhtslib.sam.header
public import dhtslib.sam.header;

Members

Aliases

SAMFile
alias SAMFile = SAMReader

Undocumented in source.

Classes

SAMRecord
class SAMRecord

Encapsulates a SAM/BAM/CRAM record, using the bam1_t type for memory efficiency, and the htslib helper functions for speed.

Enums

SAMWriterTypes
enum SAMWriterTypes

SAM/BAM/CRAM disk format

Functions

cmpInterval
bool cmpInterval(hts_pair32_t a, hts_pair32_t b)

Used in sorting

cmpRegList
bool cmpRegList(hts_reglist_t a, hts_reglist_t b)

Used in sorting

Structs

SAMReader
struct SAMReader

Encapsulates a SAM/BAM file.

SAMWriter
struct SAMWriter

Encapsulates a SAM/BAM/CRAM, but as write-only

Bugs

SAMRecord and SAMFile function only as readers, rather than writers (i.e, cannot build SAMFile) (*CRAM functionality is limited and untested)

Meta

Authors

James S Blachly, MD <james.blachly@gmail.com> ; Thomas Gregory <charles.gregory@osumc.edu>

Date

Date: 2020-09-12

Standards

Sequence Alignment/Map Format Specification v1 14 Dec 2018 http://samtools.github.io/hts-specs/

License

Apache 2.0