class HTS::Bam::Flag

Attributes

value[RW]

Public Class Methods

new(flag_value) click to toggle source
# File lib/hts/bam/flag.rb, line 9
def initialize(flag_value)
  @value = flag_value # tytpe check?
end

Public Instance Methods

dup?() click to toggle source
# File lib/hts/bam/flag.rb, line 78
def dup?
  has_flag? LibHTS::BAM_FDUP
end
has_flag?(o) click to toggle source
# File lib/hts/bam/flag.rb, line 86
def has_flag?(o)
  (@value & o) != 0
end
mate_reverse?() click to toggle source
# File lib/hts/bam/flag.rb, line 58
def mate_reverse?
  has_flag? LibHTS::BAM_FMREVERSE
end
mate_unmapped?() click to toggle source
# File lib/hts/bam/flag.rb, line 50
def mate_unmapped?
  has_flag? LibHTS::BAM_FMUNMAP
end
paired?() click to toggle source

TODO: Enabling bitwise operations hts-nim proc `and`*(f: Flag, o: uint16): uint16 {. borrow, inline .} proc `and`*(f: Flag, o: Flag): uint16 {. borrow, inline .} proc `or`*(f: Flag, o: uint16): uint16 {. borrow .} proc `or`*(o: uint16, f: Flag): uint16 {. borrow .} proc `==`*(f: Flag, o: Flag): bool {. borrow, inline .} proc `==`*(f: Flag, o: uint16): bool {. borrow, inline .} proc `==`*(o: uint16, f: Flag): bool {. borrow, inline .}

# File lib/hts/bam/flag.rb, line 38
def paired?
  has_flag? LibHTS::BAM_FPAIRED
end
proper_pair?() click to toggle source
# File lib/hts/bam/flag.rb, line 42
def proper_pair?
  has_flag? LibHTS::BAM_FPROPER_PAIR
end
qcfail?() click to toggle source
# File lib/hts/bam/flag.rb, line 74
def qcfail?
  has_flag? LibHTS::BAM_FQCFAIL
end
read1?() click to toggle source
# File lib/hts/bam/flag.rb, line 62
def read1?
  has_flag? LibHTS::BAM_FREAD1
end
read2?() click to toggle source
# File lib/hts/bam/flag.rb, line 66
def read2?
  has_flag? LibHTS::BAM_FREAD2
end
reverse?() click to toggle source
# File lib/hts/bam/flag.rb, line 54
def reverse?
  has_flag? LibHTS::BAM_FREVERSE
end
secondary?() click to toggle source
# File lib/hts/bam/flag.rb, line 70
def secondary?
  has_flag? LibHTS::BAM_FSECONDARY
end
supplementary?() click to toggle source
# File lib/hts/bam/flag.rb, line 82
def supplementary?
  has_flag? LibHTS::BAM_FSUPPLEMENTARY
end
unmapped?() click to toggle source
# File lib/hts/bam/flag.rb, line 46
def unmapped?
  has_flag? LibHTS::BAM_FUNMAP
end