Class: Exodb::Variant

Inherits:
Object
  • Object
show all
Includes:
VarLocationField, Mongoid::Document, Mongoid::Timestamps, Mongoid::Versioning
Defined in:
lib/exodb/datamodel/variant.rb

Instance Method Summary collapse

Methods included from VarLocationField

#chromosome, #convlocation=, #location=, #location_str, #parse_locstr

Instance Method Details

#add_to_sample(str) ⇒ Object Also known as: add_to_cell

add this variant to original cell sample

Parameters:



54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/exodb/datamodel/variant.rb', line 54

def add_to_sample(str)
  
  sample = Cell.where({'oid' => str})
  
  if sample.exists?
    self.cell = sample.first()
    #output.puts "#EXODB:INFO This sample is added to #{dataset.first().name}." if $0 == 'pry'
  else
    #output.puts "#EXODB:ERRO Cannot find dataset by #{str}." if $0 == 'pry'
  end
  
end

#alternateObject



78
79
80
# File 'lib/exodb/datamodel/variant.rb', line 78

def alternate
  return self[:genotypet] - [self[:reference]]
end

#apply_filter(filter) ⇒ Object

apply filter to the variant the result is kelp in passfilter

Parameters:

  • pile-up (String)

    line from mpileup



74
75
76
# File 'lib/exodb/datamodel/variant.rb', line 74

def apply_filter(filter)
  self[:filter] = filter
end