Class: Ensembl::Helpers::VariationPosition

Inherits:
Object
  • Object
show all
Defined in:
lib/ensembl/helpers/variation_position.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(row) ⇒ VariationPosition

Returns a new instance of VariationPosition.



14
15
16
# File 'lib/ensembl/helpers/variation_position.rb', line 14

def initialize(row)
  @chromosome,@start_pos,@end_pos,@strand=row
end

Instance Attribute Details

#chromosomeObject (readonly)

Returns the value of attribute chromosome.



12
13
14
# File 'lib/ensembl/helpers/variation_position.rb', line 12

def chromosome
  @chromosome
end

#end_posObject (readonly)

Returns the value of attribute end_pos.



12
13
14
# File 'lib/ensembl/helpers/variation_position.rb', line 12

def end_pos
  @end_pos
end

#start_posObject (readonly)

Returns the value of attribute start_pos.



12
13
14
# File 'lib/ensembl/helpers/variation_position.rb', line 12

def start_pos
  @start_pos
end

Instance Method Details

#strandObject



18
19
20
21
22
23
# File 'lib/ensembl/helpers/variation_position.rb', line 18

def strand
  if @strand==1
    return 'forward'
  end
  'reverse'
end

#to_sObject



25
26
27
# File 'lib/ensembl/helpers/variation_position.rb', line 25

def to_s
  'Chromosome: ' + @chromosome + ' ' + @start_pos.to_s + ':' + @end_pos.to_s
end