class
HTS::Bam::Mpileup
- HTS::Bam::Mpileup
- Reference
- Object
Overview
High-level mpileup iterator over multiple BAM/CRAM inputs. Yields a zero-copy Position view for each genomic position. A Position is an ordered collection of Pileup::Column views (one per input); index it with position[i] or iterate it. Nothing is allocated per position, and Alignment values are constructed lazily only for the reads the consumer touches, so it matches the C mpileup hot-path cost. See Pileup::Column's borrowing contract.
Defined in:
hts/bam/mpileup.crConstructors
Class Method Summary
-
.open(inputs : Array(Bam), maxcnt : Int32 | Nil = nil, overlaps : Bool = false, *, region : String | Nil = nil, regions : Array(String) | Nil = nil, filter : Pileup::Filter = Pileup::Filter.new, &)
Open an Mpileup iterator with block (RAII style)
-
.open(inputs : Array(Bam), *, maxcnt : Int32 | Nil = nil, overlaps : Bool = false, region : String | Nil = nil, regions : Array(String) | Nil = nil, filter : Pileup::Filter = Pileup::Filter.new, &)
Open an Mpileup iterator using keyword arguments.
Instance Method Summary
- #close : Nil
-
#count : Int32
Count mpileup positions by consuming this iterator.
-
#count(& : Position -> Bool) : Int32
Count mpileup positions matching the block by consuming this iterator.
-
#each(& : Position -> ) : Nil
Iterate and yield a zero-copy Position view per genomic position.
- #finalize
Constructor Detail
Accept Array(Bam). If region is set, it uses SAM-style 1-based inclusive
coordinates and each input must already have an index loaded. If regions
is set, htslib's multi-region iterator is used and overlapping records
are returned once. filter applies the same read-level filtering as
single-input Pileup (see Pileup::Filter).
Class Method Detail
Open an Mpileup iterator with block (RAII style)
Open an Mpileup iterator using keyword arguments.
Instance Method Detail
Count mpileup positions matching the block by consuming this iterator.
Iterate and yield a zero-copy Position view per genomic position. The view is valid only for the duration of the block (see Position's contract).