def parsePointlessOutput(self, _outputFile): sgre = re.compile( """ \* Space group = '(?P<sgstr>.*)' \(number\s+(?P<sgnumber>\d+)\)""" ) sgnumber = sgstr = None res = XSDataPointlessOut() status = XSDataStatus() status.isSuccess = XSDataBoolean(False) if os.path.exists(_outputFile): res.status = status strLog = EDUtilsFile.readFile(_outputFile) if strLog is not None: # we'll apply the regexp to the whole file contents which # hopefully won't be that long. m = sgre.search(strLog) if m is not None: d = m.groupdict() sgnumber = d['sgnumber'] sgstr = d['sgstr'] res.sgnumber = XSDataInteger(sgnumber) res.sgstr = XSDataString(sgstr) status.isSuccess = XSDataBoolean(True) # Search first for unit cell after the Laue group... unitCellRe = re.compile( """ Laue group confidence.+\\n\\n\s+Unit cell:(.+)""") m2 = unitCellRe.search(strLog) if m2 is None: # Then search it from the end... unitCellRe = re.compile( """ \* Cell Dimensions : \(obsolete \- refer to dataset cell dimensions above\)\\n\\n(.+)""" ) m2 = unitCellRe.search(strLog) if m2 is not None: listCell = m2.groups()[0].split() xsDataCCP4Cell = XSDataCCP4Cell() xsDataCCP4Cell.length_a = XSDataLength(listCell[0]) xsDataCCP4Cell.length_b = XSDataLength(listCell[1]) xsDataCCP4Cell.length_c = XSDataLength(listCell[2]) xsDataCCP4Cell.angle_alpha = XSDataAngle(listCell[3]) xsDataCCP4Cell.angle_beta = XSDataAngle(listCell[4]) xsDataCCP4Cell.angle_gamma = XSDataAngle(listCell[5]) res.cell = xsDataCCP4Cell return res
def postProcess(self): self.DEBUG('Pointless: postProcess') EDPluginExecProcessScript.postProcess(self) output_file = self.dataInput.output_file.value sgre = re.compile( """ \* Space group = '(?P<sgstr>.*)' \(number\s+(?P<sgnumber>\d+)\)""" ) sgnumber = sgstr = None # returns None if the file does not exist... log = self.readProcessLogFile() if log is not None: # we'll apply the regexp to the whole file contents which # hopefully won't be that long. m = sgre.match(log) if m is not None: d = m.groupdict() sgnumber = d['sgnumber'] sgstr = d['sgstr'] res = XSDataPointlessOut() if sgnumber is not None: res.sgnumber = XSDataInteger(sgnumber) if sgstr is not None: res.sgstr = XSDataString(sgstr) status = XSDataStatus() status.isSuccess = XSDataBoolean(os.path.exists(output_file)) res.status = status self.dataOutput = res
def postProcess(self): self.DEBUG('Import: postProcess') EDPluginControl.postProcess(self) res = XSDataEDNAprocImportOut() status = XSDataStatus() res.status = status if self.dataInput.input_noanom: all_good = not self.anom.isFailure() and not self.noanom.isFailure() else: all_good = not self.anom.isFailure() status.isSuccess = XSDataBoolean(all_good) files = list() if not self.anom.isFailure(): files.append(self.anom.dataInput.output_file) if self.dataInput.input_noanom and not self.noanom.isFailure(): files.append(self.noanom.dataInput.output_file) res.files = files if self.dataInput.input_noanom: res.pointless_sgnumber = self.noanom.dataOutput.pointless_sgnumber res.pointless_sgstring = self.noanom.dataOutput.pointless_sgstring res.pointless_cell = self.noanom.dataOutput.pointless_cell else: res.pointless_sgnumber = self.anom.dataOutput.pointless_sgnumber res.pointless_sgstring = self.anom.dataOutput.pointless_sgstring res.pointless_cell = self.anom.dataOutput.pointless_cell res.aimless_log_anom = self.anom.dataOutput.aimless_log if self.dataInput.input_noanom: res.aimless_log_noanom = self.noanom.dataOutput.aimless_log self.dataOutput = res
def postProcess(self): self.DEBUG('Pointless: postProcess') EDPluginExecProcessScript.postProcess(self) output_file = self.dataInput.output_file.value sgre = re.compile(""" \* Space group = '(?P<sgstr>.*)' \(number\s+(?P<sgnumber>\d+)\)""") sgnumber = sgstr = None # returns None if the file does not exist... log = self.readProcessLogFile() if log is not None: # we'll apply the regexp to the whole file contents which # hopefully won't be that long. m = sgre.search(log) if m is not None: d = m.groupdict() sgnumber = d['sgnumber'] sgstr = d['sgstr'] res = XSDataPointlessOut() if sgnumber is not None: res.sgnumber = XSDataInteger(sgnumber) if sgstr is not None: res.sgstr = XSDataString(sgstr) status = XSDataStatus() status.isSuccess = XSDataBoolean(os.path.exists(output_file)) res.status = status self.dataOutput = res
def postProcess(self): self.DEBUG('Import: postProcess') EDPluginControl.postProcess(self) res = XSDataEDNAprocImportOut() status = XSDataStatus() res.status = status if self.dataInput.input_noanom: all_good = not self.anom.isFailure() and not self.noanom.isFailure( ) else: all_good = not self.anom.isFailure() status.isSuccess = XSDataBoolean(all_good) files = list() if not self.anom.isFailure(): files.append(self.anom.dataInput.output_file) if self.dataInput.input_noanom and not self.noanom.isFailure(): files.append(self.noanom.dataInput.output_file) res.files = files if self.dataInput.input_noanom: res.pointless_sgnumber = self.noanom.dataOutput.pointless_sgnumber res.pointless_sgstring = self.noanom.dataOutput.pointless_sgstring res.pointless_cell = self.noanom.dataOutput.pointless_cell else: res.pointless_sgnumber = self.anom.dataOutput.pointless_sgnumber res.pointless_sgstring = self.anom.dataOutput.pointless_sgstring res.pointless_cell = self.anom.dataOutput.pointless_cell res.aimless_log_anom = self.anom.dataOutput.aimless_log if self.dataInput.input_noanom: res.aimless_log_noanom = self.noanom.dataOutput.aimless_log self.dataOutput = res
def parsePointlessOutput(self, _outputFile): sgre = re.compile(""" \* Space group = '(?P<sgstr>.*)' \(number\s+(?P<sgnumber>\d+)\)""") sgnumber = sgstr = None res = XSDataPointlessOut() status = XSDataStatus() status.isSuccess = XSDataBoolean(False) if os.path.exists(_outputFile): res.status = status strLog = EDUtilsFile.readFile(_outputFile) if strLog is not None: # we'll apply the regexp to the whole file contents which # hopefully won't be that long. m = sgre.search(strLog) if m is not None: d = m.groupdict() sgnumber = d['sgnumber'] sgstr = d['sgstr'] res.sgnumber = XSDataInteger(sgnumber) res.sgstr = XSDataString(sgstr) status.isSuccess = XSDataBoolean(True) # Search first for unit cell after the Laue group... unitCellRe = re.compile(""" Laue group confidence.+\\n\\n\s+Unit cell:(.+)""") m2 = unitCellRe.search(strLog) if m2 is None: # Then search it from the end... unitCellRe = re.compile(""" \* Cell Dimensions : \(obsolete \- refer to dataset cell dimensions above\)\\n\\n(.+)""") m2 = unitCellRe.search(strLog) if m2 is not None: listCell = m2.groups()[0].split() xsDataCCP4Cell = XSDataCCP4Cell() xsDataCCP4Cell.length_a = XSDataLength(listCell[0]) xsDataCCP4Cell.length_b = XSDataLength(listCell[1]) xsDataCCP4Cell.length_c = XSDataLength(listCell[2]) xsDataCCP4Cell.angle_alpha = XSDataAngle(listCell[3]) xsDataCCP4Cell.angle_beta = XSDataAngle(listCell[4]) xsDataCCP4Cell.angle_gamma = XSDataAngle(listCell[5]) res.cell = xsDataCCP4Cell return res
def postProcess(self): self.DEBUG('Truncate: postProcess') EDPluginExecProcessScript.postProcess(self) output_file = self.dataInput.output_file.value res = XSDataResult() status = XSDataStatus() status.isSuccess = XSDataBoolean(os.path.exists(output_file)) res.status = status self.dataOutput = res
def postProcess(self): self.DEBUG('Uniqueify: postProcess') EDPluginExecProcessScript.postProcess(self) output_file = self.dataInput.output_file.value res = XSDataResult() status = XSDataStatus() status.isSuccess = XSDataBoolean(os.path.exists(output_file)) res.status = status self.dataOutput = res
def postProcess(self): self.DEBUG('FileConversion: postProcess') EDPluginControl.postProcess(self) output_file = self.dataInput.output_file.value res = XSDataResult() status = XSDataStatus() status.isSuccess = XSDataBoolean(os.path.exists(self.uniqueify.dataInput.output_file.value)) res.status = status self.dataOutput = res
def postProcess(self): self.DEBUG('FileConversion: postProcess') EDPluginControl.postProcess(self) output_file = self.dataInput.output_file.value res = XSDataResult() status = XSDataStatus() status.isSuccess = XSDataBoolean( os.path.exists(self.uniqueify.dataInput.output_file.value)) res.status = status self.dataOutput = res
def postProcess(self): self.DEBUG('Import: postProcess') EDPluginControl.postProcess(self) res = XSDataAutoprocImportOut() status = XSDataStatus() res.status = status all_good = not self.anom.isFailure() and not self.noanom.isFailure() status.isSuccess = XSDataBoolean(all_good) files = list() for p in [self.anom, self.noanom]: if not p.isFailure(): files.append(p.dataInput.output_file) res.files = files self.dataOutput = res
def postProcess(self): self.DEBUG('FileConversion: postProcess') EDPluginControl.postProcess(self) output_file = self.dataInput.output_file.value # gzip the pointless multirecord file pointless_out = os.path.join(os.path.dirname(self.dataInput.output_file.value), self.pointless_out) try: self.DEBUG("gzip'ing pointless multirecord file {0}".format(pointless_out)) subprocess.call(['gzip', pointless_out]) except Exception: self.DEBUG("gzip'ing the file failed: {0}".format(traceback.format_exc())) res = XSDataFileConversionOut() status = XSDataStatus() status.isSuccess = XSDataBoolean(os.path.exists(self.uniqueify.dataInput.output_file.value)) res.status = status res.pointless_sgnumber = self.pointless.dataOutput.sgnumber res.pointless_sgstring = self.pointless.dataOutput.sgstr res.aimless_log = XSDataString(self.aimless_log) self.dataOutput = res
def postProcess(self): self.DEBUG('FileConversion: postProcess') EDPluginControl.postProcess(self) output_file = self.dataInput.output_file.value # gzip the aimless unmerged file aimless_unmerged_out = 'ep_{0}{1}_aimless_unmerged.mtz'.format(self.image_prefix, self.strAnomSuffix) aimless_unmerged_path = os.path.join(os.path.dirname(self.dataInput.output_file.value), aimless_unmerged_out) try: self.DEBUG("gzip'ing aimless unmerged file {0}".format(aimless_unmerged_path)) subprocess.call(['gzip', aimless_unmerged_path]) except Exception: self.DEBUG("gzip'ing the file failed: {0}".format(traceback.format_exc())) # gzip the pointless multirecord file pointless_out = os.path.join(os.path.dirname(self.dataInput.output_file.value), self.pointless_out) try: self.DEBUG("gzip'ing pointless multirecord file {0}".format(pointless_out)) subprocess.call(['gzip', pointless_out]) except Exception: self.DEBUG("gzip'ing the file failed: {0}".format(traceback.format_exc())) res = XSDataFileConversionOut() status = XSDataStatus() status.isSuccess = XSDataBoolean(os.path.exists(self.uniqueify.dataInput.output_file.value)) res.status = status res.pointless_sgnumber = self.pointless.dataOutput.sgnumber res.pointless_sgstring = self.pointless.dataOutput.sgstr res.pointless_cell = [XSDataDouble(self.pointless.dataOutput.cell.length_a.value), XSDataDouble(self.pointless.dataOutput.cell.length_b.value), XSDataDouble(self.pointless.dataOutput.cell.length_c.value), XSDataDouble(self.pointless.dataOutput.cell.angle_alpha.value), XSDataDouble(self.pointless.dataOutput.cell.angle_beta.value), XSDataDouble(self.pointless.dataOutput.cell.angle_gamma.value)] res.aimless_log = XSDataString(self.aimless_log) self.dataOutput = res