def test_cutting_border_positions(self): """Check if cutting after first and penultimate position works.""" # Use EarI, cuts as follows: CTCTTCN^NNN_N seq = Seq('CTCTTCA') self.assertEqual(EarI.search(seq), []) seq += 'A' self.assertEqual(EarI.search(seq), [8]) # Recognition site on reverse-complement strand seq = Seq('AAAAGAAGAG') self.assertEqual(EarI.search(seq), []) seq = 'A' + seq self.assertEqual(EarI.search(seq), [2])
def test_circular_sequences(self): """Deal with cutting circular sequences.""" parts = EcoRI.catalyse(self.ecosite_seq, linear=False) self.assertEqual(len(parts), 1) locations = EcoRI.search(parts[0], linear=False) self.assertEqual(locations, [1]) parts = KpnI.catalyse(self.kpnsite_seq, linear=False) self.assertEqual(len(parts), 1) locations = KpnI.search(parts[0], linear=False) self.assertEqual(locations, [1]) parts = SmaI.catalyse(self.smasite_seq, linear=False) self.assertEqual(len(parts), 1) locations = SmaI.search(parts[0], linear=False) self.assertEqual(locations, [1]) self.assertEqual( EarI.search(FormattedSeq(Seq('CTCTTCAAAAA')), linear=False), [8]) self.assertEqual( SnaI.search(FormattedSeq(Seq('GTATACAAAAA')), linear=False), [1])
def test_circular_sequences(self): """Deal with cutting circular sequences.""" parts = EcoRI.catalyse(self.ecosite_seq, linear=False) self.assertEqual(len(parts), 1) locations = EcoRI.search(parts[0], linear=False) self.assertEqual(locations, [1]) parts = KpnI.catalyse(self.kpnsite_seq, linear=False) self.assertEqual(len(parts), 1) locations = KpnI.search(parts[0], linear=False) self.assertEqual(locations, [1]) parts = SmaI.catalyse(self.smasite_seq, linear=False) self.assertEqual(len(parts), 1) locations = SmaI.search(parts[0], linear=False) self.assertEqual(locations, [1]) self.assertEqual(EarI.search(FormattedSeq(Seq('CTCTTCAAAAA')), linear=False), [8]) self.assertEqual(SnaI.search(FormattedSeq(Seq('GTATACAAAAA')), linear=False), [1])
def test_recognition_site_on_both_strands(self): """Check if recognition sites on both strands are properly handled.""" seq = Seq('CTCTTCGAAGAG') self.assertEqual(EarI.search(seq), [3, 8])