Library of Spider Scripts
These scripts are found in the spiproc/lib directory.
The scripts are fundamental operations than can be:
1) executed from an interactive spider session or
2) called within batch procedures.
They are grouped into the following categories:
1) Micrograph Conversion and Defocus Assessment
2) Picking and Windowing Particles
3) Filtering, Masking Particles
4) Reference-Free Alignment
5) Classification
6) Reference-Based Alignment
7) Volume Reconstruction
8) Image Utilities
9) Doc Utilities
10) Determining Resolution
1) Converting Micrographs and Assessing Defocus
tiftoraw.idl - IDL program that converts micrograph from tiled tif (Zeiss scanner) to raw format
@rawmicro2spi.spi - Converts 8bit raw to spi, requires microlist from tiftoraw.idl
/home/brignole/sparx/assesss2spi.py - Converts (with EMAN2) leginon mrc (specified in Appion image assessment output) to Spider format
/home/brignole/sparx/micros2spi.py - Convert images (with EMAN2) to Spider format with optional decimation
Warning: This works fine for MRC-to-SPI, but TIF-to-SPI conversion is mirrored about X-axis.
Note: Bsoft's bimg command does a nice job converting images to spider format.
@powerspec.spi - Determines 2D and 1D power spectra for a list of micrographs
@defocus.spi - Estimates defocus of micrographs from 2D power spectra
2) Picking, Cleaning, Windowing Particles
A. Manual Particle Selection using Eman-Boxer:
After selecting particles convert the *.box coordinate files to spider format:
>> foreach file (*.box) in bashell OR >> foreach boxfile (`find ./path/to/files -name '*.box'`) in cshell
>> nl $boxfile | nl -s
' 6 ' > $boxfile:h/box_$boxfile:t:r.spi
>> end
Then use:
@winboxer.spi - Windows particles that were manually selected with boxer.
Note: Boxer coordinates specify the top left corner (not the center) of the window.
B. Manual Particle Selection using Spider-Web:
Open Image. Then Commands:Pixel, and select "Inside Last Image" and "Leave Marker"
Web writes coordinate doc as key,x,y
@winpcls.spi - Windows particles into stack
@winlocate.spi - Identifies particle locations on a micrograph
C. Manual Particle Selection of TiltPairs using Spider-Web or Appion TiltPicker:
../TiltPicker2Spi.py - Breaks TiltPicker output into standard Spider files (ie, dcu****, dct****, dcb****)
@wintiltpair.spi - Windows pairs of particles
D. Automatic Particle Selection using Reference Volume
@pickparticles.spi (from Wadsworth) - Template based particle picker using reference volume
Then manually categorize particles from each micrograph
@checkpics.spi - Checks to be sure you've categorized particles for each micrograph
@cleanautopic.spi - Writes goodcords**** for each micrograph
3) Filtering, Masking, and Resizing Particles
@pclnorm.spi - Normalizes unprocessed particles
@filter.spi - Butterworth filters low and/or high pass, automatic cutoff frequencies 4/3*hp and 2/3*lp
@dcs.spi - Decimates a list of particle images
@softcircle.spi - Makes a soft edged circular mask for corners of particle images
@maskshift.spi - Masks and centers (cg) individual particles prior to alignment
@maskcenter.spi - Masks and centers (using mirrors) individual particles prior to alignment
@interpol.spi - Inter(extra)polates and pads/windows a series of images (useful for merging two datasets)
@resizeimg.spi - Inter(extra)polates and pads/windows image (like @interpol.spi but for single image)
4) Reference-Free Alignment
@fraln.spi - Specified number of independent runs of APSR, output is r**i** images and r**d** docs
@alnapsr.spi - aligns final averages and underlying particles from each APSR run
@apsrstat.spi - determines agreement between independent apsr runs
5) Classification
@makemask.spi - Makes a tight fitting mask for classification from avg and var images
../ConnectPoints.py - To make a mask: First make coordinates file with Web. Then use this make a list of connections.
@cxcords.spi - Reads coordinates and connections to make a mask for classification
@classify.spi - Manual classification, pauses for input number of factors and threshold
Depends on the following scripts:
@coran.spi - Correspondence analysis by Ward's criteria (CA S)
@casm.spi - Generates 2D factor map (CA SM), display with ggv
@casre.spi - Generates positive and negative eigenimages for each factor (CA SRE)
../eigenhist.py (from Wadsworth) - Reads _EIG file to make factor variance histogram for display using gnuplot
@clhc_weight.spi - Generates dendrogram given number of factors and weight-scale (CL HC)
@clust_thresh.spi - Generates class averages and docs (CL HD,CL HE)
@clust_kmeans.spi - Generates class averages and docs (CL HD,CL HE)
@classifyauto.spi - Like @classify.spi but preinput number of factors and either threshold or number of classes.
@subgrpseq.spi - Sequences averages from a series of classifications to permit classification of class averages
@mergesubclasslists.spi - Merges particle lists from classification of class averages
@classvsclass.spi - Finds each particles class following 2 subsequent classifications
@apsrgrps.spi - Perform 1 APSR run within each class
@classavgs.spi - Make class averages from series of particle lists
6) Reference-Based Alignment
@refprjaln.spi - Aligns particles to projections of a reference volume
@refal.spi - Aligns particles to reference images (such as class averages) with mirroring
@refnm.spi - Aligns particles to reference images (such as class averages) without mirroring
@refgrp.spi - Reads APSH or APNQ output to generate a stack of rotated particles (rtp@), class lists and class
averages
7) Volume Reconstruction and Modeling
Common Lines
@comnlines.spi - Back projects volumes from class averages using random initial angles over a range of resolutions
RCT
@rctanglesmr.spi - Calculates projection angles for tilted particles
@bpcg.spi - Back projects volume for each class
@rctshiftrefine.spi - Shift refinement of tilted particles
@rct2apshdoc.spi - Combines shift and rct angles into apsh format doc
@rctanglerefine.spi - Improve RCT reconstruction by 5-degree angular search
@rctami2spidocs.spi - Converts Appion angles to Spider dcb docs
@tiltStackSync.spi - Synchronize tilt and untilted stacks created with Appion
Modeling Volumes
@chiralvol.spi - Creates a chiral model volume to test rotations
@axesvol.spi - Creates a volume with cylinders along x-, y-, and z-axes
@pdb2spi.spi - Copies pdb structure into spider volume. Centers relative to a reference pdb and filters
This can also be done using iMagic's em2em or Eman's proc3d.
@wobblevol2prj.spi - Incrementally rotates a volume around a given axis and origin and generates projections
@slicevol.spi - Cuts a volume into a series of Z-slice images
@makeFootballers.spi - Creates model volumes of soccer players in 8 different conformations
8) Determining Resolution
@frcmask.spi - Calculates frc within a masked area
@frccombine.spi - Combines multiple frc curves to simplify export and display
@frcrescalc.spi - Calculates resolution at which frc curve crosses 0.5 and 3-sigma correlation
../dresplot.py - Generates gnuplot of FSC/Cref curves
Make an FSC plot
9) Operations On Images
@rtmr.spi - Rotate, shift, mirror an image series
@alnimg.spi - Aligns images (class averages) by ref, ref-free, or combination
@avgmrg.spi - Averages images from doc created using Web - Categorize
@centerbymirrors.spi - Centers an image by cross-correlating to mirror images
@orientbymirrors.spi - Rotate and centers an image by cross-correlating to mirror images (Spider 14+)
@alnavg2self.spi - Aligns an image using its mirror (used to center and orient)
@cordvalratio.spi - Determines the ratio of pixel values for a series of images
@findradius.spi - Calculates radius for alignment by rotational average of an image
@findmag.spi - Calculates Apix of an image against a reference image with known Apix. Also works on volumes.
@maskclasspcls.spi - Aligns masked class averages and underlying particles
@ft.spi - Calculates FT for a series of images
@montage.spi - Montages images (useful for making figures - or try ImageMagick)
@cp2tif.spi - Copies a list of spider images to tif format
@montage2tif.spi - Montages a list of spider images to tif format
@difmap2d.spi - Normalizes and subtracts a reference image from a series of images
@crop.spi - Crop a series of images
@stack.spi - Stacks particles (highly recommended - makes backup faster and keeps directories free of clutter)
@unstack.spi - Breaks up stacks (required to view an indexed stack in web)
@2demsim.spi - Simulates CTF and noise on a projection image
10) Doc Utilities
@listfiles.spi - Given a template will generate a list of files
@dividelist.spi - Divides a list (useful if there are too many particles to classify ~>10000)
@dochalf.spi - Cuts a doc into top and bottom halves
@deletelist.spi - Deletes files from a list
@reseqimg.spi - Resequence images according to a list - useful for displaying class averages as a movie
@combinealign.spi - Add parameters from sequential alignments
@sapclass.spi - Combines alignment parameters for a class of particles
@grpalnpcls.spi - Write parameters for alignment of class averages into parameters for underlying particles
@limitaln.spi - Resets or restricts alignment parameters to specified rotation and shift
@cleanParticleList.spi - Find particles in specified classes, then subtracts these from another particle list
@jumpers.spi - Determines number of particles that jump from class to class
In-Development
@avgvolmatch.spi - Determines angles to combine RCT volumes by matching projections with untilted 2D averages
@volmatch.spi - Determines angles to combine two volumes using projections
@symdetect.spi - Determines rotational symmetry of image
@apsrstatsym.spi - Like @apsrstat.spi but considers symmetry when combining alignment params
Obsolete
@sapm.spi - Like @sap.spi but includes mirroring
@classify1factor.spi - like classify.spi but classifies according to one factor only. Classify.spi now handles single or discontinuous factors
@fraln10x.spi - Performs 10 independent runs of APSR
@prjwobbler.spi - Rotates a volume around a given axis over a given number of degree increments
@classcheck.spi - Reports homogeneity of classes by FRC and meanCCC - neither are good measures
@apsr2sap.spi - Unnecessary if use alnapsr.spi
@alnavg.spi - Replaced by alnimg.spi
@rctgrpangles.spi - Calculates angles for tilted particles (particle num in first register)
@remove_bad_single.spi - Used to trim docs generated from particle categorization. Repalced by cleanautopics.spi
@remove_tail_single.spi - Used to trim docs generated from particle categorization. Replaced by cleanautopics.spi
@cp_from_doc_nonstack_star.spi - Copied files specified in list
@casreloop.spi - Replaced by casre.spi
@coranhcgrp.spi - Replaced by classifyauto.spi
@leginoncatcheck.spi - Use Appion image assessor instead and then generate text list of images and keep/reject category
@leginoncp.spi - Not compatible with new Leginon naming. Use assess2spi.py instead.
@lphpfilter.spi - Replaced by simpler filter.spi
@grpalnmask.spi - Replaced by maskPclsByClass.spi procedure
@cleanpics.spi - Writes goodpic**** and badpic**** particle docs for each micrograph. Replaced by cleanautopics.spi
@cleancords.spi - Writes coordinates for goodpics as cords****. Replaced by cleanautopics.spi
@frcsum.spi - Summarizes resolution by calculating in Angstroms
@wheretiltwin.spi - Identifies location of particles on micrograph pairs
@noisewin.spi - Windows a portion of a micrograph given top-right and bottom-left coordinates
@eigenhist.spi - Runs eigenhist.py and displays histogram using gnuplot