struct
HTS::Bam::Pileup::Column
- HTS::Bam::Pileup::Column
- Struct
- Value
- Object
Overview
A pileup column at a genomic position, as a zero-copy view over htslib's current pileup buffer. It holds only pointers and constructs Alignment values lazily, so iterating (#each / #[]) allocates nothing per read and matches the C mpileup hot-path cost.
BORROWING CONTRACT: a Column and any Alignment obtained from it are valid ONLY during the current iteration step (the current block invocation). To retain data across positions, read the copied-out scalars (Alignment#base, #base_qual, #query_pos) or call Alignment#record. Do not deref a Column after the iterator advances or the Pileup is closed.
This borrowed view intentionally does not include Enumerable: methods
such as to_a or map would make short-lived C-backed entries look
like ordinary retained Crystal values.
Defined in:
hts/bam/pileup.crConstructors
Instance Method Summary
- #[](index : Int32) : Alignment
-
#chrom : String
Reference (chromosome) name for this position Returns empty string if tid is -1 (unmapped)
-
#count : Int32
Number of reads covering this position.
-
#count(& : Alignment -> Bool) : Int32
Count reads matching the block without materializing an Array.
-
#depth : Int32
Depth equals number of alignments covering this position
-
#each(& : Alignment -> ) : Nil
Iterate the reads covering this position without allocating an Array.
- #pos : Int64
- #tid : Int32
Constructor Detail
Instance Method Detail
Reference (chromosome) name for this position Returns empty string if tid is -1 (unmapped)
Count reads matching the block without materializing an Array.
Iterate the reads covering this position without allocating an Array.