class HTS::Bam::Pileup

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.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.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)


[View source]

Class Method Detail

def self.open(bam : Bam, region : String | Nil = nil, maxcnt : Int32 | Nil = nil, *, filter : Filter = Filter.new, &) #

Open a Pileup iterator with block (RAII style)


[View source]
def self.open(bam : Bam, *, region : String | Nil = nil, maxcnt : Int32 | Nil = nil, filter : Filter = Filter.new, &) #

Open a Pileup iterator using keyword arguments, matching Mpileup.


[View source]

Instance Method Detail

def close : Nil #

Release native resources


[View source]
def count : Int32 #

Count pileup columns by consuming this iterator.


[View source]
def count(& : Column -> Bool) : Int32 #

Count pileup columns matching the block by consuming this iterator.


[View source]
def each(& : Column -> ) : Nil #

Iterate over pileup columns. Yields a zero-copy Column view valid only for the duration of the block (see Column's borrowing contract).


[View source]
def finalize #

[View source]
def reset : Nil #

Reset internal state, if needed by the caller


[View source]