class Bio::Mutation

Attributes

mutant[RW]
position[RW]
reference[RW]
seqname[RW]
type[RW]

Public Class Methods

new(params={position: 1,type: :uninitialized, reference: nil, mutant: nil, seqname: nil}) click to toggle source
# File lib/bio-sam-mutation/bio/mutation.rb, line 4
def initialize params={position: 1,type: :uninitialized, reference: nil, mutant: nil, seqname: nil}
  @position = params[:position]
  @type = params[:type]
  @reference = params[:reference]
  @mutant = params[:mutant]
  @seqname = params[:seqname]
end

Public Instance Methods

<=>(other) click to toggle source
# File lib/bio-sam-mutation/bio/mutation.rb, line 12
def <=> other
  return 0 if self.position == other.position
  self.position > other.position ? 1 : -1
end
to_json() click to toggle source
# File lib/bio-sam-mutation/bio/mutation.rb, line 56
def to_json
  Oj.dump self
end
to_yaml() click to toggle source
# File lib/bio-sam-mutation/bio/mutation.rb, line 60
def to_yaml
  YAML.dump self
end