[Bioperl-l] [Wg-phyloinformatics] Re: phyloXML weekly report
Hilmar Lapp
hlapp at duke.edu
Sat Aug 16 17:43:46 UTC 2008
On Aug 15, 2008, at 10:12 AM, Chris Fields wrote:
> The method get_all_annotation_keys() is present in
> AnnotationCollectionI but not get_all_Annotations()
Interesting. I wonder whether that was a result of the forward and
reverse surgeries done to the Annotation* interfaces. (I'm off-line as
I write this so can't check.)
> , though I doubt it is set up for recursive retrieval (something
> that might be worth testing). I don't have a problem adding this
> in. Hilmar, thoughts?
get_all_Annotations() has always been recursive (similarly as
get_all_SeqFeatures() is for SeqI). However, the recursive behavior is
different from the behavior that Mira wants.
Specifically, if get_all_Annotations() finds a nested collection under
a matching tag, it will consider the entire nested collection as
match, and returns the recursively flattened out annotation objects it
contains. What Mira needs (if I am understanding her implementation
correctly) is recursively retrieving annotations if their tag matches
the query key or set of keys. I.e., a nested collection would be
searched for matching tags even if the tag of the collection itself
does not match, and if it does match, only those of the contained
annotations would be returned that have matching tags.
I'm not sure whether it's better to fold both behaviors into one
method which has an optional argument to control which one is desired,
or to have two methods. I'm leaning towards having two methods,
because support for an added optional argument in external
implementations of the interface is hard to test for, as opposed to
testing for the presence/absence of a new method. On the other hand,
if the existing method wasn't even on the interface to begin with
(which I'm not yet convinced about) then that shouldn't really be an
issue.
It seems Chris you are also for adding a second method (and putting
get_all_Annotations() (back) into the interface)? Does anyone else
have thoughts or preferences on this?
-hilmar
>
>
> chris
>
> On Aug 15, 2008, at 1:11 AM, Han, Mira wrote:
>
>>
>> Hi,
>> I've fixed the get_deep_Annotations() to get_nested_Annotations()
>> It has arguments -keys and -recursive,
>> And behaves exactly like get_Annotations() when recursive is not
>> set (tested by replacing the get_Annotations() in the Annotation.t)
>> I made it a new function instead of modifying get_Annotations()
>> because I wasn't sure how to modify it to be backwards compatible.
>> I thought of adding the function to the interface
>> AnnotationCollectionI,
>> But it seemed like get_all_Annotations() was missing from the
>> interface as well,
>> So decided to ask if it should be added to the interface at all.
>> Isn't it possible that certain implementations of the interface has
>> functions that are only specific to that implementation?
>>
>> Mira
>>
>>
>> On 8/12/08 12:00 AM, "Mira Han" <mirhan at indiana.edu> wrote:
>>
>>
>> Oh yes,
>> I meant get_Annotations,
>> I want a get_Annotations that is recursive and passes the keys to
>> the recursive calls.
>>
>>
>>
>> On 8/11/08 11:54 PM, "Hilmar Lapp" <hlapp at duke.edu> wrote:
>>
>> Hi Mira -
>>
>> On Aug 11, 2008, at 11:46 PM, Han, Mira wrote:
>>
>>> Yes it is true that it's similar to get_all_Annotations, it's
>>> basically a recursive version of it.
>>
>>
>> I suppose you mean get_Annotations(), right? (get_all_Annotations()
>> is
>> already recursive)
>>
>> -hilmar
>> --
>> ===========================================================
>> : Hilmar Lapp -:- Durham, NC -:- hlapp at duke dot edu :
>> ===========================================================
>>
>>
>>
>>
>>
>>
>>
>
> Christopher Fields
> Postdoctoral Researcher
> Lab of Dr. Marie-Claude Hofmann
> College of Veterinary Medicine
> University of Illinois Urbana-Champaign
>
>
>
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
--
===========================================================
: Hilmar Lapp -:- Durham, NC -:- hlapp at duke dot edu :
===========================================================
More information about the Bioperl-l
mailing list