[Bioperl-l] PrimarySeq properties in LocatableSeqs

Chris Fields cjfields at illinois.edu
Tue Nov 18 23:48:20 EST 2008

On Nov 18, 2008, at 9:05 PM, Mark A. Jensen wrote:

> Gurus-
> I ran into a interesting 'bug' while taking slices of a
> Bio::SimpleAlign. I had set the primary_id of the original
> LocatableSeqs while constructing the aln. When the slice is
> delivered using Bio::SimpleAlign::slice(), the primary_id's didn't
> travel with the subseqs constructed for the subalignment, and this
> hammered subsequent manipulations with the subalignment.
> Inspecting slice(), I saw that the new objects created for the subseqs
> get the id (display_id) from the old, but that other properties
> with valid accessors in the base class are not passed along, which
> seemed a bit arbitrary. Course, I can set the other properties after
> the slice is delivered, but that seems kludgy, and the bug was strange
> and led to 'time spent in deeper understanding of BioPerl'.
> What is the philosophy: Could/should all fields/properties from the
> base classes be generally inherited when constructing an new derived
> object from an old one?
> cheers, Mark

In general, yes they should when appropriate.  However, the problem is  
that the API may change slightly over time to deal with additional  
problems (add new attributes/methods), but the method making the  
slices is incapable of automatically dealing with these and must be  
updated as well.  I think trunc() was supposed to do this but was  
never implemented.

If you can could you add this as a bug?


More information about the Bioperl-l mailing list