예제 #1
0
 def test_ear_cutting(self):
     """Test basic cutting with EarI (ambiguous overhang)."""
     self.assertFalse(EarI.is_palindromic())
     self.assertFalse(EarI.is_defined())
     self.assertTrue(EarI.is_ambiguous())
     self.assertFalse(EarI.is_unknown())
     self.assertEqual(EarI.elucidate(), 'CTCTTCN^NNN_N')
예제 #2
0
 def test_ear_cutting(self):
     """Test basic cutting with EarI (ambiguous overhang)."""
     self.assertFalse(EarI.is_palindromic())
     self.assertFalse(EarI.is_defined())
     self.assertTrue(EarI.is_ambiguous())
     self.assertFalse(EarI.is_unknown())
     self.assertEqual(EarI.elucidate(), 'CTCTTCN^NNN_N')
예제 #3
0
 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])
예제 #4
0
 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])
예제 #5
0
    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])
예제 #6
0
    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])
예제 #7
0
 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])
예제 #8
0
 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])