Name
sxhelixboxer.py - Overview of particle picking utility for selecting rectangular 2D projections of helices from a micrograph and extracting overlapping particles from the boxed helices
Usage
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.
sxhelixboxer.py encapsulates several functionalities
1. Boxing a micrograph using GUI
sxhelixboxer.py mic0.hdf --gui &
The GUI will automatically start up. Use your mouse to box helices by clicking on the micrograph window. For details on the mechanics of boxing, see sxhelixboxer GUI
Click on "File -> Save", and there will appear a pop-up menu giving the options to save the coordinates and image data corresponding to the boxed helices, and also to extract overlapping particles from the boxed helices.
To save the coordinates of the boxed helices, make sure only "Write Helices" and "Helix Images" are checked and click "Save." Using sxhelixboxer's default naming conventions, the coordinates giving the position of the boxed helix on the micrograph and the width of the box will be saved to mic0_boxes.txt.
To window overlapping segments from the boxed helices, check "Write Particles." Specify the number of pixels by between adjacent segments in the "Distance" drop-down menu. The length and width of the segments (both in pixels) are specified through the "Length" and "Width" drop-down menus.
To Write the coordinates of the overlapping segments, check the "Particle Coordinates" box. If sxhelixboxer's default naming convention is used, the midpoints of all the segments grouped according to the helix from which they are windowed will be saved to mic0_helix_ptcl_coords.txt.
To save the images of the segments windowed from all the helices in the micrograph in a single stack, select "Single image stack" under "Image Stacks." Select "Gridding Rotation" under "Rotation" so the segments will appear vertical.
For additional details on the format of the coordinate files and the usage of the other GUI options, see sxhelixboxer GUI
2. Windowing selected helices (long-boxes) from command line, one micrograph at a time:
sxhelixboxer.py mic/mic0.hdf --db-set-hcoords=mic/mic0_boxes.txt --helix-width=200
sxhelixboxer.py mic/mic0.hdf --helix-images=heli0.hdf
3. Windowing overlapping segments from boxed helices from command line, one micrograph at a time:
Once the helices are boxed, the windowing of overlapping segments can also be performed from the command-line. To do this, first make sure the coordinates of the boxed helices are set. This should automatically be the case if the helices were boxed in the GUI mode in the same directory. If not, and assuming the coordinates of the boxed helices are in mic0_boxes.txt, set the coordinates as follows:
sxhelixboxer.py --db-add-hcoords=mic0helix_coordinates.txt --helix-width=200 mic0.hdf
To window out the segments from the boxed helices (whose coordinates are in mic0helix_coordinates.txt):
sxhelixboxer.py --ptcl-images=mic0_segments.hdf --ptcl-length=200 --ptcl-dst=15 mic0.hdf
For additional details see sxhelixboxer GUI
4. Windowing overlapping segments from boxed helices from command line, multiple micrographs, multiple directories:
5. Import the CTF parameters estimated by sxcter.py using "--importctf" option.
--defocuserror: Exclude micrographs whose relative defocus error ((std dev defocus)/defocus) as estimated by sxcter.py is larger than the defocus error percent.
--astigmatismerror: When the astigmatism error estimated by sxcter.py is too large, use "--astigmatismerror" to remove the astigmatism correction.
sxhelixboxer.py outdir --window --dirid='mic' --micid='mic' --micsuffix='hdf' --apix=1.84 --boxsize=200 --hcoords_suffix="_boxes.txt" --ptcl-dst=15 --rmax=64.0 --importctf=ctfestimates/ctfs.txt --defocuserror=10.0 --astigmatismerror=0.5
Input
- <micrograph>
- micrograph filenames to process
Output
- <particles>
- particles, either as boxed particle images or coordinates list
Parameters
window segments from boxed filaments of multiple micrographs located in one or more directories
- --window
- window segments from boxed filaments (or helices in sxhelixboxer lingo)
- --dirid
- A string for identifying directories containing relevant micrographs. Any directory containing dirid as a contiguous string will be searched for micrographs. These micrographs are assumed to be those which were used to box the helices which are to be windowed.
- --topdir
- Path name of directory containing relevant micrograph directories. The program will look in topdir for directories identified by the option --dirid.
- --micid
- A string for identifying the name (minus extension) of relevant micrographs. --micsuffix::A string denoting micrograph type. Currently only handles suffix types, e.g. 'hdf', 'ser' etc.
- --boxsize
- x and y dimensions of squares to be windowed from boxed helices. Pixel size is assumed to be new_pixel_size.
- --ptcl-dst
Integer. Distance in pixels between adjacent squares windowed from a single boxed helix. If ptcl_dst < 0, then the program will set it so ptcl_dst is ~ one rise in pixels: int( (dp/new_pixel_size) + 0.5). Overlap between adjacent squares windowed from the same helix is calculated as boxsize - ptcl-dst
- --outstacknameall
- File name plus path and type (only handles bdb and hdf right now) under which ALL windowed segments from ALL micrograph directories will be saved, e.g. 'bdb:adata' or 'adata.hdf'
- --hcoords_dir
- Directory containing helix box coordinates
- --hcoords_suffix
- String identifier which when concatenated with a micrograph name (minus extension) gives the name of the text file containing coordinates of ALL helices boxed from the micrograph. If there is no such file, helices boxed from the micrograph will not be windowed. Default is '_boxes.txt', so if mic0.hdf is a micrograph, then the text file containing coordinates of the helices boxed in it is mic0_boxes.txt. The coordinate file is assumed to be in the format used by sxhelixboxer.
- --new_apix
- New target pixel size to which the micrograph should be resampled. Default is -1, in which case there is no resampling.
- --freq
- Cut-off frequency at which to high-pass filter micrographs before windowing. Default is -1, in which case, the micrographs will be high-pass filtered with cut-off frequency 1.0/boxsize, where boxsize is the target x dimension of the segments.
- --apix
- pixel size in Angstroms
- --dp
- delta z - translation in Angstroms
- --dphi
- delta phi - rotation in degrees
- --rmax
- maximal radius for hsearch (Angstroms)
- --debug
- If 1, then intermediate files in output directory will not be deleted; if 0, then all output directories where intermediate files were stored will be deleted. Default is 1.
- --indir
- Directory containing micrographs to be processed (only for --cter option).
- --nameroot
- Prefix of micrographs to be processed (only for --cter option).
- --importctf
- Import CTF parameters estimated by sxcter.py.
- --astigmatismerror
- Astigmatism correction will be not performed if the astigmatism error estimated by sxcter.py is bigger than this value.
Description of typical usage
- Select a "typical" micrograph and activate sxhelixboxer.py in GUI mode.
- Box helices using GUI mode.
Author / Maintainer
sxhelixboxer originated from e2helixboxer by Steve Ludtke.
Keywords
- category 1
- APPLICATIONS
Files
sxhelixboxer.py