[ensembl-dev] FW: ensembl api query

Monika Komorowska monika at ebi.ac.uk
Mon Jun 13 11:00:56 BST 2011


Hi David

Are you sure you're using version 62, I just tried your script on 62 and didn't get the error.
I can't see a call to add_linkage_type at line 1262 in DBEntryAdaptor in version 62 either.

Can you add these two lines to your code, to get the API version you're running:
use Bio::EnsEMBL::ApiVersion;

  printf( "The API version used is %s\n", software_version() );


Regards
Monika

On 12 Jun 2011, at 18:46, BURT David wrote:

> any more ideas on problem below?
> 
> made a few changes - still not working on my system (tried two PCs)
> 
> interesting - I can get $dbe->display_id() but nothing from $dbe->dbname()
> also able to get versions, release and other parameters but no dbname (this is w=oine of the things I wanted)
> so looks like the external database name is not being assigned
> 
> however Bert and Daniel get the simple script to work
> 
> I have re-sinatlled v62 - still odd behaviour
> 
> "Can't locate object method "add_linkage_type" via package "Bio::EnsEMBL::IdentityXref"
> at /cygdrive/c/Bioinformatics/Ensembl/src/ensembl/modules/Bio/EnsEMBL/DBSQL/DBEntryAdaptor.pm line 1262."
> 
> where there is no add_linkage_type metrhod in Bio::EnsEMBL::IdentityXref
> 
> so I think must be earlier problem related to dbname not being assigned
> 
> must be something with my setup?
> 
> 
> 
> Recently ran a "simple" test of my Ensembl perl api install using an example from the core tutorial - to list external database entries.
> 
> Perl program and output is attached and below.
> 
> PERL SCRIPT
> ==========
> 
> #!/bin/perl.exe -w
> 
> use strict;
> 
> use Bio::EnsEMBL::Registry;
> my $registry = 'Bio::EnsEMBL::Registry';
> $registry->load_registry_from_db(-host => 'ensembldb.ensembl.org', -user => 'anonymous');
> 
> print $gene_adaptor->dbc->dbname."\n";
> print $gene_adaptor->dbc->port."\n\n";
> 
> # Define a helper subroutine to print DBEntries
> sub print_DBEntries
> {
>    my $db_entries = shift;
> 
>    foreach my $dbe ( @{$db_entries} ) {
>        printf "\tXREF %s (%s)\n", $dbe->display_id(), $dbe->dbname();
>    }
> }
> 
> my $gene_adaptor = $registry->get_adaptor( 'Human', 'Core', 'Gene' );
> 
> # Get the 'COG6' gene from human
> my $gene = $gene_adaptor->fetch_by_display_label('COG6');
> 
> print "GENE ", $gene->stable_id(), "\n";
> print_DBEntries( $gene->get_all_DBEntries() );
> 
> foreach my $transcript ( @{ $gene->get_all_Transcripts() } ) {
>    print "TRANSCRIPT ", $transcript->stable_id(), "\n";
>    print_DBEntries( $transcript->get_all_DBEntries() );
> 
>    # Watch out: pseudogenes have no translation
>    if ( defined $transcript->translation() ) {
>        my $translation = $transcript->translation();
> 
>        print "TRANSLATION ", $translation->stable_id(), "\n";
>        print_DBEntries( $translation->get_all_DBEntries() );
>    }
> }
> 
> 
> OUTPUT
> ======
> 
> homo_sapiens_core_62_37g
> 5306
> 
> GENE ENSG00000133103
> Use of uninitialized value in printf at test.pl line 39.
>        XREF OTTHUMG00000016768 ()
> Use of uninitialized value in printf at test.pl line 39.
>        XREF COG6 ()
> TRANSCRIPT ENST00000416691
> 
> Can't locate object method "add_linkage_type" via package "Bio::EnsEMBL::IdentityXref"
> at /cygdrive/c/Bioinformatics/Ensembl/src/ensembl/modules/Bio/EnsEMBL/DBSQL/DBEntryAdaptor.pm line 1262.
> 
> 
> 
> -- 
> The University of Edinburgh is a charitable body, registered in
> Scotland, with registration number SC005336.
> 
> <dbentry_errors.txt><dbentry_test.pl>_______________________________________________
> Dev mailing list    Dev at ensembl.org
> List admin (including subscribe/unsubscribe): http://lists.ensembl.org/mailman/listinfo/dev
> Ensembl Blog: http://www.ensembl.info/
> _______________________________________________
> Dev mailing list    Dev at ensembl.org
> List admin (including subscribe/unsubscribe): http://lists.ensembl.org/mailman/listinfo/dev
> Ensembl Blog: http://www.ensembl.info/

Monika Komorowska
EnsEMBL Software Developer

European Bioinformatics Institute (EMBL-EBI)
tel: +44(0) 1233 494 409

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


More information about the Dev mailing list