Class: Ensembl::Variation::TranscriptVariation

Inherits:
DBConnection show all
Defined in:
lib/bio-ensembl/variation/variation_feature.rb,
lib/bio-ensembl/variation/variation_feature62.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



354
355
356
# File 'lib/bio-ensembl/variation/variation_feature.rb', line 354

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

#consequence_typesObject

workaround as ActiveRecord do not parse SET field in MySQL



428
429
430
# File 'lib/bio-ensembl/variation/variation_feature62.rb', line 428

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

#transcriptObject



358
359
360
361
362
363
364
365
366
367
368
369
370
# File 'lib/bio-ensembl/variation/variation_feature.rb', line 358

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