Class: Ensembl::Variation::TranscriptVariation

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

Overview

The TranscriptVariation class gives information about the position of a VariationFeature, mapped on an annotated transcript.

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:

vf = Variation.find_by_name('rs10111').variation_feature
vf.transcript_variations.each do |tv|
  puts tv.peptide_allele_string, tv.transcript.stable_id    
end

Instance Method Summary collapse

Methods inherited from DBConnection

connect, ensemblgenomes_connect

Methods inherited from DBRegistry::Base

generic_connect, get_info, get_name_from_db

Instance Method Details

#consequence_typeObject

workaround as ActiveRecord do not parse SET field in MySQL



379
380
381
# File 'lib/ensembl/variation/variation.rb', line 379

def consequence_type # workaround as ActiveRecord do not parse SET field in MySQL
  "#{attributes_before_type_cast['consequence_type']}" 
end

#transcriptObject



383
384
385
386
387
388
389
390
391
392
393
394
395
# File 'lib/ensembl/variation/variation.rb', line 383

def transcript
  host,user,password,db_name,port,species,release = Ensembl::Variation::DBConnection.get_info
  if !Ensembl::Core::DBConnection.connected? then     
      Ensembl::Core::DBConnection.connect(species,release.to_i,:username => user, :password => password,:host => host, :port => port)    
  end
  
  begin # this changed from release 58
    return Ensembl::Core::Transcript.find_by_stable_id(self.transcript_stable_id)
  rescue NoMethodError  
    return Ensembl::Core::Transcript.find(self.transcript_id)
  end
  
end