class
HTS::Bcf
Included Modules
Defined in:
hts/bcf.crhts/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
-
.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)
- .open(file_name : Path | String, mode = "r", index = "", threads = 0, build_index = false, *, subset : Enumerable(String) | Nil = nil, unpack : Symbol = :all)
- .open(file_name : Path | String, mode = "r", index = "", threads = 0, build_index = false, *, subset : Enumerable(String) | Nil = nil, unpack : Symbol = :all, &)
Instance Method Summary
- #<<(var)
- #alt
-
#build_index(index_name = "", min_shift = 14, verbose = true)
Instance helper delegating to the class method.
- #chrom
- #close
- #each(&)
- #each_alt(&)
-
#each_chrom(&)
Do not add file-level INFO/FORMAT helpers here because these fields depend on each record and its samples.
- #each_copy(&)
- #each_endpos(&)
- #each_filter(&)
- #each_id(&)
- #each_pos(&)
- #each_qual(&)
- #each_ref(&)
- #endpos
- #file_name : String
- #filter
- #finalize
- #header : Bcf::Header
- #header=(header)
- #id
- #index_loaded?
- #load_index(index_name = @index_name) : self
- #mode : String
- #nsamples
- #nthreads : Int32
- #pos
- #qual
-
#query(tid : Int32, beg : Int64, end_pos : Int64, &)
Numeric (tid) query: coordinates are 0-based half-open [beg, end)
-
#query(chrom : String, beg : Int64, end_pos : Int64, &)
Chromosome name + range using 0-based half-open coordinates [beg, end_pos).
- #query(region : String, &)
-
#query(regions : Array(String), &)
Multi-region query.
- #query_copy(tid : Int32, beg : Int64, end_pos : Int64, &)
- #query_copy(chrom : String, beg : Int64, end_pos : Int64, &)
- #query_copy(region : String, &)
- #query_copy(regions : Array(String), &)
- #ref
- #samples
- #try_load_index(index_name = @index_name) : Bool
- #write(var)
- #write_header(header)
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
Class Method Detail
Build index for an on-disk file (callable even after close)
Instance Method Detail
Instance helper delegating to the class method.
Do not add file-level INFO/FORMAT helpers here because these fields depend on each record and its samples. Use Bcf::Record instead.
Numeric (tid) query: coordinates are 0-based half-open [beg, end)
Chromosome name + range using 0-based half-open coordinates [beg, end_pos).
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.