class HTS::Bam::BaseMod

Overview

Base modification information from MM/ML tags View over a Record's MM/ML tags using htslib base-mod API

Included Modules

Defined in:

hts/bam/base_mod.cr

Constant Summary

HTS_MOD_REPORT_UNCHECKED = 1_u32

Default flags for parsing base modifications via htslib HTS_MOD_REPORT_UNCHECKED = 1 (report unvalidated mods instead of failing)

Constructors

Instance Method Summary

Constructor Detail

def self.new(record : HTS::Bam::Record, auto_parse : Bool = true) #

[View source]

Instance Method Detail

def [](position : Int32) : Position | Nil #

Array-style access to modifications at a query position


[View source]
def at_pos(position : Int32, max_mods : Int32 = 10) : Position | Nil #

Get modifications at a specific query position (0-based); returns nil if none


[View source]
def close #

[View source]
def each(max_mods : Int32 = 10, &block : Position -> ) #

Iterate over all positions with modifications


[View source]
def each_position(max_mods : Int32 = 10, &block : Position -> ) #

Alias for clarity and parity with common terminology


[View source]
def ensure_parsed!(flags : UInt32 = HTS_MOD_REPORT_UNCHECKED) #

[View source]
def finalize #

[View source]
def modification_types : Array(Int32) #

List of modification codes (positive char codes or negative ChEBI)


[View source]
def parse(flags : UInt32 = HTS_MOD_REPORT_UNCHECKED) : Int32 #

Parse MM/ML tags; flags per HTSlib (e.g., HTS_MOD_REPORT_UNCHECKED = 1) Default to reporting unchecked modifications so we see MM/ML content without strict validation.


[View source]
def parsed? : Bool #

[View source]
def query_type(code : Int32 | String) #

Query info about a specific modification code


[View source]
def query_type_at(index : Int32) #

Query info about i-th modification type


[View source]
def record : HTS::Bam::Record #

[View source]
def recorded_types : Array(Int32) #

[View source]
def to_a : Array(Position) #
Description copied from module Enumerable(HTS::Bam::BaseMod::Position)

Returns an Array with all the elements in the collection.

(1..5).to_a # => [1, 2, 3, 4, 5]

[View source]
def to_s(io : IO) : Nil #
Description copied from class Reference

Appends a short String representation of this object which includes its class name and its object address.

class Person
  def initialize(@name : String, @age : Int32)
  end
end

Person.new("John", 32).to_s # => #<Person:0x10a199f20>

[View source]