Beispiel #1
0
    def handle(self, **options):
        require_db_write_acknowledgement()

        all_wells = get_well_set()

        # Get all wells, to determine which wells are missing.
        #
        # Skip 384-well plates, since the empty wells from these Ahringer
        # parent plates can be created in concert with their 96-well children.
        #
        # Also skip 'GHR-' style plates. Since we don't actually have these
        # plates in the lab, we only care about the small fraction of the
        # wells from these plates that were used to generated our Vidal
        # rearrays.
        library_stocks = (LibraryStock.objects.filter(
            plate__number_of_wells=96).exclude(plate__id__startswith='GHR-'))

        plate_wells = {}

        for library_stock in library_stocks:
            if library_stock.plate not in plate_wells:
                plate_wells[library_stock.plate] = set()

            plate_wells[library_stock.plate].add(library_stock.well)

        for library_plate in plate_wells:
            missing_wells = all_wells - plate_wells[library_plate]

            for missing_well in missing_wells:
                library_stock = LibraryStock(
                    id=generate_library_stock_name(library_plate.id,
                                                   missing_well),
                    plate=library_plate,
                    well=missing_well,
                    parent_stock=None,
                    intended_clone=None,
                )

                if library_plate.is_ahringer_96_plate():
                    parent_stock = _get_ahringer_384_parent(library_stock)

                    if parent_stock.intended_clone:
                        self.stderr.write(
                            '384 well {} has a non-null intended clone, '
                            'but its 96-well derivative {} is empty\n'.format(
                                parent_stock, library_stock))

                    library_stock.parent_stock = parent_stock

                library_stock.save()
Beispiel #2
0
    def handle(self, **options):
        require_db_write_acknowledgement()

        all_wells = get_well_set()

        # Get all wells, to determine which wells are missing.
        #
        # Skip 384-well plates, since the empty wells from these Ahringer
        # parent plates can be created in concert with their 96-well children.
        #
        # Also skip 'GHR-' style plates. Since we don't actually have these
        # plates in the lab, we only care about the small fraction of the
        # wells from these plates that were used to generated our Vidal
        # rearrays.
        library_stocks = (LibraryStock.objects
                          .filter(plate__number_of_wells=96)
                          .exclude(plate__id__startswith='GHR-'))

        plate_wells = {}

        for library_stock in library_stocks:
            if library_stock.plate not in plate_wells:
                plate_wells[library_stock.plate] = set()

            plate_wells[library_stock.plate].add(library_stock.well)

        for library_plate in plate_wells:
            missing_wells = all_wells - plate_wells[library_plate]

            for missing_well in missing_wells:
                library_stock = LibraryStock(
                    id=generate_library_stock_name(library_plate.id,
                                                   missing_well),
                    plate=library_plate, well=missing_well,
                    parent_stock=None, intended_clone=None,
                )

                if library_plate.is_ahringer_96_plate():
                    parent_stock = _get_ahringer_384_parent(library_stock)

                    if parent_stock.intended_clone:
                        self.stderr.write(
                            '384 well {} has a non-null intended clone, '
                            'but its 96-well derivative {} is empty\n'
                            .format(parent_stock, library_stock))

                    library_stock.parent_stock = parent_stock

                library_stock.save()
Beispiel #3
0
 def setUp(self):
     self.set_96 = get_well_set(is_384=False)
     self.set_384 = get_well_set(is_384=True)
Beispiel #4
0
 def setUp(self):
     self.set_96 = get_well_set(is_384=False)
     self.set_384 = get_well_set(is_384=True)