Class: HTS::VCF::Variant

Inherits:
Object
  • Object
show all
Defined in:
lib/hts/vcf/variant.rb

Instance Method Summary collapse

Constructor Details

#initialize(bcf_t, vcf) ⇒ Variant

Returns a new instance of Variant.



6
7
8
9
10
# File 'lib/hts/vcf/variant.rb', line 6

def initialize(bcf_t, vcf)
  @c = bcf_t
  FFI.bcf_unpack(@c, HTS::FFI::BCF_UN_ALL) # FIXME
  @vcf = vcf
end

Instance Method Details

#formatsObject

def inspect; end



14
# File 'lib/hts/vcf/variant.rb', line 14

def formats; end

#genotypesObject



16
# File 'lib/hts/vcf/variant.rb', line 16

def genotypes; end

#idObject



30
31
32
# File 'lib/hts/vcf/variant.rb', line 30

def id
  @c[:d][:id]
end

#posObject



18
19
20
# File 'lib/hts/vcf/variant.rb', line 18

def pos
  @c[:pos] + 1 # FIXME
end

#qualObject



34
35
36
# File 'lib/hts/vcf/variant.rb', line 34

def qual
  @c[:qual]
end

#refObject



38
39
40
# File 'lib/hts/vcf/variant.rb', line 38

def ref
  @c[:d][:allele].get_pointer(0).read_string
end

#startObject



22
23
24
# File 'lib/hts/vcf/variant.rb', line 22

def start
  @c[:pos]
end

#stopObject



26
27
28
# File 'lib/hts/vcf/variant.rb', line 26

def stop
  @c[:pos] + @c[:rlen]
end