[ensembl-dev] How to get taxonomic level of a gene tree

Stephen Fitzgerald stephenf at ebi.ac.uk
Thu Dec 18 14:17:02 GMT 2014


Hi Julien, for the nodes you can use something like :

foreach my $gene_tree(@$gene_trees){
  foreach my $leaf(@{ $gene_tree->get_all_leaves }){
   print join(":", $leaf->taxon_id, $leaf->taxonomy_level), "\n";
  }
}

Cheers,
Stephen.

On Thu, 18 Dec 2014, Steve Moss wrote:

> Dear Julien,
> I think you can use
> 
> my $tax_level = $tree->species_tree_node()->node_name();
> 
> or 
> 
> my $tax_level = $tree->taxonomy_level();
> 
> Cheers,
> 
> Steve
> 
> On 18 December 2014 at 13:42, Julien Roux <julien.roux at unil.ch> wrote:
>       Dear list,
>
>       I used to get the taxonomical level of a gene tree using the following command:
>       my $tax_level = $tree->get_tagvalue("taxon_name");
>       But now I get this message:
>       ----------------- DEPRECATED ---------------------
>       Deprecated method call in file test.pl line 60.
>       Method Bio::EnsEMBL::Compara::GeneTreeNode::get_tagvalue is deprecated.
>       The taxon_name tag has been deprecated, support will end with e78. Please use species_tree_node() from the gene-tree node to get taxon information
>
>       I tried the following command without success:
>       my $tax_level = $tree->species_tree_node->get_tagvalue("taxon_id");
>       my $tax_level = $tree->species_tree_node->get_tagvalue("taxon_name");
>       my $tax_level = ${$tree->species_tree_node}{"taxon_id"};
>
>       Any hint how to access this data?
>       Thanks a lot
>       Julien
>
>       --
>       Julien Roux
>       Marie-Curie postdoctoral fellow
>       Department of Ecology and Evolution, University of Lausanne, Switzerland
>       http://www.unil.ch/dee/home/menuinst/people/post-docs--associates/dr-julien-roux.html
>       Tel: +41 78 700 2931
> 
>
>       _______________________________________________
>       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/
> 
> 
> 
> --
>  
> Steve Moss
> about.me/gawbul
> Steve Moss on about.me
>  
> 
>


More information about the Dev mailing list