[Bioperl-l] PrimarySeq::length

Jason Stajich jason@cgt.mc.duke.edu
Fri, 11 Oct 2002 09:35:16 -0400 (EDT)


On Fri, 11 Oct 2002, 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.
>
Yep, I like this as well - length can be reset iff seq is null and if seq
is subsequently set the length value is overridden by length of the newly
updated sequence.

> 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
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l@bioperl.org
> http://bioperl.org/mailman/listinfo/bioperl-l
>

-- 
Jason Stajich
Duke University
jason at cgt.mc.duke.edu