[Bioperl-l] StandAloneFasta::version

Chris Fields cjfields at uiuc.edu
Mon Nov 6 16:21:10 EST 2006


Weren't the problems with the reported StandAloneFasta.pm test fails  
due to differences in the returned order of the Hits/HSPs in the  
FASTA reports from the different versions?  The test results you  
posted on the wiki (where I commented on this) seem to indicate that:

not ok 11
# Test 11 got: "0" (t/StandAloneFasta.t at line 75)
#    Expected: "994"
#  t/StandAloneFasta.t line 75 is: ok $hsp->num_identical, 994;
not ok 12
# Test 12 got: "1977" (t/StandAloneFasta.t at line 76)
#    Expected: "994"
#  t/StandAloneFasta.t line 76 is: ok $hsp->length, 994;
ok 13
not ok 14
# Test 14 got: "0" (t/StandAloneFasta.t at line 88)
#    Expected: "994"
#  t/StandAloneFasta.t line 88 is: ok $hsp->num_identical, 994;
not ok 15
# Test 15 got: "1977" (t/StandAloneFasta.t at line 89)
#    Expected: "994"
#  t/StandAloneFasta.t line 89 is: ok $hsp->length, 994;

It looks like a value is returned for the tests, so parsing isn't  
broken.  They just aren't returned in the order specified, so the  
tests are faulty, not the parsing.  The tests could be fixed by using  
id/score key/value pairs in a hash or something similar.  We probably  
shouldn't limit to a specific version unless parsing is actually broken.


On Nov 6, 2006, at 2:29 PM, Nathan S. Haigh wrote:

> Hi Sendu,
> I've written a version method for StandAloneFasta.pm. However, because
> of the way in which FASTA is versioned, it makes for difficult version
> comparisons i.e. they contain non-numeric characters e.g. 3.4t26.
> I have employed a private function that does a conversion of the
> non-numeric characters into their ascii value representation to  
> build a
> float. e.g. the above version would result in: 3.411626 which can then
> be compared easily. At the moment, this is accessed via
> $factory->version like other modules as this will give access to a
> version number that is easily comparable. However, should there be a
> different function to return the unconverted version string e.g.  
> 3.4t26?
> Or should there be a function that does a compare internally so it can
> be accessed something like:
> print "we have met the min version requirement\n" if
> $factory->at_least_version('3.4t26');
> Ideas welcome!
> Nath
> _______________________________________________
> 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