[Bioperl-l] Testing BioPerl objects for equality

Lincoln Stein lstein at cshl.edu
Tue Feb 3 04:37:34 EST 2004


I think that's a great idea.  I hadn't known about test_deeply().  
There's also a Test::Differences module, that does something similar.

Lincoln

On Monday 02 February 2004 11:15 am, Bernhard Schmalhofer wrote:
> Ewan Birney wrote:
> > On Thu, 29 Jan 2004, Peter van Heusden wrote:
> >>I've got an idea for testing where I'd like to 'round-trip'
> >> through SeqIO: read in from a file on disk, write out again with
> >> write_seq() and then read in the file written by write_seq() and
> >> compare the two sequence objects. If they aren't equal, it means
> >> we've got a problem.
> >
> > That sounds like a great idea... we've always had problems with
> > diff'ing the files because of whitespace issues, but diff'ing the
> > objects sounds great.
> >
> >>To make this work requires some kind of equals() method on Seq,
> >>SeqFeature, etc. This doesn't seem to be there at the moment - or
> >> am I missing something? Maybe there should probably be some kind
> >> of Bio::ComparableI interface which provides an equals()
> >> abstract method.
>
> If the roundtrip is starting from a file is a specific format,
> shouldn't it be possiple to compare the data structures of the
> sequence object directly?
> I was think of using something like Test::More::is_deeply(), which
> tells you where the data structures start to become different.
>
> CU, Bernhard

-- 
Lincoln D. Stein
Cold Spring Harbor Laboratory
1 Bungtown Road
Cold Spring Harbor, NY 11724


More information about the Bioperl-l mailing list