def __init__(self, protDictName, scriptname, project): self.FileKeys = ['data', 'optimiser', 'sampling'] self.ClassLabel = MDL_REF # by default 3d self.ClassFnTemplate = '%(rootDir)s/relion_it%(iter)03d_class%(ref)03d.mrc:mrc' self.outputClasses = 'classes_ref3D.xmd' self.outputVols = 'volumes.xmd' XmippProtocol.__init__(self, protDictName, scriptname, project) self.ParamsStr = '' program = 'relion_refine' if self.NumberOfMpi > 1: program += '_mpi' if self.DoContinue: if os.path.exists(self.optimiserFileName): if not self.optimiserFileName.startswith(self.WorkingDir): self.setPreviousRunFromFile(self.optimiserFileName) try: self.inputProperty('ImgMd') except: print "Cannot find the input file with experimental images in protocol %s" % self.PrevRunName self.addParam('program', program) self.addParam('ORoot', self.WorkingDir + '/') self.addParam('SamplingRate', getSampling(self.ImgMd, 0.))
def wizardChooseBandPassFilter(gui, var): '''Wizard dialog to help choosing Bandpass filter parameters (used in protocol_preprocess_particles) ''' sampling = getSampling(gui.getVarValue('InSelFile')) vList = ['Freq_low','Freq_high','Freq_decay'] from protlib_gui_ext import XmippBrowserBandpassFilter results = wizardHelperFilter(gui, XmippBrowserBandpassFilter, "Bandpass Filter", freqs=gui.getVarlistValue(vList), sampling=sampling) if results: gui.setVarlistValue(vList, results)
def wizardChooseLowPassFilter(gui, var): '''Wizard dialog to help choosing Lowpass filter parameters (used in protocol_relion...) ''' sampling = getSampling(gui.getVarValue('ImgMd')) vList = [0,var.getTkValue(),0.02]#this 0.02 is a value in Fourier space in px ^-1 from protlib_gui_ext import XmippBrowserBandpassFilter results = wizardHelperFilter(gui, XmippBrowserBandpassFilter, "Lowpass Filter", freqs=vList, varName='Ref3D', showDecay=False, showLowFreq=False, unit='angstrom', sampling=sampling ) if results: var.setTkValue(1./results[1])
def defineSteps(self): samplingRate = getSampling(self.ModelStar) args = "" args += " --i %s/relion" % dirname(self.ModelStar) args += " --angpix %f" % samplingRate args += " --o %s/relion_postprocess" % self.WorkingDir if self.AutoMask: args += ' --auto_mask' else: args += ' --inimask_threshold %f' % self.InimaskThreshold args += ' --extend_inimask %f' % self.ExtendInimask args += ' --width_mask_edge %f' % self.WidthMaskEdge args += ' --mask %s' % self.Mask mtfFile = self.Mtf.strip() if mtfFile: args += ' --mtf %s' % mtfFile if self.AutoBfac: args += ' --auto_bfac' args += ' --autob_lowres %f' % self.AutobLowres args += ' --autob_highres %f' % self.AutobHighres else: args += ' --adhoc_bfac %f' % self.AdhocBfac if not self.UseFscWeighting: args += ' --skip_fsc_weighting' if self.LowPass > 0.: args += ' --low_pass %f' % self.LowPass # Expert params args += ' --filter_edge_width %d' % self.FilterEdgeWidth args += ' --randomize_at_fsc %f' % self.RandomizeAtFsc args += ' --verb %d' % self.Verb outputs = [self.workingDirPath('relion_postprocess%s.mrc' % s) for s in ['', '_masked', '_automask']] self.insertRunJobStep('relion_postprocess', args, verifyFiles=outputs) self.insertStep('createVolumesMd', verifyfiles=[self.workingDirPath(VOLUMES)], volumeList=outputs)
def wizardSetMaskRadiusRelion(gui, var): fnSel = gui.getVarValue('ImgMd') wizardHelperSetRadii(gui, 'ImgMd','MaskRadiusA', unit='angstrom', sampling=getSampling(fnSel))
def getTs(InputVol): return getSampling(InputVol,1.)