def subsequence(self, start, end):
if (start < self.start or start >= self.end or end <= self.start or<EOL>end > self.end or start >= end):<EOL><INDENT>raise SequenceError("<STR_LIT>" + str(start) +<EOL>"<STR_LIT>" + str(end) + "<STR_LIT>" + str(self))<EOL><DEDENT>rel_start_string_coord = self.start - start - <NUM_LIT:1><EOL>rel_end_string_coord = self.end - end - <NUM_LIT:1><EOL>seq = self.sequenceData[rel_start_string_coord:rel_end_string_coord]<EOL>return Sequence(self.name, seq, start, end, self.strand,<EOL>self.remaining + self.end - end, self.mutableString)<EOL>
Extract a subsequence from this sequence object using absolute coordinates
that exist in the same coordinate space as the sequence itself. For
example:

  46  --> A--CTGC-TAGC-GATCGACT <--  62      subsequence(47,52) == CTGC-T

:param start:      the index marking the start (inclusive) of the
                   subsequence. This is a one-based index, and is in the
                   same coordinate space as this sequence object.
:param end:        the index marking the end (exclusive) of the
                   subsequence. This is a one-based index, and is in the
                   same coordinate space as this sequence object.

:return: a new sequence object that represents the subsequence of this from
         position start (indexed from 1, inclusive) to end (indexed from
         1, exclusive). Ungapped length of this will always be equal to
         end - start
:rasie SequenceError: if the coordinates given fall outside of the start
                      and end indices of this sequence object.