def pysegPostRec(self, outStar): # Generate output subtomo dir outDir = self._getExtraPath(POST_REC_OUT) makePath(outDir) # Script called Plugin.runPySeg(self, PYTHON, self._getCommand(outDir, outStar))
def pysegPicking(self): # Generate output dir outDir = self._getExtraPath() makePath(outDir) # Generate slices xml self._createPickingXmlFile(Plugin.getHome(PICKING_SLICES), outDir) # Script called Plugin.runPySeg(self, PYTHON, self._getPickingCommand(outDir))
def pysegGraphs(self): # Generate output dir outDir = self._getExtraPath() makePath(outDir) # Script called Plugin.runPySeg(self, PYTHON, self._getGraphsCommand(outDir)) # Remove Disperse program intermediate result directories if requested if self.keepOnlyreqFiles.get(): disperseDirs = glob(self._getExtraPath('disperse_*')) [shutil.rmtree(disperseDir) for disperseDir in disperseDirs]
def pysegFils(self): # Generate output dir outDir = self._getExtraPath() makePath(outDir) # Generate sources xml self._createFilsXmlFile(Plugin.getHome(FILS_SOURCES), outDir) # Generate targets xml self._createFilsXmlFile(Plugin.getHome(FILS_TARGETS), outDir, isSource=False) # Script called Plugin.runPySeg(self, PYTHON, self._getFilsCommand(outDir))
def _getCommand(self): alg = self.clusteringAlg.get() classCmd = ' ' classCmd += '%s ' % Plugin.getHome(PLANE_ALIGN_CLASS_SCRIPT) classCmd += '--inRootDir scipion ' classCmd += '--inStar %s ' % self._getExtraPath(self.inStarName) classCmd += '--inMask %s ' % getFinalMaskFileName(self.inMask.get()) classCmd += '--outDir %s ' % self._outDir classCmd += '--filterSize %s ' % self.filterSize.get() classCmd += '--procLevel %s ' % (FULL_CLASSIFICATION + 1) # Numbered from 1 in pyseg classCmd += '--doCC3d %s ' % self.doCC3d.get() classCmd += '--ccMetric %s ' % self._decodeCCMetric() classCmd += '--clusteringAlg %s ' % self._decodeClusteringAlg() classCmd += '--distanceMetric %s ' % self._decodeDistanceMetric() if alg == AFFINITY_PROP: classCmd += '--apPref %s ' % self.apPref.get() classCmd += '--apDumping %s ' % self.apDumping.get() classCmd += '--apMaxIter %s ' % self.apMaxIter.get() classCmd += '--apConvIter %s ' % self.apConvIter.get() classCmd += '--apCCRefFilter %s ' % self.apCCRefFilter.get() else: classCmd += '--pcaComps %s ' % self._estimatePCAComps() if alg == AGGLOMERATIVE: classCmd += '--aggNClusters %s ' % self.aggNClusters.get() else: classCmd += '--kmeansNClusters %s ' % self.aggNClusters.get() classCmd += '--apPartSizeFilter %s ' % self.apPartSizeFilter.get() classCmd += '-j %s ' % self.numberOfThreads.get() return classCmd
def _getPickingCommand(self, outDir): pickingCmd = ' ' pickingCmd += '%s ' % Plugin.getHome(PICKING_SCRIPT) pickingCmd += '--inStar %s ' % self._getFilsStarFileName() pickingCmd += '--outDir %s ' % outDir pickingCmd += '--slicesFile %s ' % self._xmlSlices pickingCmd += '--peakTh %s ' % self.peakTh.get() pickingCmd += '--peakNs %s ' % self.peakNs.get() return pickingCmd
def _getFilsCommand(self, outDir): filsCmd = ' ' filsCmd += '%s ' % Plugin.getHome(FILS_SCRIPT) filsCmd += '--inStar %s ' % self._getGraphsStarFile() filsCmd += '--outDir %s ' % outDir filsCmd += '--inSources %s ' % abspath(self._xmlSources) filsCmd += '--inTargets %s ' % abspath(self._xmlTargets) filsCmd += '--thMode %s ' % self._parseThModeSelection() filsCmd += '--gRgLen %s ' % self.gRgLen.get() filsCmd += '--gRgSin %s ' % self.gRgSin.get() filsCmd += '--gRgEud %s ' % self.gRgEud.get() return filsCmd
def _getGraphsCommand(self, outDir): pixSize = self._getSamplingRate() / 10 graphsCmd = ' ' graphsCmd += '%s ' % Plugin.getHome(GRAPHS_SCRIPT) graphsCmd += '--inStar %s ' % self._getPreSegStarFile( ) # self.inStar.get() graphsCmd += '--outDir %s ' % outDir graphsCmd += '--pixelSize %s ' % pixSize # PySeg requires it in nm graphsCmd += '--sSig %s ' % self.sSig.get() graphsCmd += '--vDen %s ' % self.vDen.get() graphsCmd += '--veRatio %s ' % self.vRatio.get() graphsCmd += '--maxLen %s ' % self.maxLen.get() graphsCmd += '-j %s ' % self.numberOfThreads.get() return graphsCmd
def _getPreSegCmd(self, inStar, outDir): preSegCmd = ' ' preSegCmd += '%s ' % Plugin.getHome(PRESEG_SCRIPT) preSegCmd += '--inStar %s ' % inStar preSegCmd += '--outDir %s ' % outDir preSegCmd += '--spSplit %s ' % self.spSplit.get() preSegCmd += '--spOffVoxels %s ' % self.spOffVoxels.get() preSegCmd += '--sgVoxelSize %s ' % (float(self._getSamplingRate()) / 10 ) # required in nm preSegCmd += '--sgThreshold %s ' % self.sgThreshold.get() preSegCmd += '--sgSizeThreshold %s ' % self.sgSizeThreshold.get() preSegCmd += '--sgMembThk %s ' % self._checkValue4PySeg( self.sgMembThk.get()) # required in nm preSegCmd += '--sgMembNeigh %s ' % self._checkValue4PySeg( self.sgMembNeigh.get()) # required in nm return preSegCmd
def _getCommand(self, outDir, outStar): doGaussianLPFilter = self.doGaussLowPassFilter.get() cutOffRes = 0 ampCutOff = 0 if doGaussianLPFilter: cutOffRes = self.cutOffRes.get() ampCutOff = self.ampCutOff.get() posRecCmd = ' ' posRecCmd += '%s ' % Plugin.getHome(POST_REC_SCRIPT_MEMB_ATT) posRecCmd += '--inStar %s ' % self._getExtraPath(self.inStarName) posRecCmd += '--inMask %s ' % getFinalMaskFileName(self.inMask.get()) posRecCmd += '--inMaskMbSup %s ' % (getFinalMaskFileName(self.mbMask.get()) if self.mbMask.get() else 'None') posRecCmd += '--mbSupFactor %s ' % (self.mbSupFactor.get() if self.mbSupFactor.get() else '0') posRecCmd += '--doGaussLowPass %s ' % doGaussianLPFilter posRecCmd += '--resolution %s ' % (float(self.inputSubtomos.get().getSamplingRate()) / 10) # in nm posRecCmd += '--cutOffRes %s ' % cutOffRes posRecCmd += '--ampCutOff %s ' % ampCutOff posRecCmd += '--filterCTF %s ' % self.filterCTF.get() posRecCmd += '--outDir %s ' % outDir posRecCmd += '--outStar %s ' % outStar posRecCmd += '-j %s ' % self.numberOfThreads.get() return posRecCmd
def pysegPlaneAlignClassification(self): # Script called Plugin.runPySeg(self, PYTHON, self. _getCommand())
def pysegPreSegCenteredStep(self): inStar = abspath(self.getVesiclesCenteredStarFile()) outDir = self._getExtraPath() # Script called Plugin.runPySeg(self, PYTHON, self._getPreSegCmd(inStar, outDir))
def pysegPreSegStep(self): outDir = self._getExtraPath() # Script called Plugin.runPySeg(self, PYTHON, self._getPreSegCmd(self._starFile, outDir))