[Biojava-l] circular sequences

Mark Schreiber mark_s@sanger.otago.ac.nz
Sun, 28 Jan 2001 21:40:54 +1300 (NZDT)


On Fri, 26 Jan 2001, Thomas Down wrote:

> 
> Well, there's no problem doing a CircularSymbolList which overrides
> subList and subStr (I'd be tempted to write a class which gives
> a circularized view onto any underlying SymbolList, rather than
> subclassing a specific implementation).  Point to debate: should
> symbolAt(1001) for a 1000-symbol circular sequence return the
> value of symbolAt(1), or is this an error?
>

It depends. In some ways it would be nice if iterators etc could just
carry on around the sequence although at some point it would get a bit
stupid unless a signal is given to signify the end. Might just be best to
throw an exception and let the implementing program decide what to do
about it. On the other hand you could probably use the standard symbol
list in this way. 6 of one ....

My gut feeling is that we should allow indexing of residues greater than
the length of the sequence and if need be less than one. Zero in this
instance should be an invalid argument.
 
> Circular Sequence objects are slightly more of a pain, since I
> might want a Feature running from, say, 900 - 100.  Not sure
> what the best way to handle this is -- it's not a case recognized
> by out current Location objects.
> 

Maybe make a subclass of stranded feature since only DNA can be circular,
can anyone see a reason why not.

Mark

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Mark Schreiber			Ph: 64 3 4797875
Rm 218				email mark_s@sanger.otago.ac.nz
Department of Biochemistry	email m.schreiber@clear.net.nz
University of Otago		
PO Box 56
Dunedin
New Zealand
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~