Ejemplo n.º 1
0
 def test_barcodegroup_add(self):
     """BarcodeGroup: check adding a sequence to the group
     """
     # Add sequences to a BarcodeGroup
     grp = BarcodeGroup("CTAAGCCT",2894178)
     grp.add("CTAAGCCA",92417)
     self.assertEqual(grp.reference,"CTAAGCCT")
     self.assertEqual(grp.sequences,["CTAAGCCT","CTAAGCCA"])
     self.assertEqual(grp.counts,2986595)
     self.assertEqual(len(grp),2)
 def test_barcodegroup_add(self):
     """BarcodeGroup: check adding a sequence to the group
     """
     # Add sequences to a BarcodeGroup
     grp = BarcodeGroup("CTAAGCCT",2894178)
     grp.add("CTAAGCCA",92417)
     self.assertEqual(grp.reference,"CTAAGCCT")
     self.assertEqual(grp.sequences,["CTAAGCCT","CTAAGCCA"])
     self.assertEqual(grp.counts,2986595)
     self.assertEqual(len(grp),2)
Ejemplo n.º 3
0
 def test_barcodegroup(self):
     """BarcodeGroup: check making a new instance
     """
     # Create a new BarcodeGroup
     grp = BarcodeGroup("CTAAGCCT",2894178)
     self.assertEqual(grp.reference,"CTAAGCCT")
     self.assertEqual(grp.sequences,["CTAAGCCT"])
     self.assertEqual(grp.counts,2894178)
     self.assertEqual(len(grp),1)
Ejemplo n.º 4
0
 def test_barcodegroup_match(self):
     """BarcodeGroup: check matching sequences against the reference
     """
     # Match sequence against the group
     grp = BarcodeGroup("CTAAGCCT",2894178)
     # 1 mismatch allowed
     self.assertTrue(grp.match("CTAAGCCA",mismatches=1))
     self.assertFalse(grp.match("CGAAGCCA",mismatches=1))
     self.assertFalse(grp.match("CGATGCCA",mismatches=1))
     # Default (2 mismatches)
     self.assertTrue(grp.match("CTAAGCCA"))
     self.assertTrue(grp.match("CGAAGCCA"))
     self.assertFalse(grp.match("CGATGCCA"))
     # Differing lengths of barcode
     # -- Too short
     self.assertFalse(grp.match("CGATGCC"))
     # -- Too long
     self.assertFalse(grp.match("CGATGCCGG"))
 def test_barcodegroup_match(self):
     """BarcodeGroup: check matching sequences against the reference
     """
     # Match sequence against the group
     grp = BarcodeGroup("CTAAGCCT",2894178)
     # 1 mismatch allowed
     self.assertTrue(grp.match("CTAAGCCA",mismatches=1))
     self.assertFalse(grp.match("CGAAGCCA",mismatches=1))
     self.assertFalse(grp.match("CGATGCCA",mismatches=1))
     # Default (2 mismatches)
     self.assertTrue(grp.match("CTAAGCCA"))
     self.assertTrue(grp.match("CGAAGCCA"))
     self.assertFalse(grp.match("CGATGCCA"))
     # Differing lengths of barcode
     # -- Too short
     self.assertFalse(grp.match("CGATGCC"))
     # -- Too long
     self.assertFalse(grp.match("CGATGCCGG"))