[ensembl-dev] API Perl Code Example Repository

Sumir Panji sumir at sanbi.ac.za
Wed Feb 1 15:10:46 GMT 2012


Hello,
  I am new to both PERL and using the Ensembl PERL API (version 65). I 
have been looking around for any example PERL API scripts that I could 
use to learn as well as adapt for my own use other then what is briefly 
provided in the API tutorial docs. Is there a central repository that 
contains sample code that can be used to figure out all the methods and 
classes for the API? The one example I came across that I liked (taken 
from slide 11 : 
http://www.docstoc.com/docs/55683571/Ensembl-Developers-Workshop-Core-API) 
does not seem to work very well.

#!/usr/bin/perl

use Bio::EnsEMBL::Registry;

my $registry = 'Bio::EnsEMBL::Registry';

use Bio::EnsEMBL::Registry;
Bio::EnsEMBL::Registry->load_registry_from_db(
                    -host    => 'ensembldb.ensembl.org',
                    -user    => 'anonymous'
                    );
my $gene_adaptor = $registry->get_adaptor('Human', 'Core', 'Gene');

my $genes-> fetch_all;

while (my $gene = shift @{$genes}){
         print $gene->stable_id, "\n";
         }

Error message : Can't call method "fetch_all" on an undefined value at 
test_gene_ensembldb.pl line 14.

  Thank you,
  sumir

p.s I have been through all the mailing list archives 2006 - present






More information about the Dev mailing list