Пример #1
0
 def test_sna_cutting(self):
     """Test basic cutting with SnaI (unknown)."""
     self.assertEqual(SnaI.elucidate(), '? GTATAC ?')
     self.assertFalse(SnaI.is_defined())
     self.assertFalse(SnaI.is_ambiguous())
     self.assertTrue(SnaI.is_unknown())
     self.assertFalse(SnaI.is_comm())
     self.assertEqual(SnaI.suppliers(), None)
     self.assertEqual(SnaI.supplier_list(), [])
     with self.assertRaises(TypeError):
         SnaI.buffers('no company')
Пример #2
0
 def test_sna_cutting(self):
     """Test basic cutting with SnaI (unknown)."""
     self.assertEqual(SnaI.elucidate(), '? GTATAC ?')
     self.assertFalse(SnaI.is_defined())
     self.assertFalse(SnaI.is_ambiguous())
     self.assertTrue(SnaI.is_unknown())
     self.assertFalse(SnaI.is_comm())
     self.assertEqual(SnaI.suppliers(), None)
     self.assertEqual(SnaI.supplier_list(), [])
     with self.assertRaises(TypeError):
         SnaI.buffers('no company')
Пример #3
0
 def test_supplier(self):
     """Test output of supplier list for different enzyme types."""
     out = self.StringIO()
     self.sys.stdout = out
     EcoRI.suppliers()
     self.assertIn('Life Technologies', out.getvalue())
     self.assertEqual(SnaI.suppliers(), None)
     EcoRI.all_suppliers()  # Independent of enzyme, list of all suppliers
     self.assertIn('Agilent Technologies', out.getvalue())
     batch = EcoRI + SnaI
     batch.show_codes()
     self.assertIn('N = New England Biolabs', out.getvalue())
     self.sys.stdout = self.sys.__stdout__
Пример #4
0
 def test_supplier(self):
     """Test output of supplier list for different enzyme types."""
     out = self.StringIO()
     self.sys.stdout = out
     EcoRI.suppliers()
     self.assertIn('Life Technologies', out.getvalue())
     self.assertEqual(SnaI.suppliers(), None)
     EcoRI.all_suppliers()  # Independent of enzyme, list of all suppliers
     self.assertIn('Agilent Technologies', out.getvalue())
     batch = EcoRI + SnaI
     batch.show_codes()
     self.assertIn('N = New England Biolabs', out.getvalue())
     self.sys.stdout = self.sys.__stdout__
Пример #5
0
 def test_supplier(self):
     """Test output of supplier list for different enzyme types."""
     out = self.StringIO()
     self.sys.stdout = out
     EcoRI.suppliers()
     self.assertIn("Thermo Fisher Scientific", out.getvalue())
     self.assertIsNone(SnaI.suppliers())
     EcoRI.all_suppliers()  # Independent of enzyme, list of all suppliers
     self.assertIn("Agilent Technologies", out.getvalue())
     batch = EcoRI + SnaI
     batch.show_codes()
     self.assertIn("N = New England Biolabs", out.getvalue())
     self.sys.stdout = self.sys.__stdout__
Пример #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_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])