[ensembl-dev] Havana Gene in Compara

muffato at ebi.ac.uk muffato at ebi.ac.uk
Tue May 10 17:07:21 BST 2011


Hi Nick

The only available sources for the Compara Member object are ENSEMBLPEP,
ENSEMBLGENE, Uniprot/SWISSPROT, and Uniprot/SPTREMBL. With an Havana gene
name, you can go first through the core database to retrieve the Ensembl
stable gene id.

my $human_gene_adaptor = Bio::EnsEMBL::Registry->get_adaptor("Homo
sapiens", "core", "Gene");
my $all_genes =
$human_gene_adaptor->fetch_all_by_external_name('OTTHUMG00000023246');

## For each of these genes...
foreach my $gene (@$all_genes) {
  ## Get the compara member
  my $member = $member_adaptor->fetch_by_source_stable_id("ENSEMBLGENE",
$gene->stable_id);
  print $member->description,"\n";
}

Hope this helps,
Matthieu

> I'm trying to get a member adaptor for Havana Genes (ncRNAs), for
> example OTTHUMG00000002858.
> The following script works for Ensembl Genes, but how do I have to
> formulate it for Havana Genes?
>
> #!/usr/bin/perl
> use lib "/opt/ensembl/modules";
> use lib "/opt/ensembl-compara/modules";
> use strict;
> use Bio::EnsEMBL::Registry;
>
> Bio::EnsEMBL::Registry->load_registry_from_db(-host =>
> 'ensembldb.ensembl.org', -user => 'anonymous');
> my $member_adaptor = Bio::EnsEMBL::Registry->get_adaptor('Multi',
> 'compara', 'Member');
> throw("Cannot connect to Compara") if (!$member_adaptor);
>
> # works:
> my $member =
> $member_adaptor->fetch_by_source_stable_id('ENSEMBLGENE','ENSG00000004059');
> die("Gene not found!") if (!$member);
> print $member->description,"\n";
>
> # does not work:
> my $member =
> $member_adaptor->fetch_by_source_stable_id('HAVANAGENE','OTTHUMG00000002858');
> die("Gene not found") if (!$member);
> print $member->description,"\n";
>
> The program dies on the second "fetch_by_source_stable_id" for
> OTTHUMG00000002858. How can I fetch an adaptor for it?
>
>
> _______________________________________________
> 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/
>






More information about the Dev mailing list