Пример #1
0
    def sync_primary_row(legacy_row):
        plate_name = legacy_row[0]
        well = get_three_character_well(legacy_row[1])
        clone_name = legacy_row[2]
        parent_plate_name = legacy_row[4]

        if re.match('sjj', clone_name):
            parent_chromosome = legacy_row[3]
            parent_plate_name = generate_ahringer_384_plate_name(
                parent_chromosome, parent_plate_name)
        parent_well_improper = legacy_row[5]
        if re.match('mv', clone_name):
            clone_name = generate_vidal_clone_name(parent_plate_name,
                                                   parent_well_improper)

        intended_clone = get_clone(clone_name)

        if re.match('L4440', clone_name):
            parent_stock = None

        else:
            parent_well_proper = get_three_character_well(parent_well_improper)
            parent_stock = get_library_stock(parent_plate_name,
                                             parent_well_proper)

            # Confirm that this intended clone matches parent's clone
            if parent_stock.intended_clone != intended_clone:
                raise CommandError('Clone {} does not match parent\n'
                                   .format(clone_name))

        new_well = LibraryStock(
            id=generate_library_stock_name(plate_name, well),
            plate=get_library_plate(plate_name), well=well,
            parent_stock=parent_stock,
            intended_clone=intended_clone)

        return update_or_save_object(command, new_well, recorded_wells,
                                     fields_to_compare)
Пример #2
0
    def sync_source_row(legacy_row):
        plate_name = legacy_row[0]
        clone_name = legacy_row[3]

        if re.match('sjj', clone_name):
            chromosome = legacy_row[2]
            plate_name = generate_ahringer_384_plate_name(
                chromosome, plate_name)

        well_improper = legacy_row[1]
        well_proper = get_three_character_well(well_improper)

        if re.match('mv', clone_name):
            clone_name = generate_vidal_clone_name(plate_name,
                                                   well_improper)

        new_well = LibraryStock(
            id=generate_library_stock_name(plate_name, well_proper),
            plate=get_library_plate(plate_name), well=well_proper,
            parent_stock=None, intended_clone=get_clone(clone_name))

        return update_or_save_object(command, new_well, recorded_wells,
                                     fields_to_compare)
Пример #3
0
 def sync_clone_row_vidal(legacy_row):
     vidal_clone_name = generate_vidal_clone_name(legacy_row[0],
                                                  legacy_row[1])
     new_clone = Clone(id=vidal_clone_name)
     return update_or_save_object(command, new_clone, recorded_clones,
                                  fields_to_compare)