Back to index

python-biopython  1.60
Public Member Functions
test_Restriction.RestrictionBatches Class Reference

List of all members.

Public Member Functions

def test_creating_batch
def test_batch_analysis

Detailed Description

Tests for dealing with batches of restriction enzymes.

Definition at line 72 of file test_Restriction.py.


Member Function Documentation

Sequence analysis with a restriction batch.

Definition at line 101 of file test_Restriction.py.

00101 
00102     def test_batch_analysis(self):
00103         """Sequence analysis with a restriction batch.
00104         """
00105         seq = Seq("AAAA" + EcoRV.site + "AAAA" + EcoRI.site + "AAAA",
00106                 IUPACAmbiguousDNA())
00107         batch = RestrictionBatch([EcoRV, EcoRI])
00108 
00109         hits = batch.search(seq)
00110         self.assertEqual(hits[EcoRV], [8])
00111         self.assertEqual(hits[EcoRI], [16])
00112 

Creating and modifying a restriction batch.

Definition at line 75 of file test_Restriction.py.

00075 
00076     def test_creating_batch(self):
00077         """Creating and modifying a restriction batch.
00078         """
00079         batch = RestrictionBatch([EcoRI])
00080         batch.add(KpnI)
00081         batch += EcoRV
00082         self.assertEqual(len(batch), 3)
00083 
00084         # The usual way to test batch membership
00085         self.assertTrue(EcoRV in batch)
00086         self.assertTrue(EcoRI in batch)
00087         self.assertTrue(KpnI in batch)
00088         self.assertTrue(SmaI not in batch)
00089         # Syntax sugar for the above
00090         self.assertTrue('EcoRV' in batch)
00091         self.assertFalse('SmaI' in batch)
00092 
00093         batch.get(EcoRV)
00094         self.assertRaises(ValueError, batch.get, SmaI)
00095 
00096         batch.remove(EcoRV)
00097         self.assertEqual(len(batch), 2)
00098 
00099         self.assertTrue(EcoRV not in batch)
00100         self.assertTrue('EcoRV' not in batch)


The documentation for this class was generated from the following file: