Differences between revisions 3 and 4
Revision 3 as of 2011-07-06 14:28:29
Size: 3648
Editor: SteveLudtke
Comment:
Revision 4 as of 2011-07-11 13:30:18
Size: 5728
Editor: SteveLudtke
Comment:
Deletions are marked like this. Additions are marked like this.
Line 4: Line 4:
Note that this tutorial was written for EMAN2.03 or above.
Line 17: Line 18:
Line 22: Line 24:
You can get a list of available processors using ''e2help.py processor'' or ''e2help.py processor -v 2'' for more detail. If you prefer to see them via a GUI, the ''e2filtertool.py'' program allows you to graphically construct and edit filter chains. You can get a list of available processors using ''e2help.py processor'' or ''e2help.py processor -v 2'' for more detail. For example:
Line 24: Line 26:
One other important distinction between ''proc3d'' and ''e2proc3d.py''. For certain options in EMAN1, rather than specifying ''proc3d <input> <output>'' you would actually specify ''proc3d <input> <input>''; for example, when computing a FSC between two 3-D maps. Unfortunately,
this lead to mistakes, where someone specified ''<infile> <infile>'', but then forgot the ''fsc'' option and ended up overwriting the second input file. To prevent this, in EMAN2, ''e2proc3d.py'' is '''always''' ''e2proc3d.py <infile> <outfile>''. When performing an FSC,
''<outfile>'' becomes the name of the output FSC text file, and the second input is specified with the FSC option.
 * ''e2proc3d.py file3d.hdf file3d_filt.hdf --process=filter.lowpass.gauss:cutoff_freq=0.1 --process=mask.sharp:outer_radius=64''
Line 28: Line 28:
If you prefer to adjust filter parameters in a GUI, the new ''e2filtertool.py'' program allows you to graphically construct and edit filter chains.
Line 29: Line 30:
For comparative tasks, such as computing a FSC between two maps, note that the option order has changed, so the second parameter is an output not an input:
 * ''e2proc3d.py file3d.hdf fsc.txt --calcfsc=file3d_2.hdf''
Line 30: Line 33:
Note that like EMAN1, the ''--scale=scale_factor --clip=x[,y,z]'' operation performs sampling or interpolation, and does not do any averaging. If you wish to use scale factors <1.0, you may wish to consider
the ''--meanshrink='' or ''--medianshrink='' options.
Line 31: Line 36:
=== CTF determination/correction ===
Line 32: Line 38:
All CTF processing is handled by the ''e2ctf.py'' program. To display the graphical interface, you must specify the ''--gui'' option, but this requires first having run automatic parameter determination. For example, if you have particle data in the ''ptcl'' directory, with particles from each frame in a separate HDF file:

 * Make sure your input particles have been edgenormalized, and have the correct contrast (bright on a darker background). If not, correct all particle stacks with ''e2proc2dmulti.py'' with the ''--process=normalize.edgemean'' or ''--mult=-1'' options.
 * ''e2ctf.py --cs=4.1 --ac=15 --voltage=300 --apix=2.12 --oversamp=2 --autofit --gui ptcl/*hdf''
 * You may wish to manually check the CTF results quickly.
  * If you find a defocus is significantly off, adjust it manually to near the correct value and press 'refit'.
  * Be sure to press
 * Compute a structure factor (you may opt to use a subset of the data instead): ''e2ctf.py --oversamp=2 --computesf ptcl/*hdf''
 * rerun : ''e2ctf.py --cs=4.1 --ac=15 --voltage=300 --apix=2.12 --oversamp=2 --autofit --gui ptcl/*hdf''
 * optionally: ''e2ctf.py --refinebysnr ptcl/*hdf''
 * generate phase-flipped and other files (using oversamp=1 is important here): ''e2ctf.py --oversamp=1 --phaseflip --phasefliphp --wiener --storeparm ptcl/*hdf''

=== Reference-free Class-averages ===
Note that like EMAN1, these are used for initial evaluation of the data and initial model generation only. They are not used for final 3-D refinements.

 * Get a list of the available wiener filtered stacks in bdb notation: ''e2bdb.py -s particles --filt=wiener''
 * Make a virtual-stack (like an EMAN1 .lst file) containing the particles you wish to use (don't have to be Wiener filtered) : ''e2bdb.py --makevstack=bdb:sets#stack_for_2d bdb:particles#dh3962_ctf_wiener bdb:particles#dh3965_ctf_wiener bdb:particles#dh3986_ctf_wiener bdb:particles#dh3997_ctf_wiener bdb:particles#dh4017_ctf_wiener''
 * Run 2-D refinement: ''

Transitioning from EMAN1 to EMAN2 with command line tools

While the workflow is the correct choice for many users, we realize that some prefer to manipulate their data more directly. Many users who wish to use the command line are doing so because they are trying to update existing scripts currently using EMAN1. Note that this tutorial was written for EMAN2.03 or above.

Introduction to the EMAN2 Commmand-Line

The first thing to note is that EMAN2 uses standard unix-style command-line arguments rather than EMAN1 style arguments. For example: proc2d abc.hed def.spi clip=64,64 --> e2proc2d.py abc.hed def.spi --clip=64,64

Basic Image Processing

In direct analog to EMAN1, EMAN2 has e2iminfo.py, e2proc2d.py, e2proc3d.py. As with EMAN1, both of the proc commands can be used to convert among any of EMAN2's supported file formats, simply by using the correct extension for the output file. There is also an --outtype option to manually specify the output format.

It is important to understand how both programs deal with image stacks (a single file with multiple images). In EMAN1, only 2-D images could exist in stacks, simply because there were no 3-D file formats that supported multiple 3-D volumes at the time. That is no longer true, and HDF and BDB both support stacks of volumes. However, with 2-D images, stacks are used extensively, and with 3-D, only rarely. As a result e2proc2d.py and e2proc3d.py handle stacks differently by default. e2proc2d.py will append images to the output stack unless --inplace is specified. e2proc3d.py on the other hand will overwrite images by default, unless the --append option is specified. Finally, e2proc2d.py is capable of treating a single 3-D image as a stack of 2-D images in various ways. so:

  • e2proc2d.py file2d.hdf file2d.hdf --mult=-1 - would make an inverted copy of all of the images in file.hdf and append them to the end, doubling the size of the stack

  • e2proc3d.py file3d.hdf file3d.hdf --mult=-1 - would invert all of the 3-D volumes in file3d.hdf in-place. The file would be the same size when complete

Beyond this, a number of options have changed. In both e2proc2d.py and e2proc3d.py, it is now possible to construct filter chains; that is, a sequence of filters or other processors to apply to the image(s). This is done via the --process directive in either program. There are currently over 175 different processors in 10 different categories, such as filters, masks, thresholds, mathematical, etc. Any of these processors can be applied in sequence using the directive --process=procname:option=value:option=value. You can get a list of available processors using e2help.py processor or e2help.py processor -v 2 for more detail. For example:

  • e2proc3d.py file3d.hdf file3d_filt.hdf --process=filter.lowpass.gauss:cutoff_freq=0.1 --process=mask.sharp:outer_radius=64

If you prefer to adjust filter parameters in a GUI, the new e2filtertool.py program allows you to graphically construct and edit filter chains.

For comparative tasks, such as computing a FSC between two maps, note that the option order has changed, so the second parameter is an output not an input:

  • e2proc3d.py file3d.hdf fsc.txt --calcfsc=file3d_2.hdf

Note that like EMAN1, the --scale=scale_factor --clip=x[,y,z] operation performs sampling or interpolation, and does not do any averaging. If you wish to use scale factors <1.0, you may wish to consider the --meanshrink= or --medianshrink= options.

CTF determination/correction

All CTF processing is handled by the e2ctf.py program. To display the graphical interface, you must specify the --gui option, but this requires first having run automatic parameter determination. For example, if you have particle data in the ptcl directory, with particles from each frame in a separate HDF file:

  • Make sure your input particles have been edgenormalized, and have the correct contrast (bright on a darker background). If not, correct all particle stacks with e2proc2dmulti.py with the --process=normalize.edgemean or --mult=-1 options.

  • e2ctf.py --cs=4.1 --ac=15 --voltage=300 --apix=2.12 --oversamp=2 --autofit --gui ptcl/*hdf

  • You may wish to manually check the CTF results quickly.
    • If you find a defocus is significantly off, adjust it manually to near the correct value and press 'refit'.
    • Be sure to press
  • Compute a structure factor (you may opt to use a subset of the data instead): e2ctf.py --oversamp=2 --computesf ptcl/*hdf

  • rerun : e2ctf.py --cs=4.1 --ac=15 --voltage=300 --apix=2.12 --oversamp=2 --autofit --gui ptcl/*hdf

  • optionally: e2ctf.py --refinebysnr ptcl/*hdf

  • generate phase-flipped and other files (using oversamp=1 is important here): e2ctf.py --oversamp=1 --phaseflip --phasefliphp --wiener --storeparm ptcl/*hdf

Reference-free Class-averages

Note that like EMAN1, these are used for initial evaluation of the data and initial model generation only. They are not used for final 3-D refinements.

  • Get a list of the available wiener filtered stacks in bdb notation: e2bdb.py -s particles --filt=wiener

  • Make a virtual-stack (like an EMAN1 .lst file) containing the particles you wish to use (don't have to be Wiener filtered) : e2bdb.py --makevstack=bdb:sets#stack_for_2d bdb:particles#dh3962_ctf_wiener bdb:particles#dh3965_ctf_wiener bdb:particles#dh3986_ctf_wiener bdb:particles#dh3997_ctf_wiener bdb:particles#dh4017_ctf_wiener

  • Run 2-D refinement:

UNDER CONSTRUCTION

EMAN2/Eman1Transition/CommandLine (last edited 2015-03-06 03:49:27 by MichaelBell)