e2helixboxer.py: Overview

e2helixboxer.py is used to select rectangular 2D projections of helices from a micrograph, and extract overlapping particles from the boxed helices. The boxing must be done in GUI mode, but extracting particles from boxed regions may be done from the GUI or from the command line.

e2helixboxer_diagram.png

GUI mode

To start the program's graphic user interface, use the "--gui" option. You can follow this with a micrograph filename, a list of micrograph filenames, or nothing.

$ e2helixboxer.py --gui <micrograph1> <micrograph2> <...>

$ e2helixboxer.py --gui
$ e2helixboxer.py --gui 101.mrc
$ e2helixboxer.py --gui *.mrc micrograph.hdf *.img abc.dm3

The left window is the helix viewer, the middle is the micrograph viewer, and the right is the main window.

e2helixboxer.png

The main window shows a list of open micrographs and how many helices you have boxed in each one. (Actually, only one micrograph is loaded in memory at a time, but this allows for quick switching between particles.) Any micrographs you specified after the "--gui" option will be listed.

Box Editing

Draw box

Left click and drag

Move box

Left click near box center and drag

Move one box endpoint

Left click near box end and drag

Delete box

Hold shift and left click inside box

After you have boxed the helices in a micrograph, you can go to "File->Save" to save the coordinates and image data of the helices and the particles you extract from them.

e2helixboxer_write_dialog.png

A. Write Helices checkbox:

B. Write Particles checkbox:

Command-line mode

In command-line mode, you can only work with one micrograph at a time. Before using it, helices must be boxed in the GUI mode or imported from a formatted text file. In either case, the helix-box coordinates will be saved in the EMAN2 database.

Note: As in the EMAN2 convention, data is saved automatically in a database in the current working directory as you use the program. To access this data again, start programs in this same directory the next time.

e2helixboxer.py <options (not --gui)> <micrograph>

Importing Helix Coordinates

If you have coordinates for the helices that are not saved in the EMAN2 embedded database, perhaps because you did the boxing in another program, you must first import them to the embedded database before you can use e2helixboxer to generate particle sets.

--db-add-hcoords=DB_ADD_HCOORDS: Adds helix coordinates to the database from the specified file (in EMAN1 *.box format)

x1-w/2           y1-w/2           w           w           -1
x2-w/2           y2-w/2           w           w           -2
...

--db-set-hcoords=DB_SET_HCOORDS: Replaces the helix coordinates in the database with the coordinates from the specified file (in EMAN1 *.box format)

-w HELIX_WIDTH, --helix-width=HELIX_WIDTH: Helix width in pixels. Overrides the width in coordinates file.

Examples:

e2helixboxer.py --db-add-hcoords=coordinates.txt --helix-width=210 micrograph_03.hdf
e2helixboxer.py --db-set-hcoords=newcoordinates.txt -w 200

Exporting Helix Data

If you want to work with the helices in programs not included with EMAN2, you may want to save the helix coordinates or helix image data.

-X HELIX_COORDS, --helix-coords=HELIX_COORDS

-x HELIX_IMAGES, --helix-images=HELIX_IMAGES

-w HELIX_WIDTH, --helix-width=HELIX_WIDTH

Example:

e2helixboxer.py --helix-coords=hcoords.txt --helix-images=micrograph2_helices.hdf -w 215 micrograph2.mrc
e2helixboxer.py -X hcoords.txt -x helix.hdf --helix-width=210 micrograph.mrc

Exporting Particle Data

Once helices have been boxed using the e2helixboxer.py GUI, or boxed with another program and the coordinates imported, the next step is to save particle data. This can be done with the "Save" dialog in the GUI or with command-line options. See the GUI documentation above for how particles are generated and what the parameters mean. Particle coordinates can be saved to a special text file, but usually, you will save particle image stacks, which will be used to create class averages.

Particle Output Files

-P PTCL_COORDS, --ptcl-coords=PTCL_COORDS

-p PTCL_IMAGES, --ptcl-images=PTCL_IMAGES

Particle generation parameters

--ptcl-overlap=PTCL_OVERLAP

--ptcl-length=PTCL_LENGTH

--ptcl-width=PTCL_WIDTH

--ptcl-not-rotated

--ptcl-norm-edge-mean

--gridding

Particle Saving Examples

Saving rotated particles

e2helixboxer.py --ptcl-images=micrograph32_particles.hdf --ptcl-length=100 --ptcl-overlap=90 micrograph32.mrc 
e2helixboxer.py --gridding --p micrograph32_particles --ptcl-length=120 --ptcl-width=120 --ptcl-overlap=90 micrograph32.mrc

Saving unrotated particles (to be rotated later with other software)

e2helixboxer.py --ptcl-not-rotated --ptcl-image=micrograph32_particles.hdf --ptcl-width=100 --ptcl-overlap=90 micrograph32.mrc