示例#1
0
    def test_get_diluent_volume(self):

        self.assertEqual(utils.get_diluent_volume(uM(100), ul(45), uM(10)),
                         ul(5))

        self.assertEqual(utils.get_diluent_volume(uM(250), ul(120), uM(10)),
                         ul(5))
示例#2
0
    def test_total_plate_volume(self):

        plate = create_blank_plate('24-deep')

        self.assertEqual(utils.total_plate_volume(plate), ul(0))

        well = plate.well(0)

        well.volume = ul(100)

        self.assertEqual(utils.total_plate_volume(plate), ul(100))
示例#3
0
    def test_total_plate_volume(self):

        plate = create_blank_plate('24-deep')

        plate.well(0).volume = ml(10)
        plate.well(1).volume = ml(5) + ul(30)

        self.assertEqual(utils.total_plate_volume(plate, aspiratable=True),
                         ml(15))

        self.assertEqual(utils.total_plate_volume(plate, aspiratable=False),
                         ml(15) + ul(30))
示例#4
0
def main(p, params):
    assert isinstance(p, Protocol)

    dna_wells = params["dna_wells"]

    if params.get('send_to_80C', False):
        for dna_well in dna_wells:
            dna_well.container.set_storage(Temperature.cold_80.name)

    containers = set([well.container for well in dna_wells])

    assert len(containers) == 1, 'we allow wells from one container at a time'
    container = list(containers)[0]

    #Centrifuge the tube for 3-5 sec at a minimum of 3000 x g to pellet the material to the bottom of the tube.
    p.spin(container, '3000:g', '10:second')

    #Add 500uL TE (to reach 1 ng/uL)
    p.provision_by_name('te', dna_wells,
                        ul(params.get('resuspension_volume_uL', 500)))

    #Briefly vortex (here we have to use mix) and centrifuge

    p.mix(dna_wells)

    p.spin(container, '3000:g', '3:second')

    p.mix(dna_wells)

    if params.get('measure_concentration'):
        p.measure_concentration(dna_wells, 'dna_concentration', 'DNA', ul(2))

    if params.get('split_tubes'):

        #create a separate container and take half to be used for other experiments

        new_container = p.ref('%s_2' % container.name,
                              cont_type=container.container_type,
                              storage=Temperature.cold_4.name)

        for dna_well in dna_wells:

            new_dna_well = new_container.well(dna_well.index)
            new_dna_well.name = dna_well.name

            p.transfer(dna_well, new_dna_well, dna_well.volume / 2)

            for property_name in PROPERTIES_TO_COPY:
                if dna_well.properties.get(property_name):
                    set_property(new_dna_well, property_name,
                                 dna_well.properties[property_name])
示例#5
0
    def test_convert_mass_to_volume(self):
        plate = create_blank_plate('24-deep')
        dna_well = plate.well(0)
        dna_well.volume = ml(10)

        dna_well.properties['Concentration (DNA)'] = '4:nanograms/microliter'

        self.assertEqual(utils.convert_mass_to_volume(utils.ng(20), dna_well),
                         ul(5))
示例#6
0
    def test_convert_moles_to_volume(self):
        plate = create_blank_plate('24-deep')
        dna_well = plate.well(0)
        dna_well.volume = ml(10)

        dna_well.properties['Concentration (DNA)'] = '649:nanograms/microliter'
        dna_well.properties['dna_length'] = 1000

        self.assertEqual(
            utils.convert_moles_to_volume(utils.pmol(1), dna_well), ul(1))
示例#7
0
def create_blank_plate(container_shortname):
    plate = Container(str(uuid4),
                      _CONTAINER_TYPES[container_shortname],
                      name='test plate',
                      storage='cold_4',
                      cover=None)

    for well in plate.all_wells():
        well.volume = ul(0)

    return plate
示例#8
0
def main(p, params):
    assert isinstance(p, Protocol)

    #create a container

    container = p.ref(params['container_name'],
                      cont_type=params['container_type'],
                      storage=params['storage_conditions'],
                      discard=False)

    p.provision_by_name('water', container.all_wells(),
                        ul(params['volume_ul']))
示例#9
0
    def test_get_column_wells(self):

        plate1 = create_blank_plate('6-flat')

        for i in range(0, len(plate1.all_wells())):
            plate1.well(i).volume = ul(i)

        wells = utils.get_column_wells(plate1, 0).wells
        self.assertEqual(len(wells), 2)
        self.assertListEqual(wells, [plate1.well(0), plate1.well(3)])

        wells = utils.get_column_wells(plate1, 2).wells
        self.assertEqual(len(wells), 2)
        self.assertListEqual(list(wells), [plate1.well(2), plate1.well(5)])
示例#10
0
    def test_convert_stamp_shape_to_wells(self):
        plate1 = create_blank_plate('96-flat')
        plate2 = create_blank_plate('96-flat')

        for well in plate1.all_wells():
            well.volume = ul(300)

        source_wells, dest_wells = utils.convert_stamp_shape_to_wells(
            plate1.well(0), plate2.well(1), {
                'rows': 8,
                'columns': 1
            })

        self.assertListEqual(source_wells,
                             utils.get_column_wells(plate1, 0).wells)
        self.assertListEqual(dest_wells,
                             utils.get_column_wells(plate2, 1).wells)
示例#11
0
def miniprep(p, source_bacteria_well,
             antibiotic=None,
             destroy_source_tube=False,
             incubate_hours=24,
             measure_od=True,
             induce_high_copy_number=False,
             slow_growth=False
             ):
    
    cell_line_name = get_cell_line_name(source_bacteria_well)
    
    assert isinstance(p,Protocol)
    
    if not antibiotic:
        #get the antibiotic from the source well
        well_antibiotic_str = source_bacteria_well.properties.get('antibiotic')
        if well_antibiotic_str:
            antibiotic = Antibiotic.from_string(well_antibiotic_str)
        else:
            raise Exception('Source Well must have property \'antibiotic\' set if antibiotic not specified')
    
    assert isinstance(antibiotic,Antibiotic)
    
    # Tubes and plates
    growth_plate = p.ref('growth_plate', cont_type="96-deep", discard=True)
    if slow_growth:
        growth_wells = get_column_wells(growth_plate,0)
    else:
        growth_wells = [growth_plate.well(0)]
    
    
    miniprep_result_plate = p.ref('%s_miniprep'%cell_line_name, cont_type="96-pcr", storage=Temperature.cold_4)
    miniprep_result_well = miniprep_result_plate.well(0)
    
    #adding antibiotic mixes after by default
    p.add_antibiotic(growth_wells, antibiotic, broth_volume=ul(1930))    
    source_bacteria_volume = ul(50)/len(growth_wells)
    p.transfer(source_bacteria_well,growth_wells,source_bacteria_volume,mix_before=True,
               mix_after=source_bacteria_volume<=ul(10))
    
    interval_hr = 24
    
    if incubate_hours>=24:
        for t in range(0,incubate_hours/interval_hr):
            p.incubate(growth_plate, "warm_37", "{}:hour".format(interval_hr), shaking=True)
               
            if measure_od:
                p.measure_bacterial_density(growth_wells,
                                            blanking_antibiotic=antibiotic,
                                            one_tip=True)
            
    if incubate_hours%24:
        p.incubate(growth_plate, "warm_37", "{}:hour".format(incubate_hours%24), shaking=True)

        if measure_od:
            p.measure_bacterial_density(growth_wells,
                                        blanking_antibiotic=antibiotic,
                                        one_tip=True)


    if induce_high_copy_number:
        induction_wells = growth_plate.wells_from(1,len(growth_wells),columnwise=True)
    
        overnight_bacteria_volume_to_use = ul(400)
    
        p.transfer(growth_wells, induction_wells, overnight_bacteria_volume_to_use,
                   mix_before=True)
    
        #adding antibiotic mixes after by default
        p.add_antibiotic(induction_wells, antibiotic, 
                         total_volume_to_add_including_broth=ul(1998)-overnight_bacteria_volume_to_use)
    
        p.provision_by_name(Reagent.copycontrol_induction_solution, induction_wells, ul(2))

        p.incubate(growth_plate, "warm_37", "{}:hour".format(5), shaking=True)
    
        if measure_od:
            p.measure_bacterial_density(induction_wells,
                                        blanking_antibiotic=antibiotic,
                                        one_tip=True)
    
        growth_wells = induction_wells
 


    if slow_growth:

        #consolidate bacteria

        trash_wells = get_column_wells(growth_plate,11)
        
        set_name(trash_wells,'trash_well')

        p.spin(growth_plate, '4000:g', '5:minute')
        
        consolidation_well = growth_wells[0]

        trash_volumes = [get_volume(consolidation_well, aspiratable=True)]+\
            [get_volume(consolidation_well, aspiratable=True)-ul(298)]*(len(growth_wells)-1)
        p.transfer(growth_wells, trash_wells, trash_volumes)
        
        p.mix(growth_wells[1:],repetitions=20)

        p.consolidate(growth_wells[1:], consolidation_well,ul(283),allow_carryover=True,
                      mix_after=True)

        if measure_od:
            p.measure_bacterial_density(consolidation_well,
                                        blanking_antibiotic=antibiotic,
                                        one_tip=True)
  
    final_growth_well = growth_wells[0]
        
    final_growth_well.name = miniprep_result_plate.name
        
    p.miniprep(final_growth_well,miniprep_result_well)
    
    p.measure_concentration(miniprep_result_well, "dna concentration", 'DNA')
    
    if destroy_source_tube:
        
        source_bacteria_well.container.discard()
示例#12
0
 def test_ceil_volume(self):
     self.assertEqual(utils.ceil_volume(ul(0.54), 1), ul(0.6))
     self.assertEqual(utils.ceil_volume(ul(0.54)), ul(1))
     self.assertEqual(utils.ceil_volume(ul(1.0), 1), ul(1))
示例#13
0
def amplify_and_freeze_bacteria(p,
                                source_bacteria_well,
                                antibiotic=None,
                                second_antibiotic=None,
                                destroy_source_tube=False):

    cell_line_name = get_cell_line_name(source_bacteria_well)

    assert isinstance(p, Protocol)

    if not antibiotic:
        #get the antibiotic from the source well
        well_antibiotic_str = source_bacteria_well.properties.get('antibiotic')
        if well_antibiotic_str:
            antibiotic = Antibiotic.from_string(well_antibiotic_str)
        else:
            raise Exception(
                'Source Well must have property \'antibiotic\' set if antibiotic not specified'
            )

    assert isinstance(antibiotic, Antibiotic)

    assert antibiotic != second_antibiotic, "can't add the same antibiotic twice"

    # Tubes and plates
    growth_plate = p.ref('growth_plate', cont_type="96-flat", discard=True)
    growth_wells = growth_plate.wells(['A1', 'B1'])
    set_well_name(growth_wells, 'growth_well')
    control_well = growth_plate.wells(['C1'])
    control_well.name = 'blanking_well'
    mix_well = p.ref('temp_mix_tube', cont_type='micro-1.5',
                     discard=True).well(0)

    p.transfer(source_bacteria_well, mix_well, ul(25), mix_before=True)

    #adding antibiotic mixes after by default
    p.add_antibiotic(mix_well, antibiotic, broth_volume=ul(650))

    if second_antibiotic:
        p.add_antibiotic(mix_well, second_antibiotic)

    p.distribute(mix_well, growth_wells, ul(325), allow_carryover=True)

    p.cover(growth_plate)

    #grow bacteria until they are in their log phase of growth
    #https://www.qiagen.com/us/resources/technologies/plasmid-resource-center/growth%20of%20bacterial%20cultures/
    p.incubate(growth_plate, "warm_37", "{}:hour".format(16), shaking=True)

    p.add_antibiotic(control_well,
                     antibiotic,
                     broth_volume=ul(325),
                     mix_after=False)

    p.measure_bacterial_density(growth_wells + control_well,
                                one_tip=True,
                                mix_before=True)

    mix_well2 = p.ref('temp_mix_tube2', cont_type='micro-1.5',
                      discard=True).well(0)

    #add glycerol
    p.provision_by_name(Reagent.glycerol, mix_well2, ul(600))

    p.consolidate(growth_wells,
                  mix_well2,
                  get_volume(growth_wells[0], aspiratable=True),
                  mix_after=True)

    cryo_vial_wells = []
    for x in range(0, 10):
        cryo_vial_wells.append(
            p.ref("cryo_frozen_%s_cells_%s" % (cell_line_name, x),
                  cont_type="micro-1.5",
                  storage="cold_80",
                  cell_line_name=cell_line_name).well(0))

    copy_cell_line_name(source_bacteria_well, cryo_vial_wells)
    set_property(cryo_vial_wells, 'antibiotic', antibiotic.name)

    p.distribute(mix_well2, cryo_vial_wells, ul(115), allow_carryover=True)

    if destroy_source_tube:

        source_bacteria_well.container.discard()
示例#14
0
def pellet_bacteria(p, source_bacteria_well,
                    antibiotic=None,
                    destroy_source_tube=False,
                    induce_high_copy_number=False):
    
    cell_line_name = get_cell_line_name(source_bacteria_well)
    
    assert isinstance(p,Protocol)
    
    if not antibiotic:
        #get the antibiotic from the source well
        well_antibiotic_str = source_bacteria_well.properties.get('antibiotic')
        if well_antibiotic_str:
            antibiotic = Antibiotic.from_string(well_antibiotic_str)
        else:
            raise Exception('Source Well must have property \'antibiotic\' set if antibiotic not specified')
    
    assert isinstance(antibiotic,Antibiotic)
    
    # Tubes and plates
    growth_plate = p.ref('growth_plate', cont_type="96-deep", discard=True)
    
    if induce_high_copy_number:
        overnight_volume = ul(550)
        growth_wells = growth_plate.wells_from(0,3,columnwise=True)
    else:
        #only use 50% to maximize growth
        overnight_volume = ul(1000)
        growth_wells = get_column_wells(growth_plate, range(0,4))
        
    
    if destroy_source_tube:
        source_volume = get_volume(source_bacteria_well) - get_well_safe_volume(source_bacteria_well)
    else:
        source_volume = ul(50)
    
    
    #adding antibiotic mixes after by default
    p.add_antibiotic(growth_wells, antibiotic, broth_volume=overnight_volume)
    
    p.distribute(source_bacteria_well, growth_wells, round_volume(source_volume / len(growth_wells) * 1.0,2), 
                 allow_carryover=True)
    
    p.cover(growth_plate)
    
    #grow bacteria until they are in their log phase of growth
    #https://www.qiagen.com/us/resources/technologies/plasmid-resource-center/growth%20of%20bacterial%20cultures/
    p.incubate(growth_plate, "warm_37", "{}:hour".format(16), shaking=True)
    
    p.uncover(growth_plate)
    

    
    
    if induce_high_copy_number:
        induction_wells = get_column_wells(growth_plate, 1)
        
        mix_well2 =  p.ref('temp_mix_tube2', cont_type='micro-2.0',
                           discard=True).well(0)
        
        
        overnight_bacteria_volume = ul(400)
        
        p.consolidate(growth_wells,mix_well2,floor_volume(overnight_bacteria_volume / len(growth_wells)))
        
        copy_control_volume = ul(2)
        
        #adding antibiotic mixes after by default
        p.add_antibiotic(mix_well2, antibiotic, total_volume_to_add_including_broth=ml(2)-overnight_bacteria_volume-\
                         copy_control_volume)
        
        p.provision_by_name(Reagent.copycontrol_induction_solution, mix_well2, copy_control_volume)
        
        p.distribute(mix_well2, induction_wells, floor_volume(get_volume(mix_well2,aspiratable=True) / len(induction_wells)), 
                     allow_carryover=True)

        p.incubate(growth_plate, "warm_37", "{}:hour".format(5), shaking=True)
        
        p.measure_bacterial_density(induction_wells)
        
        final_growth_wells = induction_wells
        
    else:
        final_growth_wells = growth_wells
        
        top_row_well_indices = range(0,8*4,8)
        top_wells = [growth_wells[i] for i in top_row_well_indices]    
        
        non_top_wells = list(set(final_growth_wells) - set(top_wells))
            
        p.measure_bacterial_density(top_wells, one_tip=True)
        
        #spin down each column of cells
        
        p.spin(growth_plate, '4000:g', '5:minute')
        
        trash_wells = growth_plate.wells_from(4,len(non_top_wells),columnwise=True)
        
        consolidate_volume = ul(250)
        
        
        #trash supernatent except consolidate_volume in non top row wells
        
        p.transfer(non_top_wells, trash_wells, get_volume(non_top_wells[0],aspiratable=True)-consolidate_volume,
                   one_tip=True)
        
        
        #trash all volume in the top row wells
        
        trash_wells = growth_plate.wells_from(8,4,columnwise=True)
        p.transfer(top_wells, trash_wells, get_volume(top_wells[0],aspiratable=True),
                   one_tip=True)     
        
        #break up pellet in all wells
        p.mix(non_top_wells, repetitions=20, one_tip=True)
        
        #consolidate into the top row
        for top_well in top_wells:
            non_top_wells = set(growth_plate.wells_from(top_well.index,8,columnwise=True))
            non_top_wells.remove(top_well)
            non_top_wells = list(non_top_wells)
            
            p.consolidate(non_top_wells, top_well, consolidate_volume)
            
        #spin down again and trash all but dead_volume+250ul
        p.spin(growth_plate, '4000:g', '5:minute')
        trash_wells = growth_plate.wells_from(9,4,columnwise=True)
        p.transfer(top_wells, trash_wells, get_volume(growth_wells[0],aspiratable=True)-consolidate_volume*2,
                   one_tip=True)        
    
        #break up the pellet created by spinning
        p.mix(top_wells, repetitions=20, one_tip=True)
        
        final_growth_wells = top_wells
   
    pellet_well = p.ref("pelleted_%s_cells"%(cell_line_name), 
                        cont_type="micro-2.0", 
                        storage="cold_80",
                        cell_line_name=cell_line_name).well(0)
        
    copy_cell_line_name(source_bacteria_well, pellet_well)
    
    p.consolidate(final_growth_wells, pellet_well, get_volume(final_growth_wells[0],aspiratable=True), 
                  allow_carryover=True)
    
    p.measure_bacterial_density(pellet_well)
    
    p.spin(pellet_well.container, '4000:g', '10:minute')
    
    trash_well = p.ref('trash_tube', cont_type='micro-2.0',
                       discard=True).well(0)    
    
    
    #keep ul(25) to make the safe volume
    p.transfer(pellet_well, trash_well, pellet_well.volume-ul(25), one_source=True, one_tip=True)
    p.provision_by_name(Reagent.glycerol, pellet_well, ul(15),mix_after=True)

    #remove max (this means the remaining volume is 20% glycerol)
    p.transfer(pellet_well, trash_well, get_volume(pellet_well,aspiratable=True), one_source=True, one_tip=True)
    
    if destroy_source_tube:
        
        source_bacteria_well.container.discard()
示例#15
0
 def test_round_volume(self):
     self.assertEqual(utils.round_volume(ul(0.54), 1), ul(0.5))
示例#16
0
    def test_floor_volume(self):
        self.assertEqual(utils.floor_volume(ul(12.8)), ul(12))

        self.assertEqual(utils.floor_volume(ul(12.2)), ul(12))

        self.assertEqual(utils.floor_volume(ul(12)), ul(12))
示例#17
0
    def test_calculate_dilution_volume(self):

        self.assertEqual(
            utils.calculate_dilution_volume(utils.mM(100), utils.uM(500),
                                            ul(440)), ul(2.2))