class
HTS::Bam
Included Modules
- Enumerable(HTS::Bam::Record)
Defined in:
hts/bam.crhts/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
- .aux_tag_to_static_array(tag : String) : StaticArray(UInt8, 2)
-
.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)
- .open(file_name : Path | String, mode = "r", index = "", fai = "", threads = 0, build_index = false)
- .open(file_name : Path | String, mode = "r", index = "", fai = "", threads = 0, build_index = false, &)
Instance Method Summary
- #<<(record)
- #aux_char(tag : String) : Array(Char | Nil)
- #aux_float(tag : String) : Array(Float64 | Nil)
- #aux_int(tag : String) : Array(Int64 | Nil)
- #aux_string(tag : String) : Array(String | Nil)
- #build_index(index_name = "", min_shift = 0, verbose = true)
- #chrom
- #cigar
- #close
-
#each(&)
Must yield this collection's elements to the block.
- #each_aux_char(tag : String, &)
- #each_aux_float(tag : String, &)
- #each_aux_int(tag : String, &)
- #each_aux_string(tag : String, &)
- #each_chrom(&)
- #each_cigar(&)
- #each_copy(&)
- #each_flag(&)
- #each_insert_size(&)
- #each_mapq(&)
- #each_mate_chrom(&)
- #each_mate_pos(&)
- #each_pos(&)
- #each_qname(&)
- #each_qual(&)
- #each_seq(&)
- #fai=(fai)
- #file_name : String
- #finalize
- #flag
- #header : Bam::Header
- #header=(header)
- #index_loaded?
-
#index_pointer : LibHTS::HtsIdxT
Internal native pointer access for iterator implementations.
- #insert_size
- #isize
- #load_index(index_name = @index_name) : self
- #mapq
- #mate_chrom
- #mate_pos
- #mode : String
- #mpos
- #nthreads : Int32
- #pos
- #qname
- #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), &)
- #seq
-
#to_a : Array(Record)
Ensure collected records are independent and safe after iteration ends.
- #try_load_index(index_name = @index_name) : Bool
- #write(record)
- #write_header(header)
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)
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
Class method: build index for any file on disk (even after close)
Instance Method Detail
Must yield this collection's elements to the block.
Internal native pointer access for iterator implementations. The Bam handle retains ownership and invalidates this pointer on reload/close.
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.
Ensure collected records are independent and safe after iteration ends.