Class: Ensembl::Variation::Variation

Inherits:
DBConnection show all
Defined in:
lib/ensembl/variation/variation.rb

Overview

The Variation class represents single nucleotide polymorhisms (SNP) or variations and provides information like the names (IDs), the validation status and the allele information.

BUG: fields like validation_status and consequence_type are created using SET option directly in MySQL. These fields are bad interpreted by ActiveRecord, returning always 0.

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.

Examples:

v = Variation.find_by_name('rs10111')
v.alleles.each do |a|
  puts a.allele, a.frequency
end

variations = Variation.fetch_all_by_source('dbSNP') # many records
variations.each do |v|
  puts v.name
end

Class Method Summary collapse

Methods inherited from DBConnection

connect, ensemblgenomes_connect

Methods inherited from DBRegistry::Base

generic_connect, get_info, get_name_from_db

Class Method Details

.fetch_all_by_source(source) ⇒ Object



53
54
55
# File 'lib/ensembl/variation/variation.rb', line 53

def self.fetch_all_by_source(source)
  variations = Source.find_by_name(source).variations
end