[ensembl-dev] FW: ensembl api query

BURT David dave.burt at roslin.ed.ac.uk
Sun Jun 12 18:46:05 BST 2011


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.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: dbentry_errors.txt
URL: <http://mail.ensembl.org/pipermail/dev_ensembl.org/attachments/20110612/798d0595/attachment.txt>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dbentry_test.pl
Type: application/octet-stream
Size: 1099 bytes
Desc: dbentry_test.pl
URL: <http://mail.ensembl.org/pipermail/dev_ensembl.org/attachments/20110612/798d0595/attachment.obj>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ATT00001.txt
URL: <http://mail.ensembl.org/pipermail/dev_ensembl.org/attachments/20110612/798d0595/attachment-0001.txt>


More information about the Dev mailing list