[ensembl-dev] How to Fetch a Gene Tree (text) using compara API

mp at ebi.ac.uk mp at ebi.ac.uk
Wed Feb 13 00:23:11 GMT 2013


> If I use the web interface and browse for the gene PROCR.  I can inspect
> the Gene tree (text) display.
>
> http://www.ensembl.org/Homo_sapiens/Gene/Summary?g=ENSG00000101000;r=20:33759876-33765165;t=ENST00000216968
>
> If I wanted to fetch this newick tree using the compara API,
> what adaptor should I use?  It's not clear to me how to fetch the newick
> tree displayed for any specific gene of interest
>

Hi Joe,

You just need a gene tree. Try something like this:

my $member = $member_Adaptor->fetch_by_source_stable_id(undef,
'ENSG00000101000');
my $geneTree = $geneTree_Adaptor->fetch_default_for_Member($member);
my $newick_tree = $geneTree->root->newick_format('full_web');

This gives you the newick tree in the same format that is displayed in the
web. You can also specify different formats (see the
Bio::EnsEMBL::Compara::NestedSet module for more information on this).

Hope this helps,

Cheers,
M;

> Joe
> _______________________________________________
> Dev mailing list    Dev at ensembl.org
> Posting guidelines and subscribe/unsubscribe info:
> http://lists.ensembl.org/mailman/listinfo/dev
> Ensembl Blog: http://www.ensembl.info/
>





More information about the Dev mailing list