[Bioperl-l] undef SeqFeature tag values
Chris Fields
cjfields at uiuc.edu
Sat Aug 25 14:36:08 UTC 2007
The rollback branch is off of HEAD, not 1.4, so any bugs fixed since
then and any modules/tests added will be present. So far everything
has worked relatively well; you can check the history of this page to
track what has happened so far:
http://www.bioperl.org/wiki/Feature_Annotation_rollback
The only problem code remaining for the first round of changes is a
single method in Bio::SeqFeature::Annotated (if the tests are to be
trusted) and one test in Bio::SeqFeature::AnnotationAdaptor using
Hilmar's original test suite. Most of those were tests breaking
Feature/Annotation API outlined in the HOWTO (calling get_Annotations
directly from a Bio::SeqI or Bio::SeqFeatureI for instance), or
examples where has_tag() was not used. I agree good test coverage
would probably help catch some of those still silently lingering in
code, but I don't think it can find everything; that's the reason I
indicate there will need extensive testing. That applies within the
suite but also by users in the wild.
The SeqFeatureI and AnnotatableI API is defined very specifically in
the Feature/Annotation HOWTO, so if anything the introduced changes
violated much of that and started a domino effect of users
unknowingly violating the API (me among them). Also, just b/c a test
passes doesn't mean it is the ->correct<- result; it is very easy to
just throw something from Data::Dumper into an is() test and have it
pass. As an example, it appears there was a bit of cheating going on
with AnnotationAdaptor.t in particular, where expected numbers were
changed to conform to results w/o explanation. Which is the correct
answer? I trust Hilmar's original test suite over the (rushed) changes.
chris
On Aug 25, 2007, at 2:50 AM, Nathan S. Haigh wrote:
> This sort of highlights a comment I made previously about how do you
> test for a stable API?
>
> It seems to me that unless you have intricate knowledge about the
> changes that took place, you will find it difficult to know when an
> API
> change has occurred. Is it possible to run the 1.4 test suite against
> existing code to ensure tests pass? What if the 1.4 tests contained
> bugs? This approach would need good code coverage by the tests to
> ensure
> things work the same i.e. test code in HEAD against the test suite
> from
> the previous stable release's branch - would/should this work
> conceptually?**
>
> Nath
>
> Hilmar Lapp wrote:
>> You're supposed to call has_tag() first before you can assume that
>> you can call get_tag_values() w/o an exception. That was the original
>> API.
>>
>> -hilmar
>>
>> On Aug 24, 2007, at 6:36 PM, Chris Fields wrote:
>>
>>
>>> One thing I am noticing with the rollback to tag as strings is that
>>> tags with an undefined value are not set; I'm assuming when tags
>>> were
>>> Bio::AnnotationI they were instantiated regardless with an undef
>>> value. When attempting to call an undef tag with get_tag_values() I
>>> get:
>>>
>>> ------------- EXCEPTION: Bio::Root::Exception -------------
>>> MSG: asking for tag value that does not exist signalPeptideLength
>>> STACK: Error::throw
>>> STACK: Bio::Root::Root::throw /Users/cjfields/src/featann_rollback/
>>> bioperl-live/blib/lib/Bio/Root/Root.pm:357
>>> STACK: Bio::SeqFeature::Generic::get_tag_values /Users/cjfields/src/
>>> featann_rollback/bioperl-live/blib/lib/Bio/SeqFeature/Generic.pm:499
>>> STACK: t/targetp.t:189
>>> -----------------------------------------------------------
>>>
>>> I personally think of this as a feature (why set a tag at all if it
>>> is undef?). However, are there any circumstances where we might
>>> want
>>> this behavior? Do we want to simply return w/o a value if a tag
>>> name
>>> isn't found (i.e. remove the exception)?
>>>
>>> chris
>>>
>>> _______________________________________________
>>> Bioperl-l mailing list
>>> Bioperl-l at lists.open-bio.org
>>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>>>
>>
>>
>
Christopher Fields
Postdoctoral Researcher
Lab of Dr. Robert Switzer
Dept of Biochemistry
University of Illinois Urbana-Champaign
More information about the Bioperl-l
mailing list