当前位置: 首页>>代码示例>>Python>>正文


Python EDPluginExecProcessScript.postProcess方法代码示例

本文整理汇总了Python中EDPluginExecProcessScript.EDPluginExecProcessScript.postProcess方法的典型用法代码示例。如果您正苦于以下问题:Python EDPluginExecProcessScript.postProcess方法的具体用法?Python EDPluginExecProcessScript.postProcess怎么用?Python EDPluginExecProcessScript.postProcess使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EDPluginExecProcessScript.EDPluginExecProcessScript的用法示例。


在下文中一共展示了EDPluginExecProcessScript.postProcess方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: postProcess

# 需要导入模块: from EDPluginExecProcessScript import EDPluginExecProcessScript [as 别名]
# 或者: from EDPluginExecProcessScript.EDPluginExecProcessScript import postProcess [as 别名]
    def postProcess(self, _edObject=None):
        EDPluginExecProcessScript.postProcess(self)
        self.DEBUG("EDPluginExecDatGnomv1_0.postProcess")
        # Create some output data
        if not os.path.isfile(self.outFile):
            self.error("EDPluginExecDatGnomv1_0 did not produce output file %s as expected !" % self.outFile)
            self.setFailure()
            self.dataOutput = XSDataResultDatGnom()
            return

        gnom = XSDataGnom(gnomFile=XSDataFile(XSDataString(self.outFile)))
        logfile = os.path.join(self.getWorkingDirectory(), self.getScriptLogFileName())
        out = open(logfile, "r").read().split()
        for key, val, typ in (("Dmax", "dmax", XSDataLength),
                            ("Guinier", "rgGuinier", XSDataLength),
                            ("Gnom", "rgGnom", XSDataLength),
                            ("Total", "total", XSDataDouble)):
            if key in out:
                idx = out.index(key)
                res = out[idx + 2]
                gnom.__setattr__(val, typ(float(res)))
            else:
                self.error("EDPluginExecDatGnomv1_0.postProcess No key %s in file %s" % (key, logfile))
                self.setFailure()
        self.dataOutput = XSDataResultDatGnom(gnom=gnom)
开发者ID:antolinos,项目名称:edna,代码行数:27,代码来源:EDPluginExecDatGnomv1_0.py

示例2: postProcess

# 需要导入模块: from EDPluginExecProcessScript import EDPluginExecProcessScript [as 别名]
# 或者: from EDPluginExecProcessScript.EDPluginExecProcessScript import postProcess [as 别名]
    def postProcess(self, _edObject = None):
        EDPluginExecProcessScript.postProcess(self)
        EDVerbose.DEBUG("EDPluginExecDIMPLEPHASERv10.postProcess")

        self.programTermination()
        # Create some output data
        xsDataResult = CCP4DataResultPhaser(
            HKLOUT = HKL(self._hklout),
            XYZOUT = XYZ(self._xyzout),
            returnStatus = CCP4ReturnStatus())

        self.setDataOutput(xsDataResult)

        xyzout = None

        for record in self.readProcessLogFile().split('\n'):
            if 'Solution' in record and 'written to PDB file:' in record and ".pdb" in record:
                xyzout = record.split()[-1]

        assert(xyzout)
                
        shutil.copyfile(os.path.join(self.getWorkingDirectory(), xyzout),
                        self._xyzout)

        if  not os.path.isfile(self._xyzout):
            raise RuntimeError, 'File %s does not exist' % self._xyzout

        return
开发者ID:antolinos,项目名称:edna,代码行数:30,代码来源:EDPluginExecDIMPLEPHASERv10.py

示例3: postProcess

# 需要导入模块: from EDPluginExecProcessScript import EDPluginExecProcessScript [as 别名]
# 或者: from EDPluginExecProcessScript.EDPluginExecProcessScript import postProcess [as 别名]
    def postProcess(self, _edObject=None):
        EDPluginExecProcessScript.postProcess(self)
        EDVerbose.DEBUG("*** EDPluginExecDIMPLEPDBSETv10.postProcess")

        self.programTermination()

        # Create some output data
        # xsDataResult = CCP4DataResultPDBSET()
        # self.setDataOutput( xsDataResult )
        strLog = self.readProcessLogFile()
        ccp4ReturnStatus = self.getPDBSETReturnStatus(strLog)

        ccp4DataResultPDBSET = CCP4DataResultPDBSET()

        # Set the output PDB file
        ccp4DataResultPDBSET.setXYZOUT(XSDataString(self.getDataInput().getXYZOUT().getPath().getValue()))

        # Set the output log file
        ccp4DataResultPDBSET.setOutputLogFile(XSDataString(self.getScriptLogFileName()))

        # Set the return status
        ccp4DataResultPDBSET.setReturnStatus(ccp4ReturnStatus)

        # Set the data output for the job
        self.setDataOutput(ccp4DataResultPDBSET)

        if not os.path.isfile(self.getDataOutput().getXYZOUT().getValue()):
            raise RuntimeError, "File %s does not exist" % self.getDataOutput().getXYZOUT().getValue()
开发者ID:gbourgh,项目名称:edna,代码行数:30,代码来源:EDPluginExecDIMPLEPDBSETv10.py

示例4: postProcess

# 需要导入模块: from EDPluginExecProcessScript import EDPluginExecProcessScript [as 别名]
# 或者: from EDPluginExecProcessScript.EDPluginExecProcessScript import postProcess [as 别名]
 def postProcess(self, _edObject=None):
     """
     Parses the labelit.screen log file and the generated MOSFLM script
     """
     EDPluginExecProcessScript.postProcess(self, _edObject)
     self.DEBUG("EDPluginLabelitv10.postProcess...")
     strLabelitLog = self.readProcessLogFile()
     if strLabelitLog is None:
         errorMessage = EDMessage.ERROR_EXECUTION_03 % (
             "EDPluginLabelitv10.postProcess",
             self.getClassName(),
             "Could not read the Labelit log file",
         )
         self.error(errorMessage)
         self.addErrorMessage(errorMessage)
     else:
         xsDataLabelitScreenOutput = self.parseLabelitScreenOutput(strLabelitLog)
         xsDataIntegerSelectedSolutionNumber = xsDataLabelitScreenOutput.getSelectedSolutionNumber()
         if xsDataIntegerSelectedSolutionNumber is None:
             errorMessage = EDMessage.ERROR_EXECUTION_03 % (
                 "EDPluginLabelitv10.postProcess",
                 self.getClassName(),
                 "No selected solution",
             )
             self.error(errorMessage)
             self.addErrorMessage(errorMessage)
         else:
             strLabelitMosflmScriptsOutput = self.readProcessFile(
                 self.generateMosflmScriptName(xsDataIntegerSelectedSolutionNumber.getValue())
             )
             xsDataLabelitMosflmScriptsOutput = self.parseMosflmScriptsOutput(strLabelitMosflmScriptsOutput)
             xsDataResultLabelit = XSDataResultLabelit()
             xsDataResultLabelit.setLabelitScreenOutput(xsDataLabelitScreenOutput)
             xsDataResultLabelit.setLabelitMosflmScriptsOutput(xsDataLabelitMosflmScriptsOutput)
             self.setDataOutput(xsDataResultLabelit)
开发者ID:gbourgh,项目名称:edna,代码行数:37,代码来源:EDPluginLabelitv10.py

示例5: postProcess

# 需要导入模块: from EDPluginExecProcessScript import EDPluginExecProcessScript [as 别名]
# 或者: from EDPluginExecProcessScript.EDPluginExecProcessScript import postProcess [as 别名]
    def postProcess(self, _edObject=None):
        EDPluginExecProcessScript.postProcess(self)
        self.DEBUG("EDPluginMinimalXds.postProcess")
        # Check log for warning and errors
        strPathToLogFile = os.path.join(self.getWorkingDirectory(), self.getScriptLogFileName())
        self.checkLogForWarningAndErrors(strPathToLogFile)


        # XDS is considered to have succeeded iff CORRECT.LP has been created
        outfile = os.path.join(self.getWorkingDirectory(), 'CORRECT.LP')
        self.DEBUG('looking for {0}'.format(outfile))
        if not os.path.isfile(outfile):
            self.DEBUG('NOT FOUND')
            self.dataOutput.succeeded = XSDataBoolean(False)
            strErrorMessage = "Cannot find CORRECT.LP output file"
            self.ERROR(strErrorMessage)
            if len(self.getListOfErrorMessages()) == 0:
                self.addErrorMessage(strErrorMessage)
            else:
                self.addWarningMessage(strErrorMessage)
            self.setFailure()
            return
        else:
            self.DEBUG('FOUND')
            self.dataOutput.succeeded = XSDataBoolean(True)
        self.DEBUG('succeeded is {0} and succeeded.value is {1}'.format(self.dataOutput.succeeded,
                                                                        self.dataOutput.succeeded.value))
开发者ID:jordiandreu,项目名称:edna-mx,代码行数:29,代码来源:EDPluginExecMinimalXdsv1_0.py

示例6: postProcess

# 需要导入模块: from EDPluginExecProcessScript import EDPluginExecProcessScript [as 别名]
# 或者: from EDPluginExecProcessScript.EDPluginExecProcessScript import postProcess [as 别名]
    def postProcess(self, _edObject=None):
        EDPluginExecProcessScript.postProcess(self)
        self.DEBUG("EDPluginH5ToCBFv1_0.postProcess")

        if self.dataInput.dataCollection is None:
            shutil.copy(self.tmpCBFFile, self.CBFFile)
        else:
            # Fill in metadata
            fileTmpCBF = open(self.tmpCBFFile)
            tmpCBF = fileTmpCBF.read()
            fileTmpCBF.close()

            # Replace opening line
            tmpCBF = tmpCBF.replace("CBF: VERSION 1.5, CBFlib v0.7.8 - SLS/DECTRIS PILATUS detectors",
                                    "CBF: VERSION 1.5, CBFlib v0.7.8")


            index1 = tmpCBF.find("# WARNING: FOR XDS PROCESSING ONLY.")
            string2 = "# SOFTWARE VERSION: 1.1.0-RELEASE"
            index2 = tmpCBF.find(string2) + len(string2)

            miniCBFHeader = self.generateMiniCBFHeader(self.dataInput)

            newCBF = tmpCBF[:index1] + miniCBFHeader + tmpCBF[index2:]
            newCBFFile = open(self.CBFFile, "w")
            newCBFFile.write(newCBF)
            newCBFFile.close()
开发者ID:jordiandreu,项目名称:edna-mx,代码行数:29,代码来源:EDPluginH5ToCBFv1_0.py

示例7: postProcess

# 需要导入模块: from EDPluginExecProcessScript import EDPluginExecProcessScript [as 别名]
# 或者: from EDPluginExecProcessScript.EDPluginExecProcessScript import postProcess [as 别名]
    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
开发者ID:tbn,项目名称:edna,代码行数:31,代码来源:EDPluginExecPointless.py

示例8: postProcess

# 需要导入模块: from EDPluginExecProcessScript import EDPluginExecProcessScript [as 别名]
# 或者: from EDPluginExecProcessScript.EDPluginExecProcessScript import postProcess [as 别名]
 def postProcess(self, _edObject=None):
     EDPluginExecProcessScript.postProcess(self)
     EDVerbose.DEBUG("EDPluginExecMTZDUMPUnitCellSpaceGroupv10.postProcess")
     # Create some output data
     pyStrLog = self.readProcessLogFile()
     xsDataResultMTZDUMPUnitCellSpaceGroup = self.parseMTZDUMPLog(pyStrLog)
     self.setDataOutput(xsDataResultMTZDUMPUnitCellSpaceGroup)
开发者ID:antolinos,项目名称:edna,代码行数:9,代码来源:EDPluginExecMTZDUMPUnitCellSpaceGroupv10.py

示例9: postProcess

# 需要导入模块: from EDPluginExecProcessScript import EDPluginExecProcessScript [as 别名]
# 或者: from EDPluginExecProcessScript.EDPluginExecProcessScript import postProcess [as 别名]
    def postProcess(self, _edObject = None):
        EDPluginExecProcessScript.postProcess(self)
        EDVerbose.DEBUG(
            '*** EDPluginExecDIMPLEREFMACRestrainedRefinementv10.postProcess')
        
        init_r, init_r_free, final_r, final_r_free = self.parse_refmac_log()

        xsDataResult = CCP4DataResultREFMACRestrainedRefinement(
            HKLOUT = HKL(self._hklout),
            XYZOUT = XYZ(self._xyzout),
            initialR = XSDataFloat(init_r),
            initialRFree = XSDataFloat(init_r_free),
            finalR = XSDataFloat(final_r),
            finalRFree = XSDataFloat(final_r_free),            
            returnStatus = CCP4ReturnStatus())

        self.setDataOutput(xsDataResult)    
        

        if not os.path.isfile(self.getDataOutput().getHKLOUT().getPath().getValue()):
            raise RuntimeError, 'File %s does not exist' % self.getDataOutput().getHKLOUT().getPath().getValue() 

        if not os.path.isfile(self.getDataOutput().getXYZOUT().getPath().getValue()):
            raise RuntimeError, 'File %s does not exist' % self.getDataOutput().getXYZOUT().getPath().getValue() 


        return
开发者ID:antolinos,项目名称:edna,代码行数:29,代码来源:EDPluginExecDIMPLEREFMACRestrainedRefinementv10.py

示例10: postProcess

# 需要导入模块: from EDPluginExecProcessScript import EDPluginExecProcessScript [as 别名]
# 或者: from EDPluginExecProcessScript.EDPluginExecProcessScript import postProcess [as 别名]
    def postProcess(self, _oedObject=None):
        EDPluginExecProcessScript.postProcess(self, _oedObject)
        # Fill in file paths
        xsDataXDSFilePaths = XSDataXDSFilePaths()

        xparmXds = os.path.join(self.getWorkingDirectory(), "XPARM.XDS")
        if os.path.exists(xparmXds):
            xsDataXDSFilePaths.xparmXds = XSDataFile(XSDataString(xparmXds))

        xCorrectionsCbf = os.path.join(self.getWorkingDirectory(), "X-CORRECTIONS.cbf")
        if os.path.exists(xCorrectionsCbf):
            xsDataXDSFilePaths.xCorrectionsCbf = XSDataFile(XSDataString(xCorrectionsCbf))

        yCorrectionsCbf = os.path.join(self.getWorkingDirectory(), "Y-CORRECTIONS.cbf")
        if os.path.exists(yCorrectionsCbf):
            xsDataXDSFilePaths.yCorrectionsCbf = XSDataFile(XSDataString(yCorrectionsCbf))

        bkginitCbf = os.path.join(self.getWorkingDirectory(), "BKGINIT.cbf")
        if os.path.exists(bkginitCbf):
            xsDataXDSFilePaths.bkginitCbf = XSDataFile(XSDataString(bkginitCbf))

        gainCbf = os.path.join(self.getWorkingDirectory(), "GAIN.cbf")
        if os.path.exists(gainCbf):
            xsDataXDSFilePaths.gainCbf = XSDataFile(XSDataString(gainCbf))

        blankCbf = os.path.join(self.getWorkingDirectory(), "BLANK.cbf")
        if os.path.exists(blankCbf):
            xsDataXDSFilePaths.blankCbf = XSDataFile(XSDataString(blankCbf))

        self.dataOutput.filePaths = xsDataXDSFilePaths
开发者ID:IvarsKarpics,项目名称:edna-mx,代码行数:32,代码来源:EDPluginXDSv1_0.py

示例11: postProcess

# 需要导入模块: from EDPluginExecProcessScript import EDPluginExecProcessScript [as 别名]
# 或者: from EDPluginExecProcessScript.EDPluginExecProcessScript import postProcess [as 别名]
 def postProcess(self, _edObject=None):
     EDPluginExecProcessScript.postProcess(self)
     EDVerbose.DEBUG("EDPluginExecSaxsDelMetadatav1_0.postProcess")
     # Create some output data
     xsDataResult = XSDataResultSaxsDelMetadatav1_0()
     xsDataResult.setOutputImage(self.getDataInput().getInputImage())
     self.setDataOutput(xsDataResult)
开发者ID:gbourgh,项目名称:edna,代码行数:9,代码来源:EDPluginExecSaxsDelMetadatav1_0.py

示例12: postProcess

# 需要导入模块: from EDPluginExecProcessScript import EDPluginExecProcessScript [as 别名]
# 或者: from EDPluginExecProcessScript.EDPluginExecProcessScript import postProcess [as 别名]
 def postProcess(self, _edObject=None):
     EDPluginExecProcessScript.postProcess(self)
     self.DEBUG("EDPluginExecDataverv1_0.postProcess")
     # Create some output data
     xsDataResult = XSDataResultDataver()
     xsDataResult.outputCurve = XSDataFile(XSDataString(self.strOutFile))
     self.setDataOutput(xsDataResult)
开发者ID:antolinos,项目名称:edna,代码行数:9,代码来源:EDPluginExecDataverv1_0.py

示例13: postProcess

# 需要导入模块: from EDPluginExecProcessScript import EDPluginExecProcessScript [as 别名]
# 或者: from EDPluginExecProcessScript.EDPluginExecProcessScript import postProcess [as 别名]
 def postProcess(self, _edObject=None):
     EDPluginExecProcessScript.postProcess(self)
     self.DEBUG("EDPluginExecXDSAPPv1_0.postProcess")
     # Populate the results
     prefixRunNumber = EDUtilsImage.getPrefix(self.dataInput.image.path.value)
     xsDataResultXDSAPP = self.parseOutputDirectory(self.getWorkingDirectory(), prefixRunNumber)
     self.dataOutput = xsDataResultXDSAPP
开发者ID:IvarsKarpics,项目名称:edna-mx,代码行数:9,代码来源:EDPluginExecXDSAPPv1_0.py

示例14: postProcess

# 需要导入模块: from EDPluginExecProcessScript import EDPluginExecProcessScript [as 别名]
# 或者: from EDPluginExecProcessScript.EDPluginExecProcessScript import postProcess [as 别名]
    def postProcess(self, _edObject=None):
        EDPluginExecProcessScript.postProcess(self)
        self.DEBUG("EDPluginExecProcessScriptAutoRgv1_0.postProcess")
        # Create some output data
#        2.83326 0.011646 2.04258e+07 18565.3 47 81 0.783626 1 bioSaxsMerged.dat
        strOutput = self.readProcessLogFile()
        xsDataResult = XSDataResultAutoRg()
        listXSDOut = []
        for line in strOutput.split(os.linesep):
            words = line.split(None, 8)
            if len(words) < 8:
                break
            try:
                xsData = XSDataAutoRg()
                xsData.filename = XSDataFile(XSDataString(words[-1]))
                xsData.rg = XSDataLength(float(words[0]))
                xsData.rgStdev = XSDataLength(float(words[1]))
                xsData.i0 = XSDataDouble(float(words[2]))
                xsData.i0Stdev = XSDataDouble(float(words[3]))
                xsData.firstPointUsed = XSDataInteger(int(words[4]))
                xsData.lastPointUsed = XSDataInteger(int(words[5]))
                xsData.quality = XSDataDouble(float(words[6]))
                xsData.isagregated = XSDataBoolean(bool(int(words[7])))
            except Exception:
                strError = "Error in parsing output:" + line
                self.error(strError)
                self.setFailure()
            listXSDOut.append(xsData)
        xsDataResult.autoRgOut = listXSDOut
        self.setDataOutput(xsDataResult)
开发者ID:antolinos,项目名称:edna,代码行数:32,代码来源:EDPluginExecAutoRgv1_0.py

示例15: postProcess

# 需要导入模块: from EDPluginExecProcessScript import EDPluginExecProcessScript [as 别名]
# 或者: from EDPluginExecProcessScript.EDPluginExecProcessScript import postProcess [as 别名]
    def postProcess(self, _edObject=None):
        EDPluginExecProcessScript.postProcess(self)
        self.DEBUG("EDPluginExecRsync.postProcess")
        # Create some output data
        xsDataResult = XSDataResultRsync(log=XSDataString(""))

        self.setDataOutput(xsDataResult)
开发者ID:gbourgh,项目名称:edna,代码行数:9,代码来源:EDPluginExecRsync.py


注:本文中的EDPluginExecProcessScript.EDPluginExecProcessScript.postProcess方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。