class HTS::Bam

Included Modules

Defined in:

hts/bam.cr
hts/bam/auxi.cr
hts/bam/base_mod.cr
hts/bam/cigar.cr
hts/bam/errors.cr
hts/bam/flag.cr
hts/bam/header.cr
hts/bam/mpileup.cr
hts/bam/pileup.cr
hts/bam/record.cr

Constant Summary

AUX_TAG_PATTERN = /\A[A-Za-z][A-Za-z0-9]\z/

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from module HTS::RecordStream(HTS::Bam::Record)

all?(& : T -> ) : Bool all?, any?(& : T -> ) : Bool any?, count(& : T -> ) : Int32 count, each_copy_with_index(offset = 0, &) : self each_copy_with_index, each_with_index(offset = 0, &) : self each_with_index, find(if_none = nil, & : T -> ) find, find!(& : T -> ) : T find!, first(&)
first(count : Int) : Array(T)
first : T
first
, first? : T | Nil first?, index(& : T -> ) : Int32 | Nil index, index!(& : T -> ) : Int32 index!, map(& : T -> U) : Array(U) forall U map, map_with_index(offset = 0, & : T, Int32 -> U) : Array(U) forall U map_with_index, max_by(& : T -> U) : T forall U max_by, max_by?(& : T -> U) : T | Nil forall U max_by?, min_by(& : T -> U) : T forall U min_by, min_by?(& : T -> U) : T | Nil forall U min_by?, minmax_by(& : T -> U) : Tuple(T, T) forall U minmax_by, minmax_by?(& : T -> U) : Tuple(T, T) | Tuple(Nil, Nil) forall U minmax_by?, none?(& : T -> ) : Bool none?, one?(& : T -> ) : Bool one?, partition(& : T -> ) : Tuple(Array(T), Array(T)) partition, reject(& : T -> ) : Array(T) reject, select(& : T -> ) : Array(T) select, sum(initial : U, & : T -> V) forall U, V
sum(& : T -> U) : U forall U
sum
, to_a : Array(T) to_a

Instance methods inherited from class HTS::Hts

close close, closed? closed?, file_format file_format, file_format_version file_format_version, rewind rewind, seek(offset : Int) seek, set_threads(n) : self set_threads, tell tell, threads=(n) threads=, to_unsafe to_unsafe

Macros inherited from class HTS::Hts

define_getter(name) define_getter, define_iterator(name) define_iterator

Constructor Detail

def self.new(file_name : Path | String, mode = "r", index : String = "", fai = "", threads : Int32 = 0, build_index = false) #

[View source]

Class Method Detail

def self.aux_tag_to_static_array(tag : String) : StaticArray(UInt8, 2) #

[View source]
def self.build_index(file_name : Path | String, index_name = "", min_shift = 0, threads = 0, verbose = true) #

Class method: build index for any file on disk (even after close)


[View source]
def self.open(file_name : Path | String, mode = "r", index = "", fai = "", threads = 0, build_index = false) #

[View source]
def self.open(file_name : Path | String, mode = "r", index = "", fai = "", threads = 0, build_index = false, &) #

[View source]

Instance Method Detail

def <<(record) #

[View source]
def aux_char(tag : String) : Array(Char | Nil) #

[View source]
def aux_float(tag : String) : Array(Float64 | Nil) #

[View source]
def aux_int(tag : String) : Array(Int64 | Nil) #

[View source]
def aux_string(tag : String) : Array(String | Nil) #

[View source]
def build_index(index_name = "", min_shift = 0, verbose = true) #

[View source]
def chrom #

[View source]
def cigar #

[View source]
def close #

[View source]
def each(&) #

[View source]
def each_aux_char(tag : String, &) #

[View source]
def each_aux_float(tag : String, &) #

[View source]
def each_aux_int(tag : String, &) #

[View source]
def each_aux_string(tag : String, &) #

[View source]
def each_chrom(&) #

[View source]
def each_cigar(&) #

[View source]
def each_copy(&) #

[View source]
def each_flag(&) #

[View source]
def each_insert_size(&) #

[View source]
def each_mapq(&) #

[View source]
def each_mate_chrom(&) #

[View source]
def each_mate_pos(&) #

[View source]
def each_pos(&) #

[View source]
def each_qname(&) #

[View source]
def each_qual(&) #

[View source]
def each_seq(&) #

[View source]
def fai=(fai) #

[View source]
def file_name : String #

[View source]
def finalize #

[View source]
def flag #

[View source]
def header : Bam::Header #

[View source]
def header=(header) #

[View source]
def index_loaded? #

[View source]
def index_pointer : LibHTS::HtsIdxT #

Internal native pointer access for iterator implementations. The Bam handle retains ownership and invalidates this pointer on reload/close.


[View source]
def insert_size #

[View source]
def isize #

[View source]
def load_index(index_name = @index_name) : self #

[View source]
def mapq #

[View source]
def mate_chrom #

[View source]
def mate_pos #

[View source]
def mode : String #

[View source]
def mpos #

[View source]
def nthreads : Int32 #

[View source]
def pos #

[View source]
def qname #

[View source]
def qual #

[View source]
def query(tid : Int32, beg : Int64, end_pos : Int64, &) #

Numeric (tid) query: coordinates are 0-based half-open [beg, end)


[View source]
def query(chrom : String, beg : Int64, end_pos : Int64, &) #

Chromosome name + range using 0-based half-open coordinates [beg, end_pos).


[View source]
def query(region : String, &) #

[View source]
def query(regions : Array(String), &) #

Multi-region query. This currently uses sequential single-region iterators. Records overlapping multiple regions may be yielded more than once; regions are not merged or deduplicated.


[View source]
def query_copy(tid : Int32, beg : Int64, end_pos : Int64, &) #

[View source]
def query_copy(chrom : String, beg : Int64, end_pos : Int64, &) #

[View source]
def query_copy(region : String, &) #

[View source]
def query_copy(regions : Array(String), &) #

[View source]
def seq #

[View source]
def try_load_index(index_name = @index_name) : Bool #

[View source]
def write(record) #

[View source]
def write_header(header) #

[View source]