[Bioperl-l] Testing BioPerl objects for equality

Peter van Heusden pvh at egenetics.com
Mon Mar 8 03:50:13 EST 2004


Lincoln Stein wrote:

>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.
>
>  
>
The problem with doing a data structure level comparison is that you 
might now want to test the data structures for literal equality - 
equality != equivalence. That's why the equals() methods that I've been 
adding to various classes try to be smart about how Bioperl objects 
actually work.

Having said that, I must still think about how to make diff'ing work... 
it is frustrating to simply have equals / doesn't equal, but no details. 
I'll look into that after I've finished the initial code.

Peter

>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
>>    
>>
>
>  
>



More information about the Bioperl-l mailing list