class
HTS::Bam::Pileup
- HTS::Bam::Pileup
- Reference
- Object
Overview
High-level pileup iterator over a single BAM/CRAM input. Yields a zero-copy Column view (tid, pos, and per-read Alignment access) at each position. Iterating a Column allocates nothing per read; see Column's borrowing contract for the validity rules.
Defined in:
hts/bam/pileup.crConstructors
-
.new(bam : Bam, region : String | Nil = nil, maxcnt : Int32 | Nil = nil, *, filter : Filter = Filter.new)
Create a Pileup iterator @param bam [HTS::Bam] @param region [String, nil] Optional region string (e.g., "chr1:1000-2000", requires index) @param maxcnt [Int32, nil] Max per-position depth (capped) @param filter [Filter] Read-level filter applied before pileup (see Filter)
Class Method Summary
-
.open(bam : Bam, region : String | Nil = nil, maxcnt : Int32 | Nil = nil, *, filter : Filter = Filter.new, &)
Open a Pileup iterator with block (RAII style)
-
.open(bam : Bam, *, region : String | Nil = nil, maxcnt : Int32 | Nil = nil, filter : Filter = Filter.new, &)
Open a Pileup iterator using keyword arguments, matching Mpileup.
Instance Method Summary
-
#close : Nil
Release native resources
-
#count : Int32
Count pileup columns by consuming this iterator.
-
#count(& : Column -> Bool) : Int32
Count pileup columns matching the block by consuming this iterator.
-
#each(& : Column -> ) : Nil
Iterate over pileup columns.
- #finalize
-
#reset : Nil
Reset internal state, if needed by the caller
Constructor Detail
Create a Pileup iterator @param bam [HTS::Bam] @param region [String, nil] Optional region string (e.g., "chr1:1000-2000", requires index) @param maxcnt [Int32, nil] Max per-position depth (capped) @param filter [Filter] Read-level filter applied before pileup (see Filter)
Class Method Detail
Open a Pileup iterator with block (RAII style)
Open a Pileup iterator using keyword arguments, matching Mpileup.
Instance Method Detail
Count pileup columns matching the block by consuming this iterator.
Iterate over pileup columns. Yields a zero-copy Column view valid only for the duration of the block (see Column's borrowing contract).