[ensembl-dev] error with ExonAdaptor fetch_all

Andrea Edwards edwardsa at cs.man.ac.uk
Sat Oct 30 00:07:50 BST 2010


I was trying to fetch all of the exons from my local installation of the 
ensembl cow database.

I had this simple code

use Bio::EnsEMBL::Registry;
use Bio::EnsEMBL::Transcript;
use Bio::EnsEMBL::Variation::Utils::Sequence qw(unambiguity_code);
use Bio::EnsEMBL::DBSQL::DBAdaptor;
use Bio::EnsEMBL::Variation::DBSQL::DBAdaptor;

my $registry = 'Bio::EnsEMBL::Registry';
$registry_file= "....";

my $exon_adaptor = $registry->get_adaptor( 'bos_taurus', 'Core', 'Exon' );
my $exons = $exon_adaptor->fetch_all();

$i = 0;
foreach $exon(@{$exons}) {
     print $exon->display_id, "\n";


print "done";


and got this error


MSG: Detected an error whilst executing SQL 'SELECT  e.exon_id, 
e.seq_region_id, e.seq_region_start, e.seq_region_end, 
e.seq_region_strand, e.phase, e.end_phase, e.is_current, 
e.is_constitutive, esi.stable_id, esi.version, 
UNIX_TIMESTAMP(created_date), UNIX_TIMESTAMP(modified_date)
FROM ( (exon e)
   LEFT JOIN exon_stable_id esi ON esi.exon_id = e.exon_id )
  WHERE e.biotype != "LRG_gene" and e.is_current = 1
': DBD::mysql::st execute failed: Unknown column 'e.biotype' in 'where 
clause' at 
line 521.

STACK Bio::EnsEMBL::DBSQL::BaseAdaptor::generic_fetch 
STACK Bio::EnsEMBL::DBSQL::ExonAdaptor::fetch_all 
STACK toplevel C:/Documents and 

The exon table doesn't have a field biotype??

This is the code for the fetch_all method from the PerlAPI docs


sub fetch_all {

   my  ($self)  =@_;

   my  $constraint  ='e.biotype != "LRG_gene" and e.is_current = 1';
   my  @exons   = @{  $self->generic_fetch($constraint)  };

   return\@ exons ;



Many thanks in advance for your help

More information about the Dev mailing list