# Path: pygr/sequence.py
# NOT_ON_SAME_PATH = -2
# class ReadOnlyAttribute(object):
# class IntervalTransform(object):
# class LetterEdgeDescriptor(object):
# class LetterEdge(object):
# class SeqOriDescriptor(object):
# class PathForwardDescr(object):
# class AbsIntervalDescr(object):
# class SeqPath(object):
# class LengthDescriptor(object):
# class SequenceBase(SeqPath):
# class Sequence(SequenceBase):
# class SeqFilterDict(dict):
# class Seq2SeqEdge(object):
# class SeqDBDescriptor(object):
# class SeqDBSlice(SeqPath):
#     def __init__(self, attr):
#     def __get__(self, obj, klass):
#     def __init__(self, srcPath, destPath, edgeInfo=None,
#                  edgeAttr=None, edgeIndex=None):
#     def xform(self, i):
#     def xformBack(self, i):
#     def getStartStop(self, srcPath, ourPath):
#     def __call__(self, srcPath):
#     def reverse(self, destPath):
#     def __getitem__(self, srcPath): # PROVIDE DICT-LIKE INTERFACE
#     def __iter__(self):
#     def items(self):
#     def __getattr__(self, attr):
#     def repr_dict(self):
#     def nidentity(self):
#     def percent_id(self):
#     def __get__(self, edge, objtype):
#     def __init__(self, origin, target):
#     def __iter__(self):
#     def iteritems(self):
#     def __getitem__(self, k):
#     def __cmp__(self, other):
# def absoluteSlice(seq, start, stop):
# def relativeSlice(seq, start, stop):
# def sumSliceIndex(i, myslice, relativeToStart):
#     def __get__(self, seq, objtype):
#     def __get__(self, seq, objtype):
#     def __get__(self, seq, objtype):
#     def __init__(self, path, start=0, stop=None, step=None, reversePath=False,
#                  relativeToStart=False, absoluteCoords=False):
#     def classySlice(self, path, *l, **kwargs):
#     def absolute_slice(self, start, stop):
#     def __getitem__(self, k):
#     def __len__(self):
#     def __iter__(self):
#     def iteritems(self):
#     def getEdgeSeqs(self, other):
#     def getSeqPos(self, seq):
#     def __hash__(self):
#     def __cmp__(self, other):
#     def __contains__(self, k):
#     def overlaps(self, p):
#     def __mul__(self, other):
#     def __div__(self, other):
#     def __neg__(self):
#     def __add__(self, other):
#     def __iadd__(self, other):
#     def before(self):
#     def after(self):
#     def is_full_length(self):
#     def reverse_complement(self, s):
#     def seqtype(self):
#     def __str__(self):
#     def __repr__(self):
#     def repr_dict(self):
#     def __get__(self, seq, klass):
#     def __init__(self):
#     def update(self, seq):
#     def __len__(self):
#     def strslice(self, start, stop):
#     def __init__(self, s, id):
#     def __init__(self, l=[]):
#     def __getitem__(self, k):
#     def __setitem__(self, ival, junk):
#     def __iter__(self):
#     def __init__(self, msaSlice, targetPath, sourcePath=None,
#                  matchIntervals=False):
#     def items(self, mergeAll=False, **kwargs):
#     def get_gaps(self):
#     def __iter__(self, sourceOnly=True, **kwargs):
#     def length(self, mode=max):
#     def pIdentity(self, mode=max, trapOverflow=True):
#     def longestSegment(self, segment, pIdentityMin=.9, minAlignSize=1,
#                        mode=max, **kwargs):
#     def conservedSegment(self, **kwargs):
#     def pAligned(self, mode=max, trapOverflow=True):
#     def __init__(self, attr):
#     def __get__(self, obj, objtype):


import unittest
from testlib import testutil, PygrTestProgram
from pygr import sequence
        assert str(seq[-5:]) == 'caaat'
        try:
            seq[999:10000]
            raise ValueError('failed to trap out of bounds slice')
        except IndexError:
            pass
        try:
            seq[-10000:-3000]
            raise ValueError('failed to trap out of bounds slice')
        except IndexError:
            pass
        try:
            seq[1000:]
            raise ValueError('failed to trap out of bounds slice')
        except IndexError:
            pass

    def test_join(self):
        "Sequence join"
        assert str(self.seq[5:15] * self.seq[8:]) == 'atgctcc'

    def test_rcjoin(self):
        "Sequence reverse complement join"
        assert str((-(self.seq[5:10])) * ((-self.seq)[5:10])) == 'ata'

    def test_seqtype(self):
        "Sequence lenght"
        assert self.seq.seqtype() == sequence.DNA_SEQTYPE
        assert sequence.Sequence('auuugacuaugcuccag', 'foo').seqtype() == \
                         sequence.RNA_SEQTYPE

# Path: pygr/sequence.py
# NOT_ON_SAME_PATH = -2
# class ReadOnlyAttribute(object):
# class IntervalTransform(object):
# class LetterEdgeDescriptor(object):
# class LetterEdge(object):
# class SeqOriDescriptor(object):
# class PathForwardDescr(object):
# class AbsIntervalDescr(object):
# class SeqPath(object):
# class LengthDescriptor(object):
# class SequenceBase(SeqPath):
# class Sequence(SequenceBase):
# class SeqFilterDict(dict):
# class Seq2SeqEdge(object):
# class SeqDBDescriptor(object):
# class SeqDBSlice(SeqPath):
#     def __init__(self, attr):
#     def __get__(self, obj, klass):
#     def __init__(self, srcPath, destPath, edgeInfo=None,
#                  edgeAttr=None, edgeIndex=None):
#     def xform(self, i):
#     def xformBack(self, i):
#     def getStartStop(self, srcPath, ourPath):
#     def __call__(self, srcPath):
#     def reverse(self, destPath):
#     def __getitem__(self, srcPath): # PROVIDE DICT-LIKE INTERFACE
#     def __iter__(self):
#     def items(self):
#     def __getattr__(self, attr):
#     def repr_dict(self):
#     def nidentity(self):
#     def percent_id(self):
#     def __get__(self, edge, objtype):
#     def __init__(self, origin, target):
#     def __iter__(self):
#     def iteritems(self):
#     def __getitem__(self, k):
#     def __cmp__(self, other):
# def absoluteSlice(seq, start, stop):
# def relativeSlice(seq, start, stop):
# def sumSliceIndex(i, myslice, relativeToStart):
#     def __get__(self, seq, objtype):
#     def __get__(self, seq, objtype):
#     def __get__(self, seq, objtype):
#     def __init__(self, path, start=0, stop=None, step=None, reversePath=False,
#                  relativeToStart=False, absoluteCoords=False):
#     def classySlice(self, path, *l, **kwargs):
#     def absolute_slice(self, start, stop):
#     def __getitem__(self, k):
#     def __len__(self):
#     def __iter__(self):
#     def iteritems(self):
#     def getEdgeSeqs(self, other):
#     def getSeqPos(self, seq):
#     def __hash__(self):
#     def __cmp__(self, other):
#     def __contains__(self, k):
#     def overlaps(self, p):
#     def __mul__(self, other):
#     def __div__(self, other):
#     def __neg__(self):
#     def __add__(self, other):
#     def __iadd__(self, other):
#     def before(self):
#     def after(self):
#     def is_full_length(self):
#     def reverse_complement(self, s):
#     def seqtype(self):
#     def __str__(self):
#     def __repr__(self):
#     def repr_dict(self):
#     def __get__(self, seq, klass):
#     def __init__(self):
#     def update(self, seq):
#     def __len__(self):
#     def strslice(self, start, stop):
#     def __init__(self, s, id):
#     def __init__(self, l=[]):
#     def __getitem__(self, k):
#     def __setitem__(self, ival, junk):
#     def __iter__(self):
#     def __init__(self, msaSlice, targetPath, sourcePath=None,
#                  matchIntervals=False):
#     def items(self, mergeAll=False, **kwargs):
#     def get_gaps(self):
#     def __iter__(self, sourceOnly=True, **kwargs):
#     def length(self, mode=max):
#     def pIdentity(self, mode=max, trapOverflow=True):
#     def longestSegment(self, segment, pIdentityMin=.9, minAlignSize=1,
#                        mode=max, **kwargs):
#     def conservedSegment(self, **kwargs):
#     def pAligned(self, mode=max, trapOverflow=True):
#     def __init__(self, attr):
#     def __get__(self, obj, objtype):


# Path: tests/sequence_test.py
import unittest
from testlib import testutil, PygrTestProgram
from pygr import sequence

        assert str(seq[-5:]) == 'caaat'
        try:
            seq[999:10000]
            raise ValueError('failed to trap out of bounds slice')
        except IndexError:
            pass
        try:
            seq[-10000:-3000]
            raise ValueError('failed to trap out of bounds slice')
        except IndexError:
            pass
        try:
            seq[1000:]
            raise ValueError('failed to trap out of bounds slice')
        except IndexError:
            pass

    def test_join(self):
        "Sequence join"
        assert str(self.seq[5:15] * self.seq[8:]) == 'atgctcc'

    def test_rcjoin(self):
        "Sequence reverse complement join"
        assert str((-(self.seq[5:10])) * ((-self.seq)[5:10])) == 'ata'

    def test_seqtype(self):
        "Sequence lenght"
        assert self.seq.seqtype() == sequence.DNA_SEQTYPE
        assert sequence.Sequence('auuugacuaugcuccag', 'foo').seqtype() == \
                         sequence.RNA_SEQTYPE

        assert sequence.Sequence('kqwestvvarphal', 'foo').seqtype() == \