def initIntermediate(robot, settings): samples_positions_list = positionsToPurify(settings) number_of_samples = len(samples_positions_list) # Initializing sample instances intermediate_list = bl.createSamplesToPurifyList( robot, number_of_tubes=number_of_samples, start_from_position=6) return intermediate_list
def initIntermediate(self): start_from_position = self.settings.positions_2nd_stage_tubes[0] if self.cutoffs == 2: return bl.createSamplesToPurifyList( self.robot, number_of_tubes=self.number_of_samples, start_from_position=start_from_position) else: return
def test_createSamplesToPurifyList__start_from_position(self): samples_list = bl.createSamplesToPurifyList(self.ber, [30, 40, 50], start_from_position=6) self.assertEqual(samples_list[0].getVolume(), 30) self.assertEqual(samples_list[1].getVolume(), 40) self.assertEqual(samples_list[2].getVolume(), 50) self.assertEqual(samples_list[0].getWell(), (1, 6)) self.assertEqual(samples_list[1].getWell(), (1, 7)) self.assertEqual(samples_list[2].getWell(), (1, 8))
def test_createSamplesToPurifyList_generating_from_number_of_tubes(self): samples_list = bl.createSamplesToPurifyList(self.ber, number_of_tubes=3) self.assertEqual(samples_list[0].getVolume(), 0) self.assertEqual(samples_list[1].getVolume(), 0) self.assertEqual(samples_list[2].getVolume(), 0) self.assertEqual(samples_list[0].getWell(), (1, 0)) self.assertEqual(samples_list[1].getWell(), (1, 1)) self.assertEqual(samples_list[2].getWell(), (1, 2))
def test_createSamplesToPurifyList_generating_from_positions_list(self): samples_list = bl.createSamplesToPurifyList(self.ber, [30, 40, 50], [6, 7, 8]) self.assertEqual(samples_list[0].getVolume(), 30) self.assertEqual(samples_list[1].getVolume(), 40) self.assertEqual(samples_list[2].getVolume(), 50) self.assertEqual(samples_list[0].getWell(), (1, 6)) self.assertEqual(samples_list[1].getWell(), (1, 7)) self.assertEqual(samples_list[2].getWell(), (1, 8))
def test_createSamplesToPurifyList_generating_from_volume_list(self): samples_list = bl.createSamplesToPurifyList(self.ber, [30, 40, 50]) self.assertEqual(samples_list[0].getVolume(), 30) self.assertEqual(samples_list[1].getVolume(), 40) self.assertEqual(samples_list[2].getVolume(), 50) self.assertEqual(samples_list[0].getWell(), (1, 0)) self.assertEqual(samples_list[1].getWell(), (1, 1)) self.assertEqual(samples_list[2].getWell(), (1, 2))
def initSamples(robot, settings): initial_vol_list = [] # Getting list of positions at which samples are placed samples_positions_list = positionsToPurify(settings) # Obtaining initial sample volume from settings for position in samples_positions_list: volume = returnSampleParameter(settings, 'Initial sample volume', position) initial_vol_list.append(volume) # Initializing sample instances samples_list = bl.createSamplesToPurifyList(robot, initial_vol_list) return samples_list
def initSamples(self): return bl.createSamplesToPurifyList(self.robot, self.initial_sample_vol_list)