Class: GENOME::SNP

Inherits:
Object
  • Object
show all
Defined in:
lib/genome/snp.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(chromosome, position, genotype) ⇒ SNP

Returns a new instance of SNP.



4
5
6
7
8
# File 'lib/genome/snp.rb', line 4

def initialize(chromosome, position, genotype)
  @chromosome = chromosome
  @position = position
  @genotype = genotype
end

Instance Attribute Details

#chromosomeObject

Returns the value of attribute chromosome.



3
4
5
# File 'lib/genome/snp.rb', line 3

def chromosome
  @chromosome
end

#genotypeObject

Returns the value of attribute genotype.



3
4
5
# File 'lib/genome/snp.rb', line 3

def genotype
  @genotype
end

#positionObject

Returns the value of attribute position.



3
4
5
# File 'lib/genome/snp.rb', line 3

def position
  @position
end

Instance Method Details

#==(other) ⇒ Object



14
15
16
17
18
# File 'lib/genome/snp.rb', line 14

def ==(other)
  chromosome == other.chromosome &&
    @position == other.position &&
    @genotype == other.genotype
end

#to_sObject



10
11
12
# File 'lib/genome/snp.rb', line 10

def to_s
  "<SNP: chromosome=#{chromosome} position=#{position} genotype=#{genotype}>"
end