def preProcess(self, _edObject=None):
        EDPluginControl.preProcess(self)
        self.DEBUG("EDPluginControlXscaleGenerate.preProcess")
        # Load the execution plugin
        self.xscale_anom_merged = self.loadPlugin("EDPluginExecXscale")
        anom_merged_in = XSDataXscaleInput.copyViaDict()
        anom_merged_in.friedels_law = XSDataBoolean(True)
        anom_merged_in.merge = XSDataBoolean(True)
        self.xscale_anom_merged.dataInput = anom_merged_in
        self.xscale_anom_merged.connectSUCCESS(self.xscale_success)
        self.xscale_anom_merged.connectFAILURE(self.xscale_failure)

        self.xscale_anom_unmerged = self.loadPlugin("EDPluginExecXscale")
        anom_unmerged_in = XSDataXscaleInput.copyViaDict()
        anom_unmerged_in.friedels_law = XSDataBoolean(True)
        anom_unmerged_in.merge = XSDataBoolean(False)
        self.xscale_anom_unmerged.dataInput = anom_unmerged_in
        self.xscale_anom_unmerged.connectSUCCESS(self.xscale_success)
        self.xscale_anom_unmerged.connectFAILURE(self.xscale_failure)

        self.xscale_noanom_merged = self.loadPlugin("EDPluginExecXscale")
        noanom_merged_in = XSDataXscaleInput.copyViaDict()
        noanom_merged_in.friedels_law = XSDataBoolean(False)
        noanom_merged_in.merge = XSDataBoolean(True)
        self.xscale_noanom_merged.dataInput = noanom_merged_in
        self.xscale_noanom_merged.connectSUCCESS(self.xscale_success)
        self.xscale_noanom_merged.connectFAILURE(self.xscale_failure)

        self.xscale_noanom_unmerged = self.loadPlugin("EDPluginExecXscale")
        noanom_unmerged_in = XSDataXscaleInput.copyViaDict()
        noanom_unmerged_in.friedels_law = XSDataBoolean(False)
        noanom_unmerged_in.merge = XSDataBoolean(False)
        self.xscale_noanom_unmerged.dataInput = noanom_unmerged_in
        self.xscale_noanom_unmerged.connectSUCCESS(self.xscale_success)
        self.xscale_noanom_unmerged.connectFAILURE(self.xscale_failure)
Example #2
0
    def preProcess(self, _edObject=None):
        EDPluginControl.preProcess(self)
        self.DEBUG("EDPluginControlXscaleGenerate.preProcess")
        # Load the execution plugin
        self.xscale_anom_merged = self.loadPlugin("EDPluginExecXscale")
        anom_merged_in = XSDataXscaleInput.copyViaDict()
        anom_merged_in.friedels_law = XSDataBoolean(True)
        anom_merged_in.merge = XSDataBoolean(True)
        self.xscale_anom_merged.dataInput = anom_merged_in
        self.xscale_anom_merged.connectSUCCESS(self.xscale_success)
        self.xscale_anom_merged.connectFAILURE(self.xscale_failure)

        self.xscale_anom_unmerged = self.loadPlugin("EDPluginExecXscale")
        anom_unmerged_in = XSDataXscaleInput.copyViaDict()
        anom_unmerged_in.friedels_law = XSDataBoolean(True)
        anom_unmerged_in.merge = XSDataBoolean(False)
        self.xscale_anom_unmerged.dataInput = anom_unmerged_in
        self.xscale_anom_unmerged.connectSUCCESS(self.xscale_success)
        self.xscale_anom_unmerged.connectFAILURE(self.xscale_failure)

        self.xscale_noanom_merged = self.loadPlugin("EDPluginExecXscale")
        noanom_merged_in = XSDataXscaleInput.copyViaDict()
        noanom_merged_in.friedels_law = XSDataBoolean(False)
        noanom_merged_in.merge = XSDataBoolean(True)
        self.xscale_noanom_merged.dataInput = noanom_merged_in
        self.xscale_noanom_merged.connectSUCCESS(self.xscale_success)
        self.xscale_noanom_merged.connectFAILURE(self.xscale_failure)

        self.xscale_noanom_unmerged = self.loadPlugin("EDPluginExecXscale")
        noanom_unmerged_in = XSDataXscaleInput.copyViaDict()
        noanom_unmerged_in.friedels_law = XSDataBoolean(False)
        noanom_unmerged_in.merge = XSDataBoolean(False)
        self.xscale_noanom_unmerged.dataInput = noanom_unmerged_in
        self.xscale_noanom_unmerged.connectSUCCESS(self.xscale_success)
        self.xscale_noanom_unmerged.connectFAILURE(self.xscale_failure)
Example #3
0
    def process(self, _edObject = None):
        EDPluginControl.process(self)
        self.DEBUG("EDPluginControlAutoproc.process")

        # first XDS plugin run with supplied XDS file
        EDVerbose.screen("First XDS run...")
        self.xds_first.executeSynchronous()
        if self.xds_first.isFailure():
            EDVerbose.ERROR('first XDS run failed')
            self.setFailure()
            return
        EDVerbose.screen("First XDS run successfully completed")

        # apply the first res cutoff with the res extracted from the first XDS run
        EDVerbose.screen("First resolution cutoff")
        xdsresult = self.xds_first.dataOutput
        res_cutoff_in = XSDataResCutoff()
        res_cutoff_in.xds_res = xdsresult
        res_cutoff_in.completeness_entries = xdsresult.completeness_entries

        #XXX: remove from the data model as it is just pass-through?
        res_cutoff_in.total_completeness = xdsresult.total_completeness

        self.first_res_cutoff.dataInput = res_cutoff_in
        self.first_res_cutoff.executeSynchronous()
        if self.first_res_cutoff.isFailure():
            EDVerbose.ERROR("res cutoff failed")
            self.setFailure()
            return
        EDVerbose.screen("First resolution cutoff successfully completed")
        resolution = self.first_res_cutoff.dataOutput.res

        # for the generate w/ and w/out anom we have to specify where
        # the first XDS plugin run took place
        xds_run_directory = os.path.abspath(self.xds_first.dataOutput.xds_run_directory.value)
        EDVerbose.screen("the xds run took place in {}".format(xds_run_directory))
        generate_input = XSDataXdsGenerateInput()
        generate_input.resolution = resolution
        generate_input.previous_run_dir = XSDataString(xds_run_directory)
        self.generate.dataInput = generate_input

        self.generate.executeSynchronous()

        if self.generate.isFailure():
            EDVerbose.ERROR('generating w/ and w/out anom failed')
            self.setFailure()
            return

        # we can now use the xds output parser on the two correct.lp
        # files, w/ and w/out anom
        parse_anom_input = XSDataXdsOutputFile()
        parse_anom_input.correct_lp = XSDataFile()
        parse_anom_input.correct_lp.path = self.generate.dataOutput.correct_lp_anom

        self.parse_xds_anom.dataInput = parse_anom_input
        self.parse_xds_anom.executeSynchronous()

        if self.parse_xds_anom.isFailure():
            EDVerbose.ERROR('parsing the xds generated w/ anom failed')
            self.setFailure()
            return

        # now the other one w/out anom
        parse_noanom_input = XSDataXdsOutputFile()
        parse_noanom_input.correct_lp = XSDataFile()
        parse_noanom_input.correct_lp.path = self.generate.dataOutput.correct_lp_no_anom

        self.parse_xds_noanom.dataInput = parse_noanom_input
        self.parse_xds_noanom.executeSynchronous()

        if self.parse_xds_noanom.isFailure():
            EDVerbose.ERROR('parsing the xds generated w/ anom failed')
            self.setFailure()
            return

        # we now can apply the res cutoff on the anom and no anom
        # outputs. Note that this is not done in parallel, like the
        # xds parsing

        # XXX completeness_cutoff/res_override and isig_cutoff still
        # missing
        res_cutoff_anom_in = XSDataResCutoff()
        res_cutoff_anom_in.xds_res = self.parse_xds_anom.dataOutput
        self.res_cutoff_anom.dataInput = res_cutoff_anom_in

        self.res_cutoff_anom.executeSynchronous()
        if self.res_cutoff_anom.isFailure():
            EDVerbose.ERROR('res cutoff for anom data failed')

        # same for non anom
        res_cutoff_noanom_in = XSDataResCutoff()
        res_cutoff_noanom_in.xds_res = self.parse_xds_noanom.dataOutput
        self.res_cutoff_noanom.dataInput = res_cutoff_noanom_in

        self.res_cutoff_noanom.executeSynchronous()
        if self.res_cutoff_noanom.isFailure():
            EDVerbose.ERROR('res cutoff for non anom data failed')

        # now we just have to run XScale to generate w/ and w/out
        # anom, merged and unmerged

        # We use another control plugin for that to isolate the whole thing

#        if not self.res_cutoff_anom.isFailure():
        xscale_anom_in = XSDataXscaleInput()

        input_file = XSDataXscaleInputFile()
        input_file.path = self.generate.dataOutput.hkl_anom
        input_file.res = self.res_cutoff_anom.dataOutput.res

        xscale_anom_in.xds_files = [input_file]
        xscale_anom_in.unit_cell_constants = self.parse_xds_anom.dataOutput.unit_cell_constants
        xscale_anom_in.sg_number = self.parse_xds_anom.dataOutput.sg_number
        xscale_anom_in.bins = self.res_cutoff_anom.bins

        self.xscale_anom.dataInput = xscale_anom_in
        self.xscale_anom.executeSynchronous()

        if self.xscale_anom.isFailure():
            EDVerbose.ERROR('xscale anom/merge generation failed')

        # same for non anom code path

        #if not self.res_cutoff_noanom.isFailure():
        xscale_noanom_in = XSDataXscaleInput()

        input_file = XSDataXscaleInputFile()
        input_file.path = self.generate.dataOuput.hkl_anom
        input_file.res = self.res_cutoff_anom.dataOutput.res

        xscale_noanom_in.xds_files = [input_file]
        xscale_noanom_in.unit_cell_constants = self.parse_xds_noanom.dataOutput.unit_cell_constants
        xscale_noanom_in.sg_number = self.parse_xds_noanom.dataOutput.sg_number
        xscale_noanom_in.bins = self.res_cutoff_noanom.bins

        self.xscale_noanom.dataInput = xscale_noanom_in
        self.xscale_noanom.executeSynchronous()

        if self.xscale_noanom.isFailure():
            EDVerbose.ERROR('xscale anom/merge generation failed')
                         'noanom resolution cutoffs failed in {0}s'.format(self.stats['res_cutoff_anom'] + self.stats['res_cutoff_noanom']))
            return
        else:
            self.screen('FINISHED noanom res cutoff')
            log_to_ispyb(self.integration_id_noanom,
                         'Scaling',
                         'Successful',
                         'noanom resolution cutoffs finished in {0}s'.format(self.stats['res_cutoff_anom'] + self.stats['res_cutoff_noanom']))



        # now we just have to run XScale to generate w/ and w/out
        # anom, merged and unmerged

        # We use another control plugin for that to isolate the whole thing
        xscale_generate_in = XSDataXscaleInput()

        input_file = XSDataXscaleInputFile()
        input_file.path_anom = self.generate.dataOutput.hkl_anom
        input_file.path_noanom = self.generate.dataOutput.hkl_no_anom
        input_file.res = self.res_cutoff_anom.dataOutput.res

        xscale_generate_in.xds_files = [input_file]
        xscale_generate_in.unit_cell_constants = self.parse_xds_anom.dataOutput.unit_cell_constants
        xscale_generate_in.sg_number = self.parse_xds_anom.dataOutput.sg_number
        xscale_generate_in.bins = self.res_cutoff_anom.dataOutput.bins


        self.xscale_generate.dataInput = xscale_generate_in
        self.DEBUG('STARTING xscale generation')
        log_to_ispyb([self.integration_id_anom, self.integration_id_noanom],
Example #5
0
                    self.stats['res_cutoff_anom'] +
                    self.stats['res_cutoff_noanom']))
            return
        else:
            self.screen('FINISHED noanom res cutoff')
            log_to_ispyb(
                self.integration_id_noanom, 'Scaling', 'Successful',
                'noanom resolution cutoffs finished in {0}s'.format(
                    self.stats['res_cutoff_anom'] +
                    self.stats['res_cutoff_noanom']))

        # now we just have to run XScale to generate w/ and w/out
        # anom, merged and unmerged

        # We use another control plugin for that to isolate the whole thing
        xscale_generate_in = XSDataXscaleInput()

        input_file = XSDataXscaleInputFile()
        input_file.path_anom = self.generate.dataOutput.hkl_anom
        input_file.path_noanom = self.generate.dataOutput.hkl_no_anom
        input_file.res = self.res_cutoff_anom.dataOutput.res

        xscale_generate_in.xds_files = [input_file]
        xscale_generate_in.unit_cell_constants = self.parse_xds_anom.dataOutput.unit_cell_constants
        xscale_generate_in.sg_number = self.parse_xds_anom.dataOutput.sg_number
        xscale_generate_in.bins = self.res_cutoff_anom.dataOutput.bins

        self.xscale_generate.dataInput = xscale_generate_in
        self.DEBUG('STARTING xscale generation')
        log_to_ispyb([self.integration_id_anom, self.integration_id_noanom],
                     'Scaling', 'Launched', 'start of xscale generation')