[ensembl-dev] GeneTree deprecated tag

Caffrey, Daniel Daniel.Caffrey at umassmed.edu
Tue Mar 31 15:21:11 BST 2015


Dear Ensembl developers,

This is not a complaint, but I just wanted to make it known that changes to method names like this do have ripple effects. My group research group uses more than one version of Ensembl (depending on the age of the project) and we had to refactor some of our code to handle the different methods for different versions.  It wasn't a major inconvenience, and I understand that  occasional changes like this are sometimes needed.  

However, one the APIs appealing features is that the majority of class names and methods that we use have remained unchanged (even when the underlying schema has probably changed a lot). I'm hoping this will be the case in the future and you can clarify/confirm your philosophy regarding future changes to method names. 

Thanks,

Daniel

______________
Daniel Caffrey
Assistant Professor
Division of Infectious Diseases and Immunology
Department of Medicine
University of Massachusetts Medical School
364 Plantation St
Worcester MA 01605




On Mar 31, 2015, at 5:43 AM, Matthieu Muffato <muffato at ebi.ac.uk>
 wrote:

> Hi Sébastien,
> 
> Yes, the taxonomy annotation can now be fetched this way:
> $gene_tree_node->species_tree_node();  [returns a SpeciesTreeNode object]
> $gene_tree_node->species_tree_node()->node_name;
> $gene_tree_node->species_tree_node()->taxon_id;
> $gene_tree_node->species_tree_node()->taxon;    [returns a NCBITaxon object]
> $gene_tree_node->species_tree_node()->taxon->left_index;
> 
> Matthieu
> 
> On 30/03/15 16:20, Sébastien Moretti wrote:
>> Hi
>> 
>> found solution at
>> http://lists.ensembl.org/pipermail/dev/2014-December/010674.html
>> 
>> Next time I will search there before ;-)
>> The worst being that it was asked by a colleague next door.
>> 
>>> Hi
>>> 
>>> I used to use
>>>    $taxon_level = $tree->get_value_for_tag('taxon_name');
>>> with $tree as GeneTree adaptor.
>>> 
>>> With Ensembl API 79, it looks get_value_for_tag (or get_tagvalue) method
>>> is deprecated
>>> And "taxon_name" tag is also deprecated.
>>> 
>>> It is now recommended to use species_tree_node method but it does not
>>> work with "taxon_name" tag.
>>> ERR: Can't call method "left_index" on an undefined value
>>> 
>>> 
>>> So what is the proper way to get it now?
>>> 
>>> 
>>> CODE:
>>> my $reg = 'Bio::EnsEMBL::Registry';
>>> $reg->load_registry_from_db(
>>>             ...
>>> );
>>> my $tree_adaptor       = $reg->get_adaptor('Multi', 'compara',
>>> 'GeneTree');
>>> my $ncbi_taxon_adaptor = $reg->get_adaptor('Multi', 'compara',
>>> 'NCBITaxon');
>>> 
>>> my $tree    = $tree_adaptor->fetch_by_root_id(375021); # id example
>>> my $tax_level = $tree->species_tree_node('taxon_name');
>>> my $deepest_node_tax =
>>> $ncbi_taxon_adaptor->fetch_node_by_name($tax_level);
>>> my $left_tax         = $deepest_node_tax->left_index;
>>> 
>>> Regards
>> 
> 
> -- 
> Matthieu Muffato, Ph.D.
> Ensembl Compara and TreeFam Project Leader
> European Bioinformatics Institute (EMBL-EBI)
> European Molecular Biology Laboratory
> Wellcome Trust Genome Campus, Hinxton
> Cambridge, CB10 1SD, United Kingdom
> Room  A3-145
> Phone + 44 (0) 1223 49 4631
> Fax   + 44 (0) 1223 49 4468
> 
> _______________________________________________
> 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