Class: MutantAllele
- Inherits:
-
Object
- Object
- MutantAllele
- Defined in:
- lib/bio-sam-mutation/bio/mutantallele.rb
Overview
Used for tracking mutations appearing more than once and cacheing VEP lookups
Class Attribute Summary collapse
-
.previous_lookups ⇒ Object
Returns the value of attribute previous_lookups.
Instance Attribute Summary collapse
-
#count ⇒ Object
Returns the value of attribute count.
-
#example ⇒ Object
Returns the value of attribute example.
-
#mutations ⇒ Object
Returns the value of attribute mutations.
-
#seq ⇒ Object
Returns the value of attribute seq.
Instance Method Summary collapse
-
#initialize(mutations: nil, count: 0, example: nil, seq: nil) ⇒ MutantAllele
constructor
A new instance of MutantAllele.
-
#lookup(species = "human", ref_type = nil) ⇒ Object
Returns JSON from Ensembl VEP.
Constructor Details
#initialize(mutations: nil, count: 0, example: nil, seq: nil) ⇒ MutantAllele
Returns a new instance of MutantAllele.
9 10 11 12 13 |
# File 'lib/bio-sam-mutation/bio/mutantallele.rb', line 9 def initialize (mutations: nil, count: 0, example: nil, seq: nil) @mutations = mutations @count = count @example = example end |
Class Attribute Details
.previous_lookups ⇒ Object
Returns the value of attribute previous_lookups.
5 6 7 |
# File 'lib/bio-sam-mutation/bio/mutantallele.rb', line 5 def previous_lookups @previous_lookups end |
Instance Attribute Details
#count ⇒ Object
Returns the value of attribute count.
3 4 5 |
# File 'lib/bio-sam-mutation/bio/mutantallele.rb', line 3 def count @count end |
#example ⇒ Object
Returns the value of attribute example.
3 4 5 |
# File 'lib/bio-sam-mutation/bio/mutantallele.rb', line 3 def example @example end |
#mutations ⇒ Object
Returns the value of attribute mutations.
3 4 5 |
# File 'lib/bio-sam-mutation/bio/mutantallele.rb', line 3 def mutations @mutations end |
#seq ⇒ Object
Returns the value of attribute seq.
3 4 5 |
# File 'lib/bio-sam-mutation/bio/mutantallele.rb', line 3 def seq @seq end |
Instance Method Details
#lookup(species = "human", ref_type = nil) ⇒ Object
Returns JSON from Ensembl VEP
16 17 18 19 20 21 22 23 |
# File 'lib/bio-sam-mutation/bio/mutantallele.rb', line 16 def lookup species="human", ref_type=nil key = mutations.to_hgvs(ref_type) if key && (MutantAllele.previous_lookups.keys.include? key) MutantAllele.previous_lookups[key] else mutations.vep(species,ref_type) end end |