[Bioperl-l] new/unannounced methods

Chris Fields cjfields at uiuc.edu
Fri Mar 9 21:55:05 EST 2007

On Mar 9, 2007, at 11:37 AM, Michael Kiwala wrote:

> Phillip San Miguel wrote:
>> Not sure if this constitutes a namespace collision but  
>> Bio::PrimarySeqI
>> has a method trunc(). It is like subseq() but returns an object,  
>> rather
>> than a string.
>> Phillip
> Actually, I think it's polymorphism. What I imagine is that eventually
> you should be able to call trunc() on any PrimarySeqI implementing
> object and it will trunc() itself and any children it has that also
> can('trunc'). So if the sequence you are trying to trunc() implements
> FeatureHolderI like SeqI does then (one day, once this is all  
> coded) the
> sequence object will also do the Right Thing with the features it  
> holds
> (currently, it does not). Similarly, revcom(), cat(), and excise()*
> should work the same way.

One would think so, yes.

> Is anyone out there currently working on this? If not I am  
> volunteering.
> I'd like to move Bio::SeqUtils::trunc_with_features() and friends to
> Bio::SeqI::trunc(), etc.

I don't think you'll hear too many protests if you want to take it  
on.  Just make sure to add decent tests as needed and document  
everything (one lesson learned from all this!).

The trunc() method is implemented in Bio::PrimarySeqI, so it probably  
should stay there.  It looks like the method already takes into  
account the possibility the object may be a Bio::SeqI or other  
PrimarySeqI besides Bio::PrimarySeq.  You could just add a check for  
$seq->isa('FeatureHolder') there then truncate features accordingly.

BTW, how would you handle CDS seqfeatures and 'translation' tag data  
or other seqfeat-based stuff that's location-dependent?

> *excise() is a method I'd like to add that would allow one to remove a
> section out of the middle of a sequence, such as a transposable  
> element
> that you don't want to submit to GenBank.

Sounds fine with me, thought this may belong in Bio::PrimarySeqI as  
well (at least I think so, since it seems like it would apply to any  


More information about the Bioperl-l mailing list