[ensembl-dev] get_SimpleAlign(-cdna=>1) broken and deprecated?

Matthieu Muffato muffato at ebi.ac.uk
Tue Mar 31 16:49:04 BST 2015



On 31/03/15 15:29, Sébastien Moretti wrote:
> Hi Matthieu,
>
> It works now!
> In fact I had a second
>     get_SimpleAlign(-cdna=>1)
> overriding the replaced
>     get_AlignedMemberSet()->get_SimpleAlign(-SEQ_TYPE => 'cds')
> when I filter out some genes or nodes in the tree.
>
> It was faster/simpler to recall get_SimpleAlign() on this filtered GeneSet.
>
> Now both get_SimpleAlign use
> get_AlignedMemberSet()->get_SimpleAlign(-SEQ_TYPE => 'cds');
>
>
> You should add a warning when people use get_SimpleAlign(-cdna=>1)
> because currently it goes back to default (protein alignment) and does
> not return what (was) expected.
>

There was a warning, but it only stayed ~8 months. That was a mistake: 
methods in Compara are usually deprecated for ~1-1.5 years

Matthieu

>
> Thanks for your help.
>
>> Hi Sébastien,
>>
>> I'm afraid I can't reproduce the error. I can run the attached script
>> with the release/79 branch and it prints both protein and nucleotide
>> alignments. The script is what you've pasted in your email.
>>
>> How does my script behave in your environment ?
>>
>> Matthieu
>>
>> On 31/03/15 11:23, Sébastien Moretti wrote:
>>> Hi Matthieu,
>>>
>>> I use the live database and in my hands
>>>      get_SimpleAlign(-SEQ_TYPE => 'cds')
>>> or
>>>      get_AlignedMemberSet()->get_SimpleAlign(-SEQ_TYPE => 'cds')
>>> return both the protein alignment.
>>> I cannot get the nucleotide alignment.
>>>
>>>
>>> Thanks for your help
>>>
>>>
>>> my $reg = 'Bio::EnsEMBL::Registry';
>>> $reg->load_registry_from_db(
>>>       ...
>>> );
>>> my $tree_adaptor = $reg->get_adaptor('Multi', 'compara', 'GeneTree');
>>> my $tree = $tree_adaptor->fetch_by_root_id(375021); # id example
>>> $tree    = $tree->root; # To use GeneTreeNode everywhere after that !!!!
>>> ...
>>> my $prot_align = $tree->get_AlignedMemberSet()->get_SimpleAlign();
>>> my $cds_align  =
>>> $tree->get_AlignedMemberSet()->get_SimpleAlign(-SEQ_TYPE => 'cds');
>>>
>>>> Hi Sébastien,
>>>>
>>>> get_SimpleAlign(-SEQ_TYPE => 'cds') should work. Are you querying the
>>>> live database or your own mirror ? If the latter, have you loaded the
>>>> "other_member_sequence" table ?
>>>>
>>>> Yes, $gene_tree_node->get_SimpleAlign() is likely to be deprecated at
>>>> some point. Instead,
>>>> $gene_tree_node->get_AlignedMemberSet()->get_SimpleAlign() will work
>>>>
>>>> Matthieu
>>>>
>>>> On 31/03/15 08:04, Sébastien Moretti wrote:
>>>>> Hi
>>>>>
>>>>> With Ensembl API 71, or previous versions, I used to retrieve
>>>>> nucleotide
>>>>> (cds) alignments from a GeneTree set with
>>>>>     $tree->get_SimpleAlign(-cdna=>1);
>>>>>
>>>>> And related protein alignment with
>>>>>     $tree->get_SimpleAlign();
>>>>>
>>>>>
>>>>> Now with Ensembl API 79
>>>>>     $tree->get_SimpleAlign(-cdna=>1);
>>>>> also returns the protein alignment (without warning).
>>>>>
>>>>>
>>>>> I tried
>>>>>     $tree->get_SimpleAlign(-SEQ_TYPE => 'cds')
>>>>> or
>>>>>     $tree->get_SimpleAlign(-SEQ_TYPE => 'cdna')
>>>>> without much success.
>>>>>
>>>>>
>>>>> So what is the proper way now to retrieve a nucleotide alignment
>>>>> from a
>>>>> GeneTree set?
>>>>>
>>>>> Also Bio::EnsEMBL::Compara::GeneTreeNode::get_SimpleAlign is
>>>>> labeled as
>>>>> "deprecated soon".
>>>>>
>>>>>
>>>>> 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




More information about the Dev mailing list