Name

sxprocess - Carry out various SPARX commands on image series, and generate data and initialize database for demo script.

  1. Phase flip a stack of images and write output to new file:
    • sxprocess.py input_stack.hdf output_stack.hdf --phase_flip
  2. Resample (decimate or interpolate up) images (2D or 3D) in a stack to change the pixel size.
    • The window size will change accordingly.
      • sxprocess input.hdf output.hdf --changesize --ratio=0.5
  3. Compute average power spectrum of a stack of 2D images with optional padding (option wn) with zeroes.
    • sxprocess.py input_stack.hdf powerspectrum.hdf --pw [--wn=1024]
  4. Generate a stack of projections bdb:data and micrographs with prefix mic (i.e., mic0.hdf, mic1.hdf etc) from structure input_structure.hdf, with CTF applied to both projections and micrographs:
    • sxprocess.py input_structure.hdf data mic --generate_projections format="bdb":apix=5.2:CTF=True:boxsize=64

  5. Retrieve original image numbers in the selected ISAC group (here group 12 from generation 3):
    • sxprocess.py bdb:test3 class_averages_generation_3.hdf list3_12.txt --isacgroup=12 --params=originalid
  6. Retrieve original image numbers of images listed in ISAC output stack of averages:
    • sxprocess.py select1.hdf ohk.txt
  7. Adjust rotationally averaged power spectrum of an image to that of a reference image or a reference 1D power spectrum stored in an ASCII file.
    • Optionally use a tangent low-pass filter. Also works for a stack of images, in which case the output is also a stack.

      sxprocess.py vol.hdf ref.hdf avol.hdf < 0.25 0.2> --adjpw

      • sxprocess.py vol.hdf pw.txt avol.hdf < 0.25 0.2> --adjpw

  8. Generate a 1D rotationally averaged power spectrum of an image.
    • sxprocess.py vol.hdf --rotwp=rotpw.txt
    • # Output will contain three columns:
    • (1) rotationally averaged power spectrum (2) logarithm of the rotationally averaged power spectrum (3) integer line number (from zero to approximately to half the image size)
  9. Apply 3D transformation (rotation and/or shift) to a set of orientation parameters associated with projection data.
    • sxprocess.py --transfromparams=phi,theta,psi,tx,ty,tz input.txt output.txt The output file is then imported and 3D transformed volume computed: sxheader.py bdb:p --params=xform.projection --import=output.txt mpirun -np 2 sxrecons3d_n.py bdb:p tvol.hdf --MPI The reconstructed volume is in the position of the volume computed using the input.txt parameters and then transformed with rot_shift3D(vol, phi,theta,psi,tx,ty,tz)
  10. Import ctf parameters from the output of sxcter into windowed particle headers.
    • There are three possible input files formats: (1) all particles are in one stack, (2 aor 3) particles are in stacks, each stack corresponds to a single micrograph. In each case the particles should contain a name of the micrograph of origin stores using attribute name 'ptcl_source_image'.
    • Normally this is done by e2boxer.py during windowing.
      • Particles whose defocus or astigmatism error exceed set thresholds will be skipped, otherwise, virtual stacks with the original way preceded by G will be created.
        • sxprocess.py --input=bdb:data --importctf=outdir/partres --defocuserror=10.0 --astigmatismerror=5.0 # Output will be a vritual stack bdb:Gdata sxprocess.py --input="bdb:directory/stacks*" --importctf=outdir/partres --defocuserror=10.0 --astigmatismerror=5.0 To concatenate output files: cd directory e2bdb.py . --makevstack=bdb:allparticles --filt=G IMPORTANT: Please do not move (or remove!) any input/intermediate EMAN2DB files as the information is linked between them.
  11. Scale 3D shifts. The shifts in the input five columns text file with 3D orientation parameters will be DIVIDED by the scale factor
    • sxprocess.py orientationparams.txt scaledparams.txt scale=0.5
  12. Generate a 3-D mask for an given input 3-D volume adaptively.
    • sxprocess.py --adaptive_mask vol001.hdf
  13. Generate binary 3D mask from input 3D volume using the user-provided threshold.
    • sxprocess.py vol3d.hdf mask3d.hdf --binary_mask --threshold=0.05 --ne=3 --nd==3
  14. Postprocess 3-D or 2-D images: (a). sxprocess.py vol_0_unfil_026.hdf vol_1_unfil_026.hdf --mask=mask15.mrc --postprocess --pixel_size=1.2 --low_pass_filter =-1 --mtf=aa.txt --fsc_adj --output=vol_post.hdf (b) sxprocess.py vol_0_unfil_026.hdf --mask=mask15.mrc --postprocess --pixel_size=1.2 --mtf=aa.txt --output=vol_0_post.hdf = (c) sxprocess.py vol_0_unfil_026.hdf vol_1_unfil_026.hdf --mask=mask15.mrc --postprocess --pixel_size=1.2 --low_pass_filter=4.7 --mtf=aa.txt --fsc_adj (d) sxprocess.py vol_0_unfil_026.hdf vol_1_unfil_026.hdf --do_adaptive_mask --postprocess --pixel_size=1.2 --mtf=aa.txt --fsc_adj

Usage

Phase flip a stack of images and write output to new file:

Generate bdb:data, a stack of ctf applied projections in bdb format, and ctf applied micrographs prefixed by mic, e.g. mic0.hdf, mic1.hdf etc., from the structure model_structure.hdf:

Generate data.hdf, a stack of projections in hdf format, and micrographs prefixed by mic, e.g. mic0.hdf, mic1.hdf etc., from the structure model_structure.hdf:

Create and initialize database with the appropriate input parameters for the demo in demo/mpi_bdb for running command-line mode autoboxing using the gauss mode of e2boxer:

Create and initialize database with the appropriate input parameters for the demo in demo/mpi_bdb_ctf for running command-line mode autoboxing using the gauss mode of e2boxer:

Options

--phase_flip

phase flip an input stack of images and write output to new file. Required arguments for this option are the name of the input stack and desired name to which the output will be written.

--makedb

create and initialize database with the parameters needed to run e2boxer's autoboxer (in Gauss mode) from the command line. If --makedb=mpibdb, then the database will be initialized with parameters appropriate to the data set in the demo demo/mpi_bdb. Otherwise, if --makedb=mpibdbctf, then the database will be initialized with parameters appropriate to the data set in the demo demo/mpi_bdb_ctf. This option requires exactly one argument, the name of the key under which the parameters will be saved in the database. For the demo files, this key is demoparms.

--generate_projections

generate a stack of 1440 projections and five micrographs from an input structure. Three input arguments are required for this option: name of input structure from which projections are generated, desired name of projection stack to be generated (not including file extension), and prefix of micrographs to be generated. Optional arguments specifying format, apix and whether to add CTF effects can be entered as follows after --generate_projections: format='bdb':apix=5.2:CTF=True:boxsize=64, or format='hdf', etc., where format can be bdb or hdf, apix (pixel size) is a float, CTF is True or False, and boxsize is dimension of the box, which is assumed to be square . If an optional parameter is not specified, it will default as follows: format='bdb', apix=2.5, CTF=False, boxsize=64.

Author / Maintainer

Jia Fang

Keywords

category 1
UTILITIES
category 1
APPLICATIONS

Files

sparx/bin/sxprocess.py

Maturity

beta
works for author, often works for others.

sxprocess (last edited 2016-08-18 23:30:40 by penczek)