[Bioperl-l] [Wg-phyloinformatics] Re: phyloXML weekly report

Han, Mira mirhan at indiana.edu
Tue Aug 12 03:46:35 UTC 2008


Hi,
Yes it is true that it's similar to get_all_Annotations, it's basically a recursive version of it.
I wanted to provide a method to get at nested annotations without going through all the if(isa collection) do recursive call.. etc. everytime, because most of the xml elements are implemented as nested annotation collections to the nodes.
( I am contemplating on using tagtrees instead of nested annotation collections in the future, but as of now, Annotation::tagtrees was documented as a temporary implementation, so I passed on that option. )
I forgot about the interface part.
At least for my purpose I would think it's a good function to have in the interface.
I agree that adding a recursive option to the get_all_Annotation would be better.

Mira





On 8/11/08 11:28 PM, "Hilmar Lapp" <hlapp at duke.edu> wrote:

Hi Mira -

On Aug 11, 2008, at 11:33 AM, Han, Mira wrote:

> Added get_deep_Annotations in Annotation::Collection
> in order to get annotations that are within nested collections.


I hope I'm not contradicting Chris here, but we will probably want to
think about this a bit more. Your implementation won't work as it is
assuming an interface function that isn't defined on the interface
(both get_deep_Annotations() and _deep_annotation_helper()). Also, it
does nearly the same as get_all_Annotations(), and passing on the keys
to nested collections should maybe simply be an option to that method.
Alternatively, one could add an option -recurse to get_Annotation.

The other difference you note is that your method does not flatten the
nested annotations, but unless I am missing something your
implementation does flatten annotations from nested collections.

So even if we need a separate method for this, something like
get_nested_Annotations() would probably be a more appropriate name,
and if we do need a separate method, it should be compelling enough to
add it to the interface too (as otherwise your code will only work
with certain implementation classes).

        -hilmar
--
===========================================================
: Hilmar Lapp  -:-  Durham, NC  -:- hlapp at duke dot edu :
===========================================================










More information about the Bioperl-l mailing list