class
HTS::Tabix
- HTS::Tabix
- HTS::Bgzf
- HTS::Hts
- Reference
- Object
Defined in:
hts/tabix.crhts/tabix/errors.cr
Constructors
Class Method Summary
-
.build_index(file_name : Path | String, index_name = "", min_shift = 0, threads = 0, verbose = true, preset = :vcf)
Build a tabix index for file_name on disk.
- .open(file_name : Path | String, mode = "r", index = "", threads = 0, build_index = false, preset = :vcf)
- .open(file_name : Path | String, mode = "r", index = "", threads = 0, build_index = false, preset = :vcf, &)
Instance Method Summary
-
#build_index(index_name = "", min_shift = 0, verbose = true, preset = :vcf)
Build a tabix index for this file.
- #close
- #each_fields(region : String, & : Array(String) -> ) : self
- #each_line(region : String, & : String -> ) : self
-
#each_line_view(region : String, & : Bytes -> ) : self
The borrowed line is valid only during the block.
EXPERIMENTAL
-
#each_selected_fields(region : String, *field_indices, & : Array(Bytes) -> ) : self
The values and their backing array are reused after each block call.
EXPERIMENTAL
- #file_name : Path | String
- #finalize
- #index_loaded?
- #load_index(index_name = @index_name)
- #mode : String
-
#name2id(name : String) : Int32
Return the sequence (chromosome) ID for name, or -1 if not found.
-
#query(chrom : String, start : Int, end_ : Int, &)
Query by chromosome name and 0-based half-open coordinates [start, end_).
-
#query(region : String, &)
Query by region string using htslib's native parser.
-
#seqnames : Array(String)
Return the list of sequence names stored in the index.
Instance methods inherited from class HTS::Bgzf
<<(data) : self
<<,
bgzf? : Bool
bgzf?,
compression_level : Int32
compression_level,
each_char(&)
each_char,
each_line(delimiter = '\n', &)
each_line,
each_line_view(delimiter = '\n', & : Bytes -> ) : self
each_line_view,
file_name : Path | String
file_name,
finalize
finalize,
flush : Int32
flush,
getc : Char | Nil
getc,
gets(delimiter = '\n') : String | Nil
gets,
is_bgzf? : Bool
is_bgzf?,
mode : String
mode,
print(data : String) : Nilprint(data : Bytes) : Nil
print(data) : Nil
print(*objects) : Nil print, puts(data : String) : Int64
puts : Int64
puts(*objects) : Nil puts, read(size : Int32) : Bytes read, seek(offset) seek, tell tell, write(data : String) : Int64
write(data : Bytes) : Int64 write
Constructor methods inherited from class HTS::Bgzf
new(file_name : Path | String, mode = "r", threads = 0)
new
Class methods inherited from class HTS::Bgzf
open(file_name : Path | String, mode = "r", threads = 0)open(file_name : Path | String, mode = "r", threads = 0, &) open
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)
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 a tabix index for file_name on disk. Uses the VCF preset by default.
Supported presets are :vcf, :bed, :gff, :sam, and :psltbl.
Instance Method Detail
Build a tabix index for this file. Delegates to the class method.
The borrowed line is valid only during the block.
EXPERIMENTAL
The values and their backing array are reused after each block call.
EXPERIMENTAL
Return the sequence (chromosome) ID for name, or -1 if not found.
Query by chromosome name and 0-based half-open coordinates [start, end_). Yields each matching record as an Array(String) of tab-split fields.
Query by region string using htslib's native parser. Yields each matching record as an Array(String) of tab-split fields.