class
HTS::Bam::Aux
- HTS::Bam::Aux
- Reference
- Object
Overview
Provides iteration over auxiliary tags in BAM records
This class enables efficient access to all auxiliary tags using HTSlib's bam_aux_first and bam_aux_next functions.
Usage examples:
Iterate over all tags
record.aux.each do |tag, value| puts "#{tag}: #{value}" end
Access specific tags with stable return types
as_score = record.aux.get_int("AS")
Defined in:
hts/bam/auxi.crConstant Summary
-
AUX_ARRAY_TYPE =
'B'.ord.to_u8 -
AUX_CHAR_TYPE =
'A'.ord.to_u8 -
AUX_FLOAT_TYPES =
{'f'.ord.to_u8, 'd'.ord.to_u8} -
AUX_INT_TYPES =
{'c'.ord.to_u8, 'C'.ord.to_u8, 's'.ord.to_u8, 'S'.ord.to_u8, 'i'.ord.to_u8, 'I'.ord.to_u8} -
AUX_STRING_TYPES =
{'Z'.ord.to_u8, 'H'.ord.to_u8}
Constructors
Instance Method Summary
-
#each(&)
Iterate over all auxiliary tags
-
#each_array(tag : String, & : Char, ArrayView -> ) : Bool
The view and any slice derived from it are valid only during the block.
EXPERIMENTAL
-
#each_with_type(&)
Iterate over all auxiliary tags with original BAM type information.
-
#get_char(tag : String) : Char | Nil
Returns the character value for tag,
nilwhen absent, and raisesAuxTypeErrorwhen the tag exists with a non-character type. -
#get_float(tag : String) : Float64 | Nil
Returns the float value for tag,
nilwhen absent, and raisesAuxTypeErrorwhen the tag exists with a non-float type. -
#get_float_array(tag : String) : Array(Float64) | Nil
Returns the float array for tag,
nilwhen absent, and raisesAuxTypeErrorwhen the tag exists with a non-float-array type. -
#get_int(tag : String) : Int64 | Nil
Returns the integer value for tag,
nilwhen absent, and raisesAuxTypeErrorwhen the tag exists with a non-integer type. -
#get_int_array(tag : String) : Array(Int64) | Nil
Returns the integer array for tag,
nilwhen absent, and raisesAuxTypeErrorwhen the tag exists with a non-integer-array type. -
#get_string(tag : String) : String | Nil
Returns the string value for tag,
nilwhen absent, and raisesAuxTypeErrorwhen the tag exists with a non-string type. -
#to_s(io : IO) : Nil
HTSlib sam_format_aux1 compliant output with original type information
- #update_array(tag : String, values : Array(Number), subtype : Char = 'i')
- #update_char(tag : String, value : Char)
- #update_double(tag : String, value : Number)
- #update_float(tag : String, value : Number)
- #update_hex(tag : String, value : String)
- #update_int(tag : String, value : Int)
- #update_int16(tag : String, value : Int)
- #update_int32(tag : String, value : Int)
- #update_int8(tag : String, value : Int)
- #update_string(tag : String, value : String)
- #update_uint16(tag : String, value : Int)
- #update_uint32(tag : String, value : Int)
- #update_uint8(tag : String, value : Int)
Constructor Detail
Instance Method Detail
The view and any slice derived from it are valid only during the block.
EXPERIMENTAL
Returns the character value for tag, nil when absent, and raises
AuxTypeError when the tag exists with a non-character type.
Returns the float value for tag, nil when absent, and raises
AuxTypeError when the tag exists with a non-float type.
Returns the float array for tag, nil when absent, and raises
AuxTypeError when the tag exists with a non-float-array type.
Returns the integer value for tag, nil when absent, and raises
AuxTypeError when the tag exists with a non-integer type.
Returns the integer array for tag, nil when absent, and raises
AuxTypeError when the tag exists with a non-integer-array type.
Returns the string value for tag, nil when absent, and raises
AuxTypeError when the tag exists with a non-string type.