Example #1
0
 def __create_pipetting_worklist_stream(self, resource):
     entity = resource.get_entity()
     try:
         tool = lab.get_worklist_writer(entity=entity)
     except TypeError as te:
         raise HTTPBadRequest(str(te))
     return run_tool(tool)
Example #2
0
File: iso.py Project: papagr/TheLMA
 def __pipetting_iso_or_iso_job(self, iso_or_iso_job):
     user = get_current_user()
     executor = get_worklist_executor(iso_or_iso_job, user)
     result = run_tool(executor, error_prefix='Errors during pipetting. --')
     trac_updater = LabIsoStockTransferReporter(executor=executor)
     run_trac_tool(trac_updater)
     return result
Example #3
0
 def __pipetting_iso_or_iso_job(self, iso_or_iso_job):
     user = get_current_user()
     executor = get_worklist_executor(iso_or_iso_job, user)
     result = run_tool(executor,
                       error_prefix='Errors during pipetting. --')
     trac_updater = LabIsoStockTransferReporter(executor=executor)
     run_trac_tool(trac_updater)
     return result
Example #4
0
    def __create_xl20_worklist_stream(self, resource, options):
        entity = resource.get_entity()
#        self._prepare_for_xl20_worklist_creation(entity)
        try:
            tool = lab.get_stock_rack_assembler(entity=entity,
                                                **options)
        except TypeError as te:
            raise HTTPBadRequest(str(te))
        return run_tool(tool)
Example #5
0
 def _run(self, resource, options):
     if options['type'] == 'ALL_WITH_ROBOT':
         tool = resource.experiment_job.get_writer()
     elif options['type'] == 'ROBOT':
         try:
             tool = resource.get_writer()
         except TypeError as te:
             raise HTTPBadRequest(str(te)).exception
     return run_tool(tool)
Example #6
0
 def create_xl20_worklist(self, entity, rack_barcodes,
                          optimizer_excluded_racks=None,
                          optimizer_requested_tubes=None,
                          include_dummy_output=False):
     assembler = lab.get_stock_rack_assembler(
                             entity=entity,
                             rack_barcodes=rack_barcodes,
                             excluded_racks=optimizer_excluded_racks,
                             requested_tubes=optimizer_requested_tubes,
                             include_dummy_output=include_dummy_output)
     return run_tool(assembler)
Example #7
0
 def __extract_from_xls(self, request_body):
     if len(request_body) == 0:
         raise HTTPBadRequest("Request's body is empty!")
     experiment_metadata = self.context.get_entity()
     user = get_current_user()
     generator = ExperimentMetadataGenerator.create(
                                 stream=request_body,
                                 experiment_metadata=experiment_metadata,
                                 requester=user)
     new_entity = run_tool(generator)
     # Store this for later.
     self.__generator = generator
     return new_entity
Example #8
0
File: iso.py Project: papagr/TheLMA
 def create_xl20_worklist(self,
                          entity,
                          rack_barcodes,
                          optimizer_excluded_racks=None,
                          optimizer_requested_tubes=None,
                          include_dummy_output=False):
     assembler = lab.get_stock_rack_assembler(
         entity=entity,
         rack_barcodes=rack_barcodes,
         excluded_racks=optimizer_excluded_racks,
         requested_tubes=optimizer_requested_tubes,
         include_dummy_output=include_dummy_output)
     return run_tool(assembler)
Example #9
0
File: iso.py Project: papagr/TheLMA
 def __generate_isos(self, number_of_new_isos, optimizer_excluded_racks,
                     optimizer_requested_tubes, requested_library_plates):
     if not optimizer_excluded_racks is None:
         optimizer_excluded_racks = optimizer_excluded_racks.split(',')
     if not optimizer_requested_tubes is None:
         optimizer_requested_tubes = optimizer_requested_tubes.split(',')
     if not requested_library_plates is None:
         requested_library_plates = requested_library_plates.split(',')
     iso_request = self.get_entity()
     user = get_current_user()
     if iso_request.iso_type == ISO_TYPES.LAB:
         creator = \
             get_job_creator(iso_request,
                             user,
                             number_of_new_isos,
                             excluded_racks=optimizer_excluded_racks,
                             requested_tubes=optimizer_requested_tubes,
                             requested_library_plates=
                                                 requested_library_plates)
     else:
         raise NotImplementedError('POOL CREATION ISOs not implemented.')
     return run_tool(creator)
Example #10
0
 def __generate_isos(self, number_of_new_isos,
                     optimizer_excluded_racks, optimizer_requested_tubes,
                     requested_library_plates):
     if not optimizer_excluded_racks is None:
         optimizer_excluded_racks = optimizer_excluded_racks.split(',')
     if not optimizer_requested_tubes is None:
         optimizer_requested_tubes = optimizer_requested_tubes.split(',')
     if not requested_library_plates is None:
         requested_library_plates = requested_library_plates.split(',')
     iso_request = self.get_entity()
     user = get_current_user()
     if iso_request.iso_type == ISO_TYPES.LAB:
         creator = \
             get_job_creator(iso_request,
                             user,
                             number_of_new_isos,
                             excluded_racks=optimizer_excluded_racks,
                             requested_tubes=optimizer_requested_tubes,
                             requested_library_plates=
                                                 requested_library_plates)
     else:
         raise NotImplementedError('POOL CREATION ISOs not implemented.')
     return run_tool(creator)
Example #11
0
 def __update_stock_racks(self, iso_or_iso_job, status):
     stock_rack_barcodes = status[len('UPDATE_STOCK_RACKS'):].split(';')
     recycler = get_stock_rack_recyler(iso_or_iso_job, stock_rack_barcodes)
     return run_tool(recycler,
                     error_prefix='Invalid stock rack(s)! --')
Example #12
0
 def create_pipetting_worklist(self):
     writer = lab.get_worklist_writer(self.get_entity())
     return run_tool(writer)
Example #13
0
File: iso.py Project: papagr/TheLMA
 def __update_stock_racks(self, iso_or_iso_job, status):
     stock_rack_barcodes = status[len('UPDATE_STOCK_RACKS'):].split(';')
     recycler = get_stock_rack_recyler(iso_or_iso_job, stock_rack_barcodes)
     return run_tool(recycler, error_prefix='Invalid stock rack(s)! --')
Example #14
0
File: iso.py Project: papagr/TheLMA
 def create_pipetting_worklist(self):
     writer = lab.get_worklist_writer(self.get_entity())
     return run_tool(writer)