| Class | Ensembl::Core::Gene |
| In: |
lib/ensembl/core/activerecord.rb
|
| Parent: | CoreDBConnection |
The Gene class provides an interface to the gene table. This table contains mappings of genes to a SeqRegion.
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.
puts Gene.find_by_biotype('protein_coding').length
| gene_attribs | -> | attribs |
The Gene#find_all_by_name class method searches the Xrefs for that name and returns an array of the corresponding Gene objects. If the name is not found, it returns an empty array.
The Gene#find_by_name class method searches the Xrefs for that name and returns one Gene objects (even if there should be more). If the name is not found, it returns nil.
The Gene#all_xrefs method is a convenience method in that it combines three methods into one. It collects all xrefs for the gene itself, plus all xrefs for all transcripts for the gene, and all xrefs for all translations for those transcripts.
The Gene#stable_id method returns the stable_id of the gene (i.e. the ENSG id).