# refine

*This is the main refinement loop in EMAN. It has a tremendous number of options.*

## Usage

refine <total iter> mask=<rad> [proc=<maxproc>] [hard=<maxpr>] [simple] [ctfc=<res in A>] [ctfcw=<SF file>] [phaseopt] [setsf=<lowpass res>[,<highpass res>[,<SF file>]] [median] [nweight] [sym=<c2,c4,etc>] [ang=<dang>] [anglist=<fule>] [maxshift=<rad>] [pad=<size>] [classkeep=<sigma coef>] [classiter=<iter>] [refmaskali] [filt3d=<lp rad>] [sep=<n>] [xfiles=<a/pix>,<mass in kd>,<ali to>] [3dit=<n it>] [3dit2=<n it>] [speed=<1-5>] [sigfilt] [euler2=<oversmp>] [tree=<2,3>] [imask=<rad>] [amask=<r>,<thr>,<n iter>] [planarmask=<thickness>] [goodbad] [slow] [refine] [shrink=<n>] [projbatches=<n>] [ca3] [classfp=<msa#>] [perturb] [usefilt] [rfp] [precen] [phasecls] [fscls] [axialfilt=<res>] [msa=<proj>] [mra2] [3dr[=<range>]] [d3s=<sigmult>] [collapse=<ang>] [dfilt] [frm2d[=<rad>,<samp>]] [classalign2log] [continue]

### Parameters

- Typical usage:
<total iter>

Total number of iterations to be run in the current directory

mask=<rad>

Applies an outside mask at several stages of refinement

[proc=<maxproc>]

Number of proceesors to use for parallel processing

[hard=<maxpr>]

Hard limit for <a href=make3d.html>make3d</a>

[simple]

Use 'make3dsimple inorm'

[ctfc=<res in A>]

Performs CTF correction filtered to the specified resolution (see <a href=classalignall.html>classalignall</a>)

[ctfcw=<SF file>]

Performs CTF correction with Wiener filtration using a structure factor specified in a file

[phaseopt]

Experimental modification to class-averaging

[setsf=<lowpass res>[,<highpass res>[,<SF file>]]

Applies a final filter to set the radial structure factor to match the ctfcw structure factor multiplied by a gaussian filter. Filter is specified in A.

[median]

Specify this when CTF correction is NOT being performed

[nweight]

Used when start.hed contains averages, to properly weight during further averaging. This will not work in conjunction with median or ctfc/w.

[sym=<c2,c4,etc>]

Imposes symmetry on the model, omit this option for no/unknown symmetry

[ang=<dang>]

Angular step for projections (in degrees, see 'prop' in <a href=project3d.html>project3d</a>)

[anglist=<fule>]

Use Euler angles included in this file for projection

[maxshift=<rad>]

Maximum translation during image alignment

[pad=<size>]

Pads the model during Fourier reconstruction (see <a href=make3d.html>make3d</a>)

[classkeep=<sigma coef>]

Classkeep value for <a href=classalignall.html>classalignall</a>

[classiter=<iter>]

Iterations for <a href=classalignall.html>classalignall</a>

[refmaskali]

This passes the refmaskali option to classalignall if the amask option is being used, otherwise refmask is used when amask is specified.

[filt3d=<lp rad>]

Apply a lowpass filter to the model after each iteration, this occurs before 3dit

[sep=<n>]

This option is passed to <a href=classesbymra.html>classesbymra</a>

[xfiles=<a/pix>,<mass in kd>,<ali to>]

Used to generate 3d models that are easy to evaluate

[3dit=<n it>]

After constructing a model with Fourier reconstruction, this runs n iterations of real-space model 'cleansing' This option isdeprecated, suggest not using it

[3dit2=<n it>]

This is real-space refinement with a special noise elimination feature enabled. This option is deprecated, suggest not using it

[speed=<1-5>]

Speed parameter in clean3d (3dit,3dit2). Convergence rate, 1 dfl

[sigfilt]

Applies a 1-sigma real-space filter to images at various points

[euler2=<oversmp>]

Reassigns Euler angles to class averages with an optionally reduced angular increment. ie - 2 will use ang/2 (see <a href=classesrefs.html>classesrefs</a>

[tree=<2,3>]

Faster classifications for large numbers of projections (see <a href=classesbymra.html>classesbymra</a>. Limited parallel support, see text.

[imask=<rad>]

Applies an inside mask in several stages of refinement

[amask=<r>,<thr>,<n iter>]

This applies an automask between steps in a reconstruction. see automask2 in <ahref=proc3d.html>proc3d</a>. REQUIRES xfiles to be used.

[planarmask=<thickness>]

Masks the object along the z-axis with a total thickness specified in pixels.

[goodbad]

Saves good and bad class averages from 3D reconstruction. Overwrites each new iteration.

[slow]

This will use a very slow, exhaustive search, algorithm for 2D alignments. VERY SLOW

[refine]

This will do subpixel alignment of the particle translations for classification and averaging. May have a significant impact at higher resolutions.

[shrink=<n>]

Experimental, shrinks images at several points for faster runs

[projbatches=<n>]

Experimental, split the projection into n batches to minimize total memory requirement

[ca3]

Experimental. Uses classalign3 instead of classalign2

[classfp=<msa#>]

Experimental, classification using rotational/translational invariants

[perturb]

Experimental option to produce a more uniform distribution of points in 3D Fourier space.

[usefilt]

Experimental

[rfp]

Experimental, classification using rotational footprints

[precen]

Indicates that raw particles have been accurately precentered (experimental)

[phasecls]

Uses weighted mean phase error for classification (experimental)

[fscls]

Uses FSC for classification (experimental)

[axialfilt=<res>]

See proc3d, 0 provides maximal effect.

[msa=<proj>]

Experimental

[mra2]

Experimental

[3dr[=<range>]]

Experimental

[d3s=<sigmult>]

Experimental

[collapse=<ang>]

Experimental

[dfilt]

Experimental

[frm2d[=<rad>,<samp>]]

This will classify using Fast Rotational Matching 2D. rad is the maximum radius of particles; samp is the number of angular sampling points at each radius circle

[classalign2log]

Experimental. Calls classalign2 with classalign2log option to print out particle that were used in the class average.

[continue]

If a job is killed in the middle of an iteration, this will allow it to pick up where it left off. Otherwise the last iteration will start from the beginning.

- refine 5 ang=3 mask=28 pad=96 hard=25 classkeep=.3 classiter=8 proc=12 sym=d7 ctfc=12 sep=2 xfiles=4.2,1000,40