[Bioperl-l] Opening up deleting features from Seq objects again

David Block dblock@gene.pbi.nrc.ca
Wed, 24 Oct 2001 16:13:38 -0600 (CST)


As part of our work in Genquire (soon to be released BSD! Finally!) we
have come to a point where it makes sense to include delete_feature
functionality in our Bio::SeqI implementation.

This should be extended to Bio::Seq generally because:

With complex GeneStructure objects, rebuilding a hierarchy of annotations
is not trivial.  The old technique, flush/add, flattens the hierarchy and
can result in multiple copies of exons being added to the sequence.

delete_feature can understand the feature's context and remove only those
parts of the parent gene that make sense.

Our implementation looks like this:
my $orphanlist=$seq->delete_feature($feature,$transcript,$gene);

This allows the current exon/transcript/gene hierarchy to be passed to the
sequence.  It returns a list of features which are no longer part of a
coherent gene structure, i.e. if you want to delete one of two
transcripts, but want the hypothetical exons that make up the transcript 
to stick around, the exons will be attached as top-level features and
returned to you.

This allows our gui to function as expected.

I volunteer to bolt this functionality on to Bio::Seq or one of its
descendants, if that's better.  We want it in SeqI, at least as a stub,
so SeqCanvas doesn't barf if it's given any SeqI and asked to delete
something.

SeqCanvas does nothing if nothing is returned, again as you would expect.

Let me know...

-- 
David Block
soon to be moving
dblock@gene.pbi.nrc.ca
http://bioinfo.pbi.nrc.ca/wiki
NRC Plant Biotechnology Institute
Saskatoon, SK, Canada