Class: Exodb::Variant
- Inherits:
-
Object
- Object
- Exodb::Variant
- Includes:
- VarLocationField, Mongoid::Document, Mongoid::Timestamps, Mongoid::Versioning
- Defined in:
- lib/exodb/datamodel/variant.rb
Instance Method Summary collapse
-
#add_to_sample(str) ⇒ Object
(also: #add_to_cell)
add this variant to original cell sample.
- #alternate ⇒ Object
-
#apply_filter(filter) ⇒ Object
apply filter to the variant the result is kelp in passfilter.
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
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 |
#alternate ⇒ Object
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
74 75 76 |
# File 'lib/exodb/datamodel/variant.rb', line 74 def apply_filter(filter) self[:filter] = filter end |