Exemplo n.º 1
0
    def testAdd(self):

        # strict
        self.assertRaises(sequence.SequenceError, self.ali.add,
                          sequence.Sequence('sn', 'sn', 'TOO-LONG-SEQ'))
        self.assertRaises(sequence.DuplicateSequenceError, self.ali.add,
                          sequence.Sequence('s1', 's1', 'AB-CD'))
Exemplo n.º 2
0
    def setUp(self):

        super(TestSequenceCollection, self).setUp()

        s1 = sequence.Sequence('id1', '>id1 desc', 'AB-CD',
                               sequence.SequenceTypes.Protein)
        s2 = sequence.Sequence('id2', '>id2 desc', 'ABCDE',
                               sequence.SequenceTypes.Protein)

        self.collection = sequence.SequenceCollection([s1, s2])
        self.data = '>id1 desc\nAB-CD\n>id2 desc\nABCDE'
Exemplo n.º 3
0
    def setUp(self):

        super(TestSequence, self).setUp()

        self.data = '>id desc\nAB-CD'
        self.sequence = sequence.Sequence('id', '>id desc', 'AB-CD',
                                          sequence.SequenceTypes.Protein)
        assert str(self.sequence) == self.data
Exemplo n.º 4
0
    def setUp(self):

        super(TestSequenceAlignment, self).setUp()

        seq1 = sequence.Sequence('s1', 's1 desc1', 'AB-CD',
                                 sequence.SequenceTypes.Protein)
        seq2 = sequence.RichSequence('s2', 's2 desc2', list('ABX-D'),
                                     sequence.SequenceTypes.Protein)

        self.ali = self._factory([seq1, seq2])
        self.ali2 = self._factory([seq1, seq2, seq2, seq2], strict=False)
Exemplo n.º 5
0
    def testFromSequence(self):

        seq = sequence.Sequence('testA',
                                'test seq',
                                'ABCDE',
                                type=sequence.SequenceTypes.Protein)
        chain = structure.Chain.from_sequence(seq, 'Z')

        self.assertEqual(chain.sequence, 'ABCDE')
        self.assertEqual(chain.id, 'Z')
        self.assertEqual(chain.residues[2].sequence_number, 2)
        self.assertEqual(chain.residues[2].rank, 2)
        self.assertEqual(chain.residues[2].type, sequence.ProteinAlphabet.ASX)