[Bioperl-l] adding seqfeatures in Bio::Seq

Hilmar Lapp hlapp@gnf.org
Thu, 26 Sep 2002 17:42:07 -0700


When you do this, the implementation attempts to attach its 
primary_seq object to the added feature -- so fine so good -- unless 
the feature has already a seq attached which is not equal to the 
primary_seq to be attached (if it is equal it proceeds even though 
it's pointless). If it is unequal, it issues a warning and does 
nothing.

I don't like this and I vote for abandoning this restriction (I've 
hit a snag because of this). Why do we need to be so strict here?

My arguments are:
1) This implementation allows a state that is otherwise deemed 
inconsistent: sequence and the added feature's sequence disagree.
2) It assumes that the sequence attached to the feature is a 
PrimarySeq object. Why assume this?
3) It is pickier than attach_seq() of the feature itself, which 
happily goes ahead no matter what was attached before.
4) There is no method to de-tach a sequence from a feature. I.e., 
once you attached a seq, you need to re-create the feature in order 
to re-virginify the slot for the attached seq, or find some other 
ugly work-around code.

My point is you shouldn't need ugly work-around code to get around this.

I could also fix 4) such that $feat->attach_seq(undef) would de-tach 
a previously attached seq. However, to me the most sensible solution 
is also the simplest one: remove the restriction in 
Seq::add_SeqFeature().

Comments? Thoughts? Objections?

	-hilmar
--
-------------------------------------------------------------
Hilmar Lapp                            email: lapp at gnf.org
GNF, San Diego, Ca. 92121              phone: +1-858-812-1757
-------------------------------------------------------------