Exemplo n.º 1
0
 def test_primer_set_composition_attributes(self):
     obs = PrimerSetComposition(1)
     self.assertEqual(obs.container, Well(1))
     self.assertEqual(obs.total_volume, 0)
     self.assertIsNone(obs.notes)
     self.assertEqual(obs.composition_id, 1)
     self.assertEqual(obs.barcode, 'TCCCTTGTCTCC')
Exemplo n.º 2
0
 def test_primer_composition_attributes(self):
     obs = PrimerComposition(1)
     self.assertEqual(obs.container, Well(1537))
     self.assertEqual(obs.total_volume, 10)
     self.assertIsNone(obs.notes)
     self.assertEqual(obs.composition_id, 1537)
     self.assertEqual(obs.primer_set_composition, PrimerSetComposition(1))
Exemplo n.º 3
0
    def test_get_next_combos(self):
        tester = ShotgunPrimerSet(1)
        self.assertEqual(tester.current_combo_index, 384)
        with self.assertRaises(ValueError):
            tester.get_next_combos(0)

        with self.assertRaises(ValueError):
            tester.get_next_combos(150000)

        obs = tester.get_next_combos(5)
        self.assertEqual(tester.current_combo_index, 389)
        self.assertEqual(len(obs), 5)
        exp = [(PrimerSetComposition(769), PrimerSetComposition(1155)),
               (PrimerSetComposition(771), PrimerSetComposition(1157)),
               (PrimerSetComposition(773), PrimerSetComposition(1159)),
               (PrimerSetComposition(775), PrimerSetComposition(1161)),
               (PrimerSetComposition(777), PrimerSetComposition(1163))]
        self.assertEqual(obs, exp)
Exemplo n.º 4
0
    def test_get_next_combos(self):
        tester = ShotgunPrimerSet(1)
        # NOTE: 380 instead of 384 because the test sample plate contains 1
        # empty well. When the plate is collapsed 4 times into a 384-well plate
        # this results with 4 empty wells not included in library prep
        self.assertEqual(tester.current_combo_index, 380)
        with self.assertRaises(ValueError):
            tester.get_next_combos(0)

        with self.assertRaises(ValueError):
            tester.get_next_combos(150000)

        obs = tester.get_next_combos(5)
        self.assertEqual(tester.current_combo_index, 385)
        self.assertEqual(len(obs), 5)
        exp = [(PrimerSetComposition(1146), PrimerSetComposition(1530)),
               (PrimerSetComposition(1148), PrimerSetComposition(1532)),
               (PrimerSetComposition(1150), PrimerSetComposition(1534)),
               (PrimerSetComposition(1152), PrimerSetComposition(1536)),
               (PrimerSetComposition(769), PrimerSetComposition(1155))]
        self.assertEqual(obs, exp)
Exemplo n.º 5
0
 def test_composition_factory(self):
     self.assertEqual(Composition.factory(3073), ReagentComposition(1))
     self.assertEqual(Composition.factory(1537), PrimerComposition(1))
     self.assertEqual(Composition.factory(1), PrimerSetComposition(1))
     self.assertEqual(Composition.factory(3081), SampleComposition(1))
     self.assertEqual(Composition.factory(3082), GDNAComposition(1))
     self.assertEqual(Composition.factory(3083),
                      LibraryPrep16SComposition(1))
     self.assertEqual(Composition.factory(3085),
                      NormalizedGDNAComposition(1))
     self.assertEqual(Composition.factory(3086),
                      LibraryPrepShotgunComposition(1))
     self.assertEqual(Composition.factory(3078), PoolComposition(1))
Exemplo n.º 6
0
 def test_primer_composition_attributes(self):
     obs = PrimerComposition(1)
     self.assertEqual(obs.container, Well(1537))
     self.assertEqual(obs.total_volume, 10)
     self.assertIsNone(obs.notes)
     # NB: the fact that the composition id is 1538 and the well id is 1537
     # is not a mistake.  There is a placeholder composition (for "Not
     # Applicable", supporting externally extracted DNA) added in
     # db_patch_manual.sql, before populate_test_db.sql is run to create the
     # records being tested here--but that composition is "stored" in a
     # placeholder TUBE rather than a placeholder WELL, so there is no
     # analogous extra well record.
     self.assertEqual(obs.composition_id, 1538)
     self.assertEqual(obs.primer_set_composition, PrimerSetComposition(1))
     self.assertIsNone(obs.study)