[Bioperl-l] PrimarySeq::length

Hilmar Lapp hlapp@gnf.org
Fri, 11 Oct 2002 10:02:48 -0700


OK - so I'll disable the case that is most likely not to be sane: 
setting the length to something different than the actual sequence 
length. We can easily re-open that if someone has a use case for 
this; I don't. You will still be able to set it to the same length 
to allow for the two-liner I posted earlier (I do have a use case 
for that).

BTW I had already implemented invalidating a previously set length 
once you change the seq.

Seems that's OK with everyone?

	-hilmar

On Friday, October 11, 2002, at 06:12 AM, Lincoln Stein wrote:

> A nice feature with a lot of rope to hang ourselves with.
>
> I'm leary to make it possible for length() to return one value, and 
> seq() to
> return a string that has a different length.   I think it's ok to 
> be able to
> set the length attribute in the virtual sequence situation where 
> seq() is
> going to return undef -- although I don't remember how this discussion
> resolved -- but not ok in the real sequence case unless you're also 
> willing
> to perform a truncation operation on the underlying sequence string.
>
> Lincoln
>
> On Friday 11 October 2002 03:34 am, Hilmar Lapp wrote:
>> I changed this to possibly function as a real attribute. I.e., you
>> can set a value and it will then return this value in get mode. (If
>> you don't set a value it will still report the length of what seq()
>> returns.)
>>
>> This is useful especially if you don't want to keep the actual
>> sequence around (for memory efficiency for instance, or because you
>> told the SeqBuilder not to parser the sequence). To this end, there
>> is now also a parameter -length you can supply to new().
>>
>> I also changed seq() such that it allows setting to undef. Note that
>> if you set seq to something not undef and different from the
>> previous value, a previously set length() attribute will be
>> invalidated (you need to set it again if you still want it).
>>
>> There was discussion a while ago regarding PrimarySeqIs without a
>> sequence (VirtualSeq, EmptySeq, etc) ... I'm not convinced we need a
>> separate class to allow this, but people should note that a format
>> writer is not required to be able to cope with an empty sequence.
>>
>> 	-hilmar
>>
--
-------------------------------------------------------------
Hilmar Lapp                            email: lapp at gnf.org
GNF, San Diego, Ca. 92121              phone: +1-858-812-1757
-------------------------------------------------------------