def parseSupcombOutputFile(self): logFile = self.readProcessLogFile() logLines = logFile.splitlines() xsRot = self.returnRotation(logLines[-3:]) xsTrns = self.returnTranslation(logLines[-6:-3]) xsNSD = XSDataDouble(float(logLines[-8].split()[-1])) pdb = os.path.join(self.getWorkingDirectory(), self.__strOutputFileName) try: res = parse_atsas.parsePDB(pdb, pdb) except Exception as error: self.ERROR("in parsePDB: %s" % error) model = XSDataSaxsModel(name=XSDataString(self.name), logFile=XSDataFile(XSDataString(os.path.join(self.getWorkingDirectory(), self.getScriptLogFileName())))) if "Rfactor" in res: model.rfactor = XSDataDouble(res["Rfactor"]) if "volume" in res: model.volume = XSDataDouble(res["volume"]) if "Rg" in res: model.rg = XSDataDouble(res["Rg"]) if "Dmax" in res : model.dmax = XSDataDouble(res["Dmax"]) xsDataResult = XSDataResultSupcomb(NSD=xsNSD, rot=xsRot, trns=xsTrns, model=model) xsDataResult.outputFilename = model.pdbFile = XSDataFile(XSDataString(pdb)) xsDataResult.status = XSDataStatus(message=self.getXSDataMessage(), executiveSummary=XSDataString(os.linesep.join(self.getListExecutiveSummaryLines()))) return xsDataResult
def postProcess(self, _edObject=None): EDPluginExecProcessScript.postProcess(self) self.DEBUG("EDPluginExecDamminv0_2.postProcess") # Create some output data cwd = self.getWorkingDirectory() model = XSDataSaxsModel(name=XSDataString("dammin")) xsDataResult = XSDataResultDammin(model=model) pathLogFile = os.path.join(cwd, "dammin.log") pathFitFile = os.path.join(cwd, "dammin.fit") pathFirFile = os.path.join(cwd, "dammin.fir") pathMoleculeFile = os.path.join(cwd, "dammin-1.pdb") pathSolventFile = os.path.join(cwd, "dammin-0.pdb") try: res = parse_atsas.parsePDB(pathMoleculeFile, pathMoleculeFile) except Exception as error: self.ERROR("EDPluginExecDamminv0_2:parsePDB: %s" % error) else: for k in res: self.__setattr__(k, res[k]) if os.path.exists(pathLogFile): xsDataResult.logFile = model.logFile = XSDataFile(XSDataString(pathLogFile)) if not self.Rfactor: self.Rfactor = self.returnDamminRFactor() if self.Rfactor: xsDataResult.rfactor = model.rfactor = XSDataDouble(self.Rfactor) if os.path.exists(pathFitFile): xsDataResult.fitFile = model.fitFile = XSDataFile(XSDataString(pathFitFile)) if os.path.exists(pathFirFile): model.firFile = XSDataFile(XSDataString(pathFirFile)) xsDataResult.chiSqrt = model.chiSqrt = self.returnDamminChiSqrt() if os.path.exists(pathMoleculeFile): xsDataResult.pdbMoleculeFile = model.pdbFile = XSDataFile(XSDataString(pathMoleculeFile)) if os.path.exists(pathSolventFile): xsDataResult.pdbSolventFile = XSDataFile(XSDataString(pathSolventFile)) if self.volume: model.volume = XSDataDouble(self.volume) if self.Rg: model.rg = XSDataDouble(self.Rg) if self.Dmax: model.dmax = XSDataDouble(self.Dmax) self.generateExecutiveSummary() xsDataResult.status = XSDataStatus(message=self.getXSDataMessage(), executiveSummary=XSDataString(os.linesep.join(self.getListExecutiveSummaryLines()))) self.dataOutput = xsDataResult
def postProcess(self, _edObject=None): EDPluginExecProcessScript.postProcess(self) self.DEBUG("EDPluginExecDamstartv0_2.postProcess") model = XSDataSaxsModel(name=XSDataString("damstart")) xsDataResult = XSDataResultDamstart(model=model) xsDataResult.outputPdbFile = model.pdbFile = XSDataFile(XSDataString(os.path.join(self.getWorkingDirectory(), self.__strOutputPdbFileName))) xsDataResult.status = XSDataStatus(message=self.getXSDataMessage(), executiveSummary=XSDataString(os.linesep.join(self.getListExecutiveSummaryLines()))) self.setDataOutput(xsDataResult)
def postProcess(self, _edObject=None): EDPluginExecProcessScript.postProcess(self) self.DEBUG("EDPluginExecDammifv0_2.postProcess") # Create some output data cwd = self.getWorkingDirectory() model = XSDataSaxsModel(name=XSDataString(self.name)) xsDataResult = XSDataResultDammif(model=model) pathLogFile = os.path.join(cwd, "dammif.log") pathFitFile = os.path.join(cwd, "dammif.fit") pathFirFile = os.path.join(cwd, "dammif.fir") pathMoleculeFile = os.path.join(cwd, "dammif-1.pdb") pathSolventFile = os.path.join(cwd, "dammif-0.pdb") try: res = parse_atsas.parsePDB(pathMoleculeFile) except Exception as error: self.ERROR("EDPluginExecDammifv0_2:parsePDB: %s" % error) else: for k in res: self.__setattr__(k, res[k]) if os.path.exists(pathLogFile): xsDataResult.logFile = model.logFile = XSDataFile( XSDataString(pathLogFile)) if self.Rfactor: xsDataResult.rfactor = model.rfactor = XSDataDouble( self.Rfactor) if os.path.exists(pathFitFile): xsDataResult.fitFile = model.fitfile = XSDataFile( XSDataString(pathFitFile)) if os.path.exists(pathFirFile): model.firfile = XSDataFile(XSDataString(pathFirFile)) xsDataResult.chiSqrt = model.chiSqrt = self.returnDammifChiSqrt() if os.path.exists(pathMoleculeFile): xsDataResult.pdbMoleculeFile = model.pdbFile = XSDataFile( XSDataString(pathMoleculeFile)) if os.path.exists(pathSolventFile): xsDataResult.pdbSolventFile = XSDataFile( XSDataString(pathSolventFile)) if os.path.exists(pathFirFile): model.firFile = XSDataFile(XSDataString(pathFirFile)) if self.volume: model.volume = XSDataDouble(self.volume) if self.Rg: model.rg = XSDataDouble(self.Rg) if self.Dmax: model.dmax = XSDataDouble(self.Dmax) self.generateExecutiveSummary() xsDataResult.status = XSDataStatus( message=self.getXSDataMessage(), executiveSummary=XSDataString( os.linesep.join(self.getListExecutiveSummaryLines()))) self.dataOutput = xsDataResult
def postProcess(self, _edObject=None): EDPluginExecProcessScript.postProcess(self) self.DEBUG("EDPluginExecDamfiltv0_3.postProcess") xsDataResult = XSDataResultDamfilt() pathOutputFile = os.path.join(self.getWorkingDirectory(), self.__strOutputPdbFileName) if os.path.exists(pathOutputFile): xsDataResult.model = XSDataSaxsModel(name=XSDataString("damfilt")) xsDataResult.outputPdbFile = xsDataResult.model.pdbFile = XSDataFile(XSDataString(pathOutputFile)) res = parse_atsas.parsePDB(pathOutputFile, pathOutputFile) if "volume" in res: xsDataResult.model.volume = XSDataDouble(res["volume"]) if "Dmax" in res: xsDataResult.model.dmax = XSDataDouble(res["Dmax"]) xsDataResult.status = XSDataStatus(message=self.getXSDataMessage(), executiveSummary=XSDataString(os.linesep.join(self.getListExecutiveSummaryLines()))) self.setDataOutput(xsDataResult)
def outputDamaverPdbFiles(self): cwd = self.getWorkingDirectory() damaverPDB = os.path.join(cwd, "damaver.pdb") if os.path.exists(damaverPDB): self.__xsDataResult.model = XSDataSaxsModel( name=XSDataString("damaver")) self.__xsDataResult.damaverPdbFile = self.__xsDataResult.model.pdbFile = XSDataFile( XSDataString(damaverPDB)) if self.__bAutomatic: damfilterFile = os.path.join(cwd, "damfilt.pdb") if os.path.exists(damfilterFile): self.__xsDataResult.damfilterPdbFile = XSDataFile( XSDataString(damfilterFile)) damstartFile = os.path.join(cwd, "damstart.pdb") if os.path.exists(damstartFile): self.__xsDataResult.damstartPdbFile = XSDataFile( XSDataString(damstartFile))
def parseSupcombOutputFile(self): logFile = self.readProcessLogFile() logLines = logFile.splitlines() line = -1 for l, ln in enumerate( logLines): if "Transformation matrix" in ln: line = l if line>=0: xsRot = self.returnRotation(logLines[line+1:line+4], 1) xsTrns = self.returnTranslation(logLines[line+1:line+4]) xsNSD = None else: xsRot = self.returnRotation(logLines[-3:]) xsTrns = self.returnTranslation(logLines[-6:-3]) xsNSD = XSDataDouble(float(logLines[-8].split()[-1])) pdb = os.path.join(self.getWorkingDirectory(), self.__strOutputFileName) try: res = parse_atsas.parsePDB(pdb, pdb) except Exception as error: self.ERROR("in parsePDB: %s" % error) if "NSD" in res: xsNSD = XSDataDouble(res["NSD"]) model = XSDataSaxsModel(name=XSDataString(self.name), logFile=XSDataFile(XSDataString(os.path.join(self.getWorkingDirectory(), self.getScriptLogFileName())))) if "Rfactor" in res: model.rfactor = XSDataDouble(res["Rfactor"]) if "volume" in res: model.volume = XSDataDouble(res["volume"]) if "Rg" in res: model.rg = XSDataDouble(res["Rg"]) if "Dmax" in res : model.dmax = XSDataDouble(res["Dmax"]) xsDataResult = XSDataResultSupcomb(NSD=xsNSD, rot=xsRot, trns=xsTrns, model=model) xsDataResult.outputFilename = model.pdbFile = XSDataFile(XSDataString(pdb)) xsDataResult.status = XSDataStatus(message=self.getXSDataMessage(), executiveSummary=XSDataString(os.linesep.join(self.getListExecutiveSummaryLines()))) return xsDataResult