Class: Ensembl::Variation::VariationFeature
- Inherits:
-
DBConnection
- Object
- ActiveRecord::Base
- DBRegistry::Base
- DBConnection
- Ensembl::Variation::VariationFeature
- Defined in:
- lib/bio-ensembl/variation/variation_feature.rb,
lib/bio-ensembl/variation/variation_feature62.rb
Overview
The VariationFeature class gives information about the genomic position of each Variation, including also validation status and consequence type.
This class uses ActiveRecord to access data in the Ensembl database. See the general documentation of the Ensembl module for more information on what this means and what methods are available.
Instance Method Summary collapse
-
#consequence_type ⇒ Object
workaround as ActiveRecord do not parse SET field in MySQL.
-
#consequence_types ⇒ Object
workaround as ActiveRecord do not parse SET field in MySQL.
-
#fetch_region(up = 5000, down = 5000) ⇒ Slice
Based on Perl API ‘get_all_Genes’ method for Variation class.
- #flanking_seq ⇒ Object
- #transcript_variations ⇒ Object
Methods inherited from DBConnection
connect, ensemblgenomes_connect
Methods inherited from DBRegistry::Base
generic_connect, get_info, get_name_from_db
Instance Method Details
#consequence_type ⇒ Object
workaround as ActiveRecord do not parse SET field in MySQL
61 62 63 |
# File 'lib/bio-ensembl/variation/variation_feature.rb', line 61 def consequence_type # workaround as ActiveRecord do not parse SET field in MySQL "#{attributes_before_type_cast['consequence_type']}" end |
#consequence_types ⇒ Object
workaround as ActiveRecord do not parse SET field in MySQL
74 75 76 |
# File 'lib/bio-ensembl/variation/variation_feature62.rb', line 74 def consequence_types # workaround as ActiveRecord do not parse SET field in MySQL "#{attributes_before_type_cast['consequence_types']}" end |
#fetch_region(up = 5000, down = 5000) ⇒ Slice
Based on Perl API ‘get_all_Genes’ method for Variation class. Get a genomic region starting from the Variation coordinates, expanding the region upstream and downstream.
72 73 74 75 76 |
# File 'lib/bio-ensembl/variation/variation_feature.rb', line 72 def fetch_region(up = 5000, down = 5000) sr = core_connection(self.seq_region_id) slice = Ensembl::Core::Slice.fetch_by_region(Ensembl::Core::CoordSystem.find(sr.coord_system_id).name,sr.name,self.seq_region_start-up,self.seq_region_end+down) return slice end |
#flanking_seq ⇒ Object
78 79 80 81 82 83 84 |
# File 'lib/bio-ensembl/variation/variation_feature.rb', line 78 def flanking_seq sr = core_connection(self.seq_region_id) f = Variation.find(self.variation_id).flanking_sequence slice_up = Ensembl::Core::Slice.fetch_by_region(Ensembl::Core::CoordSystem.find(sr.coord_system_id).name,sr.name,f.up_seq_region_start,f.up_seq_region_end,self.seq_region_strand) slice_down = Ensembl::Core::Slice.fetch_by_region(Ensembl::Core::CoordSystem.find(sr.coord_system_id).name,sr.name,f.down_seq_region_start,f.down_seq_region_end,self.seq_region_strand) return slice_up,slice_down end |
#transcript_variations ⇒ Object
86 87 88 89 90 91 92 93 94 |
# File 'lib/bio-ensembl/variation/variation_feature.rb', line 86 def transcript_variations tvs = TranscriptVariation.find_all_by_variation_feature_id(self.variation_feature_id) if tvs[0].nil? then # the variation is not stored in the database, so run the calculations sr = core_connection(self.seq_region_id) return custom_transcript_variation(self,sr) else return tvs # the variation is already present in the database end end |