class
HTS::Bam::Record
- HTS::Bam::Record
- Reference
- Object
Defined in:
hts/bam/record.crConstant Summary
-
SEQ_NT16_STR =
"=ACMGRSVTWYHKDBN"
Constructors
-
.new(header : Bam::Header, qname : String, flag : UInt16 | Int32, tid : Int32, pos : Int64, mapq : UInt8 | Int32, cigar_words : Array(UInt32), seq : String, qual : Array(UInt8), mtid : Int32 = -1, mpos : Int64 = 0_i64, isize : Int64 = 0_i64)
Convenience constructor: build a record with core fields using bam_set1 - Coordinates are 0-based (as in BAM core) - CIGAR may be given as encoded words (Array(UInt32)) or SAM string - Qualities are Phred-scaled values (0..93), one per base
-
.new(header : Bam::Header, qname : String, flag : UInt16 | Int32, rname : String, pos : Int64, mapq : UInt8 | Int32, cigar_str : String, seq : String, qual : Array(UInt8), mtid : Int32 = -1, mpos : Int64 = 0_i64, isize : Int64 = 0_i64)
Overload: rname + CIGAR as String
- .new(header : Bam::Header, bam1_t : Pointer(HTS::LibHTS::Bam1T))
- .new(header : Bam::Header)
Instance Method Summary
-
#aux(str)
Access individual auxiliary tag by name (existing method)
-
#aux
Return Aux object for iteration over all auxiliary tags
- #aux_char(str)
- #aux_float(str)
-
#aux_int(str)
Return Int64
- #aux_string(str)
-
#base(n)
return only the base of the requested index "i" of the query sequence.
-
#base_mod : Bam::BaseMod
Base modification accessor NOTE: Currently always returns a new BaseMod instance to avoid a finalizer cycle between Record and BaseMod.
-
#base_qual(n)
return only the base quality of the requested index "i" of the query sequence.
- #bin
- #bin=(bin)
-
#chrom
returns the chromosome or '' if not mapped.
-
#cigar
returns a
Cigarobject. - #clone
-
#contig
returns the mate chromosome or '' if not mapped.
- #duplicate?
-
#endpos
returns end position of the read.
-
#finalize
garbagew collection
-
#flag
returns a
Flagobject. - #flag=(flag : Flag)
- #flag=(flag)
- #header : HTS::Bam::Header
-
#insert_size
insert size
- #insert_size=(isize)
- #isize
- #isize=(isize)
- #len
-
#mapq
mapping quality
- #mapq=(mapq)
-
#mate_chrom
returns the chromosome of the mate or '' if not mapped.
- #mate_contig
-
#mate_pos
returns 0-based mate position
- #mate_pos=(mpos)
- #mate_reverse?
- #mate_strand
- #mate_unmapped?
- #mpos
- #mpos=(mpos)
-
#mtid
returns the tid of the mate or -1 if not mapped.
- #mtid=(mtid)
- #paired?
-
#pos
returns 0-based start position.
- #pos=(pos)
- #proper_pair?
- #qcfail?
- #qlen
-
#qname
returns the query name.
- #qname=(name)
-
#qual
return the base qualities
- #qual_string
- #read1?
- #read2?
- #reverse?
- #rlen
- #secondary?
-
#seq
return the read sequence
- #sequence
- #strand
- #supplementary?
-
#tid
returns the tid of the record or -1 if not mapped.
- #tid=(tid)
-
#to_s(io : IO)
Appends a short String representation of this object which includes its class name and its object address.
- #to_unsafe : Pointer(HTS::LibHTS::Bam1T)
- #unmapped?
Constructor Detail
Convenience constructor: build a record with core fields using bam_set1
- Coordinates are 0-based (as in BAM core)
- CIGAR may be given as encoded words (Array(UInt32)) or SAM string
- Qualities are Phred-scaled values (0..93), one per base
Overload: rname + CIGAR as String
Instance Method Detail
Base modification accessor
NOTE Currently always returns a new BaseMod instance to avoid a finalizer cycle between Record and BaseMod. In the future, memoization could be considered for performance optimization once the GC cycle issue is resolved.
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>