class

Minimap2::MmIdx

Inherits Reference < Object


The minimap2 index — mirrors mm_idx_t

Constructors

from_strings(w : Int32, k : Int32, is_hpc : Bool, bucket_bits : Int32, seqs : Array(String), names : Array(String) | Nil = nil) : MmIdx

Build index from in-memory sequences (mirrors mm_idx_str).

Source
new(w : Int32, k : Int32, b : Int32, flag : Int32)
Source

Class methods

from_file(fp : BSeqFile, w : Int32, k : Int32, b : Int32, flag : Int32, mini_batch_size : Int32, n_threads : Int32, batch_size : UInt64) : MmIdx | Nil

Build index from a BSeqFile pipeline (mirrors mm_idx_gen).

Source
idx?(fn : String) : Int64

Check if a file is a prebuilt index; returns file size if yes, 0 if no.

Source
load(io : IO) : MmIdx | Nil

Load index from IO (mirrors mm_idx_load).

Source

Instance methods

add(a : Array(Mm128)) : Nil

Add minimizers to buckets (mirrors mm_idx_add).

Source
b=(b : Int32)
Source
cal_max_occ(f : Float32) : Int32

Maximum occurrence threshold at fraction f (mirrors mm_idx_cal_max_occ).

Source
dump(io : IO) : Nil

Serialise index to an IO (mirrors mm_idx_dump).

Source
ensure_seq_capacity(total_len : UInt64) : Nil

Ensure s_arr has room for total_len bases (allocating in chunks of 8).

Source
flag
Source
flag=(flag : Int32)
Source
get(minier : UInt64) : Array(UInt64) | Nil

Lookup positions for a minimizer (mirrors mm_idx_get). Returns the array of hit positions, or nil if not found.

Source
getseq(rid : UInt32, st : UInt32, en : UInt32, buf : Array(UInt8)) : Int32

Retrieve decoded sequence (mirrors mm_idx_getseq). Returns encoded bases (0-3), or -1 on range error.

Source
getseq2(is_rev : Bool, rid : UInt32, st : UInt32, en : UInt32, buf : Array(UInt8)) : Int32
Source
getseq_rev(rid : UInt32, st : UInt32, en : UInt32, buf : Array(UInt8)) : Int32
Source
index
Source
index=(index : Int32)
Source
index_name

Build name → id map (mirrors mm_idx_index_name). Returns true if duplicate names detected.

Source
k=(k : Int32)
Source
n_alt
Source
n_alt=(n_alt : Int32)
Source
n_seq
Source
n_seq=(n_seq : UInt32)
Source
name2id(name : String) : Int32
Source
name_map
Source
name_map=(name_map : Hash(String, UInt32))
Source
post(n_threads : Int32 = 1) : Nil

Process all buckets after collection (mirrors mm_idx_post). Each bucket is independent, so we fan them out across a Parallel context.

Source
s_arr
Source
s_arr=(s_arr : Array(UInt32))
Source
seq4_get(offset : UInt64) : UInt8
Source
seq4_set(offset : UInt64, c : Int32) : Nil

Sequence packing helpers (mm_seq4_set / mm_seq4_get) 8 bases per UInt32, 4 bits each.

Source
seq=(seq : Array(IdxSeq))
Source
stat

Source
w=(w : Int32)
Source