def calculateOCCStep(self, iterN, isLastIterStep): imgSet = self._getInputParticles() numberOfClasses = self.numberOfRef cpusRef = self._cpusPerClass(self.numberOfBlocks, numberOfClasses) iterDir = self._iterWorkingDir(iterN) if iterN == 1 and not isLastIterStep: ProtFrealignBase._mergeAllParFiles(self, iterN, self.numberOfBlocks) parFile = self._getBaseName('output_par', iter=iterN) samplingRate = imgSet.getSamplingRate() rootFn = self._getBaseName('output_par_class_tmp', iter=iterN) args = self._rsampleCommand() program = RSAMPLE_PATH else: args = self._occCommand() tmp = '' for ref in self._allRefs(): if not isLastIterStep: self._mergeAllParFiles(iterN, ref, self.cpuList[ref-1]) args += '%s\n' % self._getBaseName('output_par_class', iter=iterN, ref=ref) tmp += '%s\n' % self._getBaseName('output_par_class', iter=iterN, ref=ref) args = args + tmp + 'eot' program = CALC_OCC_PATH self.runJob(program, args % locals(), cwd=iterDir) if isLastIterStep: self._setLastIter(iterN)
def calculateOCCStep(self, iterN, isLastIterStep): imgSet = self._getInputParticles() numberOfClasses = self.numberOfRef cpusRef = self._cpusPerClass(self.numberOfBlocks, numberOfClasses) iterDir = self._iterWorkingDir(iterN) if iterN == 1 and not isLastIterStep: ProtFrealignBase._mergeAllParFiles(self, iterN, self.numberOfBlocks) parFile = self._getBaseName('output_par', iter=iterN) samplingRate = imgSet.getSamplingRate() rootFn = self._getBaseName('output_par_class_tmp', iter=iterN) args = self._rsampleCommand() program = RSAMPLE_PATH else: args = self._occCommand() tmp = '' for ref in self._allRefs(): if not isLastIterStep: self._mergeAllParFiles(iterN, ref, self.cpuList[ref - 1]) args += '%s\n' % self._getBaseName( 'output_par_class', iter=iterN, ref=ref) tmp += '%s\n' % self._getBaseName( 'output_par_class', iter=iterN, ref=ref) args = args + tmp + 'eot' program = CALC_OCC_PATH self.runJob(program, args % locals(), cwd=iterDir) if isLastIterStep: self._setLastIter(iterN)
def _validate(self): errors = ProtFrealignBase._validate(self) if self.numberOfClasses.get() <= 1: errors.append('The number of classes must be at least 2') return errors
def __init__(self, **args): ProtFrealignBase.__init__(self, **args)