コード例 #1
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])
コード例 #2
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__
コード例 #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("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__
コード例 #5
0
def find_EcoRi (DNA_sequence):
    "Find EcoRi restriction site and give position of sticky ends"
    pos=[]
    eco_start= EcoRI.search(DNA_sequence)
    for entry in eco_start:
        eco_end = entry + 4
        pos.append(entry)
        pos.append(eco_end)
    return(pos);
コード例 #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])
コード例 #8
0
    def test_eco_cutting(self):
        """Test basic cutting with EcoRI."""
        self.assertEqual(EcoRI.site, 'GAATTC')
        self.assertFalse(EcoRI.is_blunt())
        self.assertTrue(EcoRI.is_5overhang())
        self.assertFalse(EcoRI.is_3overhang())
        self.assertEqual(EcoRI.elucidate(), "G^AATT_C")
        self.assertEqual(EcoRI.search(self.ecosite_seq), [6])

        parts = EcoRI.catalyse(self.ecosite_seq)
        self.assertEqual(len(parts), 2)
        self.assertEqual(str(parts[1]), "AATTCAAAA")
        parts = EcoRI.catalyze(self.ecosite_seq)
        self.assertEqual(len(parts), 2)
コード例 #9
0
 def test_sequence_object(self):
     """Test if sequence must be a Seq or MutableSeq object."""
     with self.assertRaises(TypeError):
         seq = FormattedSeq('GATC')
     seq = FormattedSeq(Seq('TAGC'))
     seq = FormattedSeq(MutableSeq('AGTC'))
     seq = FormattedSeq(seq)
     with self.assertRaises(TypeError):
         EcoRI.search('GATC')
     EcoRI.search(Seq('ATGC'))
     EcoRI.search(MutableSeq('TCAG'))
コード例 #10
0
 def test_sequence_object(self):
     """Test if sequence must be a Seq or MutableSeq object."""
     with self.assertRaises(TypeError):
         seq = FormattedSeq('GATC')
     seq = FormattedSeq(Seq('TAGC'))
     seq = FormattedSeq(MutableSeq('AGTC'))
     seq = FormattedSeq(seq)
     with self.assertRaises(TypeError):
         EcoRI.search('GATC')
     EcoRI.search(Seq('ATGC'))
     EcoRI.search(MutableSeq('TCAG'))
コード例 #11
0
    def test_eco_cutting(self):
        """Test basic cutting with EcoRI (5'overhang)."""
        self.assertEqual(EcoRI.site, 'GAATTC')
        self.assertTrue(EcoRI.cut_once())
        self.assertFalse(EcoRI.is_blunt())
        self.assertTrue(EcoRI.is_5overhang())
        self.assertFalse(EcoRI.is_3overhang())
        self.assertEqual(EcoRI.overhang(), "5' overhang")
        self.assertTrue(EcoRI.is_defined())
        self.assertFalse(EcoRI.is_ambiguous())
        self.assertFalse(EcoRI.is_unknown())
        self.assertTrue(EcoRI.is_palindromic())
        self.assertTrue(EcoRI.is_comm())
        self.assertIn('Life Technologies', EcoRI.supplier_list())
        self.assertEqual(EcoRI.elucidate(), "G^AATT_C")
        self.assertEqual(EcoRI.search(self.ecosite_seq), [6])
        self.assertEqual(EcoRI.characteristic(), (1, -1, None, None, 'GAATTC'))

        parts = EcoRI.catalyse(self.ecosite_seq)
        self.assertEqual(len(parts), 2)
        self.assertEqual(str(parts[1]), "AATTCAAAA")
        parts = EcoRI.catalyze(self.ecosite_seq)
        self.assertEqual(len(parts), 2)
コード例 #12
0
    def test_eco_cutting(self):
        """Test basic cutting with EcoRI (5'overhang)."""
        self.assertEqual(EcoRI.site, 'GAATTC')
        self.assertTrue(EcoRI.cut_once())
        self.assertFalse(EcoRI.is_blunt())
        self.assertTrue(EcoRI.is_5overhang())
        self.assertFalse(EcoRI.is_3overhang())
        self.assertEqual(EcoRI.overhang(), "5' overhang")
        self.assertTrue(EcoRI.is_defined())
        self.assertFalse(EcoRI.is_ambiguous())
        self.assertFalse(EcoRI.is_unknown())
        self.assertTrue(EcoRI.is_palindromic())
        self.assertTrue(EcoRI.is_comm())
        self.assertIn('Life Technologies', EcoRI.supplier_list())
        self.assertEqual(EcoRI.elucidate(), "G^AATT_C")
        self.assertEqual(EcoRI.search(self.ecosite_seq), [6])
        self.assertEqual(EcoRI.characteristic(), (1, -1, None, None, 'GAATTC'))

        parts = EcoRI.catalyse(self.ecosite_seq)
        self.assertEqual(len(parts), 2)
        self.assertEqual(str(parts[1]), "AATTCAAAA")
        parts = EcoRI.catalyze(self.ecosite_seq)
        self.assertEqual(len(parts), 2)