[Bioperl-l] Bio::Seq->delete_SeqFeature missing?

Ewan Birney birney@ebi.ac.uk
Wed, 9 May 2001 11:00:14 +0100 (BST)


On Mon, 7 May 2001, Malcolm Cook wrote:

> I note that there are no methods for deleting features from a Bio::Seq
> object.
> 
> Am I off base in wanting/expecting to find one?
> 
> Here's why I want it:
> 
> I've got to parse files that more-or-less conform to GENBANK format, except
> for that my users have been adding 'funny' features using non-standard
> terms.
> 
> Since I don't need to re-write these files with these 'funny features', I
> simply defined a SeqIO format by creating an object, call it mygb, that
> inherits from SeqIO::Genbank, with a next_seq method as follows:
> 
> sub next_seq{
>   my($self,@args) = @_;
>   my $seq = $self->SUPER::next_seq(@args);
>   return unless $seq;
>   foreach my $feat ($seq->top_SeqFeatures() ) {
>    .. massage the features
> 
> After selected features are 'massaged' I want to $seq->delete_SeqFeature it.


I would do it by creating a new Seq object and adding SeqFeature objects
that you want - most object environments work far better when you do
create/destroy cycles rather than edits. 

there is virtually no overhead compared to edits.



> 
> Make sense?
> 
> This all works fine except for not being able to delete them features.
> 
> Thanks,
> 
> Malcolm Cook
> 
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l@bioperl.org
> http://bioperl.org/mailman/listinfo/bioperl-l
> 

-----------------------------------------------------------------
Ewan Birney. Mobile: +44 (0)7970 151230, Work: +44 1223 494420
<birney@ebi.ac.uk>. 
-----------------------------------------------------------------