[Biopython-dev] Circular sequences

Markus Piotrowski Markus.Piotrowski at ruhr-uni-bochum.de
Wed Jan 16 04:42:54 EST 2013


Am 15.01.2013 22:45, schrieb Antony Lee:
> needed to y to make it bigger than x, and stop there).  Slicing with one
> or both ends undefined (ie. s[:], s[x:], s[:y]) raises an IndexError
> (because, well, I read s[x:] as "return the elements of s starting from
> the x'th until the end"... but there is no such end.).  (A second option
> would be to return an infinite iterable for s[x:], but that doesn't take
> care of s[:y] anyways, not to mention the bugs that may appear from
> that.)

Another possibility, which makes some biological sense (thinking on 
restriction), would be that
s[x:] (or s[:y]) returns a linear sequence starting at x and ending with 
x-1 (or ending with y and starting at y+1). Thus, s[x:] would mean 'cut 
my circle at x and return the linear sequence starting at x'.

Markus




More information about the Biopython-dev mailing list