def testViewsFromSequences_03(self): seq_a = seq.CreateSequence("A", "ABCD--GH") seq_a.AttachView(self.ent.Select('rname=A,B,C,D,G,H')) seq_b = seq.CreateSequence("B", "ABCD-FGH") seq_b.AttachView(self.ent.Select('rname=A,B,C,D,F,G,H')) a, b = seq.ViewsFromSequences(seq_a, seq_b) string_a = ''.join([r.one_letter_code for r in a.residues]) string_b = ''.join([r.one_letter_code for r in b.residues]) self.assertEqual(string_a, 'ABCDGH') self.assertEqual(string_b, 'ABCDGH')
def testViewsFromSequences_08(self): seq_a = seq.CreateSequence("A", "A-C-E-G") seq_a.AttachView(self.ent.Select('rname=A,C,E,G')) seq_b = seq.CreateSequence("B", "-B-D-H-") seq_b.AttachView(self.ent.Select('rname=B,D,H')) a, b = seq.ViewsFromSequences(seq_a, seq_b) string_a = ''.join([r.one_letter_code for r in a.residues]) string_b = ''.join([r.one_letter_code for r in b.residues]) self.assertEqual(string_a, '') self.assertEqual(string_b, '')
def testViewsFromSequences_09(self): seq_a = seq.CreateSequence("A", "B-D-FGH") seq_a.AttachView(self.ent.Select('rname=A,B,D,F,G,H')) seq_a.offset = 1 seq_b = seq.CreateSequence("B", "B-DEF-H") seq_b.offset = 1 seq_b.AttachView(self.ent.Select('rname=A,B,D,E,F,H')) a, b = seq.ViewsFromSequences(seq_a, seq_b) string_a = ''.join([r.one_letter_code for r in a.residues]) string_b = ''.join([r.one_letter_code for r in b.residues]) self.assertEqual(string_a, 'BDFH') self.assertEqual(string_b, 'BDFH')