def createOutputStep(self): imgSet = self._getInputParticles() vol = Volume() vol.setFileName(self._getExtraPath('relion_class001.mrc')) vol.setSamplingRate(imgSet.getSamplingRate()) half1 = self._getFileName("final_half1_volume", ref3d=1) half2 = self._getFileName("final_half2_volume", ref3d=1) vol.setHalfMaps([half1, half2]) outImgSet = self._createSetOfParticles() outImgSet.copyInfo(imgSet) self._fillDataFromIter(outImgSet, self._lastIter()) self._defineOutputs(outputVolume=vol) self._defineSourceRelation(self.inputParticles, vol) self._defineOutputs(outputParticles=outImgSet) self._defineTransformRelation(self.inputParticles, outImgSet) fsc = FSC(objLabel=self.getRunName()) fn = self._getExtraPath("relion_model.star") table = Table(fileName=fn, tableName='model_class_1') resolution_inv = table.getColumnValues('rlnResolution') frc = table.getColumnValues('rlnGoldStandardFsc') fsc.setData(resolution_inv, frc) self._defineOutputs(outputFSC=fsc) self._defineSourceRelation(vol, fsc)
def createOutputStep(self): imgSet = self.inputParticles.get() vol = Volume() lastIter = self._getLastIterNumber() if self.protType == GOLD_STD: vol.setFileName( self._getExtraPath('Refinement/final/vol_%02d.stk' % lastIter)) half1 = self._getExtraPath('Refinement/final/vol_%02d_s1.stk' % lastIter) half2 = self._getExtraPath('Refinement/final/vol_%02d_s2.stk' % lastIter) else: vol.setFileName( self._getExtraPath('Refinement/final/bpr%02d.stk' % lastIter)) half1 = self._getExtraPath('Refinement/final/bpr%02d_sub1.stk' % lastIter) half2 = self._getExtraPath('Refinement/final/bpr%02d_sub2.stk' % lastIter) vol.setSamplingRate(imgSet.getSamplingRate()) vol.setHalfMaps([half1, half2]) outImgSet = self._createSetOfParticles() outImgSet.copyInfo(imgSet) self._fillDataFromDoc(outImgSet) self._defineOutputs(outputVolume=vol) self._defineSourceRelation(self.inputParticles, vol) self._defineOutputs(outputParticles=outImgSet) self._defineTransformRelation(self.inputParticles, outImgSet) fsc = FSC(objLabel=self.getRunName()) resolution, fscData = self._getFscData(it=lastIter) fsc.setData(resolution, fscData) self._defineOutputs(outputFSC=fsc) self._defineSourceRelation(vol, fsc)
def runCreateOutputStep(self): ''' Create standard output results_images, result_classes''' #creating results files imgSet = self.inputParticles.get() lastIter = self.numberOfIterations.get() Ts = imgSet.getSamplingRate() if self.numberOfReferences != 1: inDocfile = self._getFileName('docfileInputAnglesIters', iter=lastIter) ClassFnTemplate = '%(rootDir)s/reconstruction_Ref3D_%(ref)03d.vol' allExpImagesinDocfile = emlib.FileName() all_exp_images = "all_exp_images" allExpImagesinDocfile.compose(all_exp_images, inDocfile) dataClasses = self._getFileName('sqliteClasses') createClassesFromImages(imgSet, str(allExpImagesinDocfile), dataClasses, SetOfClasses3D, emlib.MDL_REF3D, ClassFnTemplate, lastIter) classes = self._createSetOfClasses3D(imgSet) clsSet = SetOfClasses3D(dataClasses) classes.appendFromClasses(clsSet) volumes = self._createSetOfVolumes() volumes.setSamplingRate(Ts) for refN in self.allRefs(): volFn = self._getFileName('reconstructedFileNamesIters', iter=lastIter, ref=refN) volFn = convertToMrc(self, volFn, Ts, True) vol = Volume() vol.setFileName(volFn) volumes.append(vol) self._defineOutputs(outputVolumes=volumes) self._defineOutputs(outputClasses=classes) self._defineSourceRelation(self.inputParticles, volumes) self._defineSourceRelation(self.inputParticles, classes) self._defineSourceRelation(self.input3DReferences, volumes) self._defineSourceRelation(self.input3DReferences, classes) else: volFn = self._getFileName('reconstructedFileNamesIters', iter=lastIter, ref=1) halfMap1 = self._getFileName('reconstructedFileNamesItersSplit1', iter=lastIter, ref=1) halfMap2 = self._getFileName('reconstructedFileNamesItersSplit2', iter=lastIter, ref=1) volFn = convertToMrc(self, volFn, Ts, True) halfMap1 = convertToMrc(self, halfMap1, Ts, True) halfMap2 = convertToMrc(self, halfMap2, Ts, True) vol = Volume() vol.setFileName(volFn) vol.setSamplingRate(Ts) vol.setHalfMaps([halfMap1, halfMap2]) self._defineOutputs(outputVolume=vol) self._defineSourceRelation(self.inputParticles, vol) self._defineSourceRelation(self.input3DReferences, vol) #create set of images imgSetOut = self._createSetOfParticles("_iter_%03d" % lastIter) self._fillParticlesFromIter(imgSetOut, lastIter) self._defineOutputs(outputParticles=imgSetOut) self._defineSourceRelation(self.inputParticles, imgSetOut) self._defineSourceRelation(self.input3DReferences, imgSetOut)