[ensembl-dev] accessing E. coli genes via API

Sabine Reißer sabine.reisser at mdc-berlin.de
Mon May 25 15:12:09 BST 2020


Hi everyone,

I'm trying to access E. coli genes via the API.

The output I get is

The API version used is 100
chromosome:ASM584v2:Chromosome:1:4641652:1
Slice: chromosome Chromosome 1-4641652 (1)
DBD::mysql::st execute failed: Table 
'bacteria_0_collection_core_47_100_1.analysis' doesn't exist at 
/home/sabine/bin/ensembl_api/src/ensembl/modules/Bio/EnsEMBL/DBSQL/AnalysisAdaptor.pm 
line 128.
DBD::mysql::st execute failed: Table 
'bacteria_0_collection_core_47_100_1.analysis' doesn't exist at 
/home/sabine/bin/ensembl_api/src/ensembl/modules/Bio/EnsEMBL/DBSQL/AnalysisAdaptor.pm 
line 128.

If I run in verbose mode I get

Species 'escherichia_coli_str_k_12_substr_mg1655' (id:99) loaded from 
database 'bacteria_0_collection_core_47_100_1'.

Maybe I'm missing something in the installation?

It would be great if someone could give me a hint.

Please find my code below.

Cheers

Sabine


use Bio::EnsEMBL::ApiVersion;

printf( "The API version used is %s", software_version() );
use Bio::EnsEMBL::Registry;

my $registry = 'Bio::EnsEMBL::Registry';
$registry->load_registry_from_db(
     -host => 'mysql-eg-publicsql.ebi.ac.uk',
     -port => 4157,
);

my $sp_EC = 'escherichia_coli_str_k_12_substr_mg1655';
my $group = 'Core';

my $slice_adaptor = $registry->get_adaptor($sp_EC, $group, "slice");
$slices = $slice_adaptor->fetch_all('toplevel');
foreach my $slice (@$slices) {
     print $slice->name(), "\n";
         my $coord_sys  = $slice->coord_system()->name();
         my $seq_region = $slice->seq_region_name();
         my $start      = $slice->start();
         my $end        = $slice->end();
         my $strand     = $slice->strand();

         print "Slice: $coord_sys $seq_region $start-$end ($strand)\n";
         foreach my $gene ( @{ $slice->get_all_Genes() } ) {
                 print $gene->stable_id(), "\n";
         }
  }



-- 
Dr. Sabine Reißer
Postdoctoral researcher

Bioinformatics of RNA Structure and Transcriptome Regulation
Berlin Institute for Medical Systems Biology
Max Delbrück Center for Molecular Medicine in the Helmholtz Association
Hannoversche Str. 28, 10115 Berlin, Germany

Tel.: +49 30 9406-3294

sabine.reisser at mdc-berlin.de
www.mdc-berlin.de

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ensembl.org/pipermail/dev_ensembl.org/attachments/20200525/bfb390f5/attachment.html>


More information about the Dev mailing list