class HTS::Bcf

Included Modules

Defined in:

hts/bcf.cr
hts/bcf/errors.cr
hts/bcf/format.cr
hts/bcf/header.cr
hts/bcf/info.cr
hts/bcf/record.cr
hts/bcf/scratch.cr

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from module HTS::RecordStream(HTS::Bcf::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 = "", threads : Int32 = 0, build_index = false, *, subset : Enumerable(String) | Nil = nil, unpack : Symbol = :all) #

[View source]

Class Method Detail

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

Build index for an on-disk file (callable even after close)


[View source]
def self.open(file_name : Path | String, mode = "r", index = "", threads = 0, build_index = false, *, subset : Enumerable(String) | Nil = nil, unpack : Symbol = :all) #

[View source]
def self.open(file_name : Path | String, mode = "r", index = "", threads = 0, build_index = false, *, subset : Enumerable(String) | Nil = nil, unpack : Symbol = :all, &) #

[View source]

Instance Method Detail

def <<(var) #

[View source]
def alt #

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

Instance helper delegating to the class method.


[View source]
def chrom #

[View source]
def close #

[View source]
def each(&) #

[View source]
def each_alt(&) #

[View source]
def each_chrom(&) #

Do not add file-level INFO/FORMAT helpers here because these fields depend on each record and its samples. Use Bcf::Record instead.


[View source]
def each_copy(&) #

[View source]
def each_endpos(&) #

[View source]
def each_filter(&) #

[View source]
def each_id(&) #

[View source]
def each_pos(&) #

[View source]
def each_qual(&) #

[View source]
def each_ref(&) #

[View source]
def endpos #

[View source]
def file_name : String #

[View source]
def filter #

[View source]
def finalize #

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

[View source]
def header=(header) #

[View source]
def id #

[View source]
def index_loaded? #

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

[View source]
def mode : String #

[View source]
def nsamples #

[View source]
def nthreads : Int32 #

[View source]
def pos #

[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 ref #

[View source]
def samples #

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

[View source]
def write(var) #

[View source]
def write_header(header) #

[View source]