Class: Ensembl::Core::MiscFeature
- Inherits:
-
DBConnection
- Object
- ActiveRecord::Base
- DBRegistry::Base
- DBConnection
- Ensembl::Core::MiscFeature
- Includes:
- Sliceable
- Defined in:
- lib/bio-ensembl/core/activerecord.rb
Overview
The MiscFeature class provides an interface to the misc_feature table. The actual type of feature is stored in the MiscSet class.
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.
This class includes the mixin Sliceable, which means that it is mapped to a SeqRegion object and a Slice can be created for objects of this class. See Sliceable and Slice for more information.
Class Method Summary collapse
- .find_all_by_attrib_type_value(code, value) ⇒ Object
- .find_by_attrib_type_value(code, value) ⇒ Object
Methods included from Sliceable
#length, #project, #seq, #slice, #start, #stop, #strand, #transform
Methods inherited from DBConnection
connect, ensemblgenomes_connect
Methods inherited from DBRegistry::Base
generic_connect, get_info, get_name_from_db
Class Method Details
.find_all_by_attrib_type_value(code, value) ⇒ Object
946 947 948 949 950 951 952 953 954 955 |
# File 'lib/bio-ensembl/core/activerecord.rb', line 946 def self.find_all_by_attrib_type_value(code, value) code_id = AttribType.find_by_code(code) misc_attribs = MiscAttrib.find_all_by_attrib_type_id_and_value(code_id, value) answers = Array.new misc_attribs.each do |ma| answers.push(MiscFeature.find_all_by_misc_feature_id(ma.misc_feature_id)) end answers.flatten! return answers end |
.find_by_attrib_type_value(code, value) ⇒ Object
942 943 944 |
# File 'lib/bio-ensembl/core/activerecord.rb', line 942 def self.find_by_attrib_type_value(code, value) return self.find_all_by_attrib_type_value(code, value)[0] end |