.. _segmentalign2d: Segmentalign2d -------------- Program to align segments from helical specimens with a restrained in-plane rotation of 0 or 180 +/- delta degrees +--------------------------------------------------+--------------------------------------------------+ | |segmentalign2d_input.png| | |segmentalign2d_output.png| | +--------------------------------------------------+--------------------------------------------------+ | Input: Image input stack | Output: Image output stack | +--------------------------------------------------+--------------------------------------------------+ .. |segmentalign2d_input.png| image:: ../gallery_images/segmentalign2d_input.png :alt: tree :width: 4 cm :target: ../_images/segmentalign2d_input.png .. |segmentalign2d_output.png| image:: ../gallery_images/segmentalign2d_output.png :alt: tree :width: 4 cm :target: ../_images/segmentalign2d_output.png .. _making_a_segmentalign2d_table_for_beginner: Parameters ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. tabularcolumns:: |p{4cm}|p{2.5cm}|p{9cm}| ============================================================================== ============================================================================== ==================================================================================================== Parameter Example (default) Description ============================================================================== ============================================================================== ==================================================================================================== Image input stack protein_stack.hdf Input stack: accepted file formats (hdf). Image output stack protein_stack.hdf Output stack: accepted file formats (hdf). Reference option True Provide a stack of images as a reference. If not ticked, a simple average of the provided image stack will be used. Image reference stack protein_reference_stack.hdf Input reference stack: accepted file formats (spi, .hdf, .img, .hed). Update references True Check if references should be updated for every iteration. This is useful if you have a high ratio of images / references and you expect to improve your references. In case you simply want to match or assign having a low images / references ratio you should turn it off. Aligned average stack protein_reference_aligned.hdf Output aligned reference stack: accepted file formats (spi, .hdf, .img, .hed). Pixel size in Angstrom 1.163 Pixel size is an imaging parameter (accepted values min=0.001, max=100). Estimated helix width and height in Angstrom (200, 600) Generous width and height measure of helix required for rectangular mask (accepted values min=20, max=1500). ============================================================================== ============================================================================== ==================================================================================================== .. _segmentalign2d_parameter_file_for_beginner: Sample parameter file ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ You may run the program in the command line by providing the parameters via a text file:: segmentalign2d --f parameterfile.txt Where the format of the parameters is:: Image input stack = protein_stack.hdf Image output stack = protein_stack.hdf Reference option = True Image reference stack = protein_reference_stack.hdf Update references = True Aligned average stack = protein_reference_aligned.hdf Pixel size in Angstrom = 1.163 Estimated helix width and height in Angstrom = (200, 600) .. _making_a_segmentalign2d_table_for_intermediate: Additional parameters (intermediate level) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. tabularcolumns:: |p{4cm}|p{2.5cm}|p{9cm}| ============================================================================== ============================================================================== ==================================================================================================== Parameter Example (default) Description ============================================================================== ============================================================================== ==================================================================================================== Number of iterations 2 Number of iteration cycles of multi-reference alignment. Internally imageswill be binned to speed up processing (accepted values min=1, max=200). Absolute X and Y translation limit in Angstrom (100, 100) Absolute translation limit of alignment search in Angstrom perpendicular and along helix axis from center of segment. This is useful because iterative alignments tend to move the helix axis in y-direction (accepted values min=1, max=1000). Internal binning factor 2 In order to speed up alignments images can be optionally binned (accepted values min=1, max=20). Limit in-plane rotation True Restricts in-plane rotation alignment. Delta in-plane rotation angle 10.0 Rotational alignment is being performed within +/- delta angle from 0 and 180 degrees (delta=0 means only 0/180 are checked, delta=180 means no rotational restraint) (accepted values min=0, max=180). X and Y translation range in Angstrom (50, 50) Translational range of alignment search perpendicular and along helix axis (X: off-center helical axis, Y: (minimum y-range=helical rise/2) (accepted values min=0, max=1000). High-pass filter option False Option to high-pass filter images before alignment or band-pass filter in combination with low-pass filter. Low-pass filter option True Option to low-pass filter images before alignment or band-pass filter in combination with high-pass filter. High and low-pass filter cutoffs in 1/Angstrom (0.001, 0.09) Filter design for high- and low-pass filter with cutoffs in 1/Angstrom. Maximum spatial frequency is 1/(2*pixelsize) (accepted values min=0, max=1). MPI option True OpenMPI installed (mpirun). Number of CPUs 8 Number of processors to be used (accepted values min=1, max=1000). Temporary directory /tmp Temporary directory should have fast read and write access. ============================================================================== ============================================================================== ==================================================================================================== .. _segmentalign2d_parameter_file_for_intermediate: Sample parameter file (intermediate level) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ You may run the program in the command line by providing the parameters via a text file:: segmentalign2d --f parameterfile.txt Where the format of the parameters is:: Image input stack = protein_stack.hdf Image output stack = protein_stack.hdf Number of iterations = 2 Reference option = True Image reference stack = protein_reference_stack.hdf Update references = True Aligned average stack = protein_reference_aligned.hdf Pixel size in Angstrom = 1.163 Estimated helix width and height in Angstrom = (200, 600) Absolute X and Y translation limit in Angstrom = (100, 100) Internal binning factor = 2 Limit in-plane rotation = True Delta in-plane rotation angle = 10.0 X and Y translation range in Angstrom = (50, 50) High-pass filter option = False Low-pass filter option = True High and low-pass filter cutoffs in 1/Angstrom = (0.001, 0.09) MPI option = True Number of CPUs = 8 Temporary directory = /tmp .. _making_a_segmentalign2d_table_for_expert: Additional parameters (expert level) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. tabularcolumns:: |p{4cm}|p{2.5cm}|p{9cm}| ============================================================================== ============================================================================== ==================================================================================================== Parameter Example (default) Description ============================================================================== ============================================================================== ==================================================================================================== Local refinement False This option can be used to refine locally around the alignment parameters stored in the header of the image stack. B-Factor 0 B-Factor in 1/Angstrom^2 to be applied to images. Zero no modulation of frequencies. Negative B-factors enhance high-resolution frequencies. Positive B-factors dampen high-resolution frequencies (accepted values min=-50000, max=50000). Custom filter option False Option to custom filter images before alignment. Custom-built filter file filter_function.dat Custom-built filter function with two columns (normalized spatial frequency 0 - 0.5, Fourier filter coefficients between 0 - 1): accepted file formats (txt, .dat). Automatic filter option True Automatic filter design derived from decay of Fourier ring correlation between images. ============================================================================== ============================================================================== ==================================================================================================== .. _segmentalign2d_parameter_file_for_expert: Sample parameter file (expert level) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ You may run the program in the command line by providing the parameters via a text file:: segmentalign2d --f parameterfile.txt Where the format of the parameters is:: Image input stack = protein_stack.hdf Image output stack = protein_stack.hdf Number of iterations = 2 Reference option = True Image reference stack = protein_reference_stack.hdf Update references = True Aligned average stack = protein_reference_aligned.hdf Pixel size in Angstrom = 1.163 Estimated helix width and height in Angstrom = (200, 600) Local refinement = False Absolute X and Y translation limit in Angstrom = (100, 100) Internal binning factor = 2 Limit in-plane rotation = True Delta in-plane rotation angle = 10.0 X and Y translation range in Angstrom = (50, 50) High-pass filter option = False Low-pass filter option = True High and low-pass filter cutoffs in 1/Angstrom = (0.001, 0.09) B-Factor = 0 Custom filter option = False Custom-built filter file = filter_function.dat Automatic filter option = True MPI option = True Number of CPUs = 8 Temporary directory = /tmp .. _using_segmentalign2d_on_cmdline: Command line options ~~~~~~~~~~~~~~~~~~~~~~~ When invoking segmentalign2d, you may specify any of these options:: usage: segmentalign2d [-h] [--g] [--p] [--f FILENAME] [--c] [--l LOGFILENAME] [--d DIRECTORY_NAME] [--version] [--reference_option] [--update_references] [--local_refinement] [--limit_in-plane_rotation] [--high-pass_filter_option] [--low-pass_filter_option] [--custom_filter_option] [--automatic_filter_option] [--mpi_option] [input_output [input_output ...]] Program to align segments from helical specimens with a restrained in-plane rotation of 0 or 180 +/- delta degrees positional arguments: input_output Input and output files optional arguments: -h, --help show this help message and exit --g, --GUI GUI option: read input parameters from GUI --p, --promptuser Prompt user option: read input parameters from prompt --f FILENAME, --parameterfile FILENAME File option: read input parameters from FILENAME --c, --cmd Command line parameter option: read only boolean input parameters from command line and all other parameters will be assigned from other sources --l LOGFILENAME, --logfile LOGFILENAME Output logfile name as specified --d DIRECTORY_NAME, --directory DIRECTORY_NAME Output directory name as specified --version show program's version number and exit --reference_option, --ref Provide a stack of images as a reference. If not ticked, a simple average of the provided image stack will be used. (default: False) --update_references, --upd Check if references should be updated for every iteration. This is useful if you have a high ratio of images / references and you expect to improve your references. In case you simply want to match or assign having a low images / references ratio you should turn it off. (default: False) --local_refinement, --loc This option can be used to refine locally around the alignment parameters stored in the header of the image stack. (default: False) --limit_in-plane_rotation, --lim Restricts in-plane rotation alignment. (default: False) --high-pass_filter_option, --hig Option to high-pass filter images before alignment or band-pass filter in combination with low-pass filter. (default: False) --low-pass_filter_option, --low Option to low-pass filter images before alignment or band-pass filter in combination with high-pass filter. (default: False) --custom_filter_option, --cus Option to custom filter images before alignment. (default: False) --automatic_filter_option, --aut Automatic filter design derived from decay of Fourier ring correlation between images. (default: False) --mpi_option, --mpi OpenMPI installed (mpirun). (default: False) Program flow ~~~~~~~~~~~~~~~~~~~~ #. prepare_alignment: Prepare alignment #. prepare_reference_images_for_alignment: Prepare reference images for alignment #. align_images_to_references: Aligns images to reference #. pass_alignment_parameters_from_reference_groups_to_images: Apply alignment parameters to images Functions ~~~~~~~~~~~~~~~~~~~~ .. toctree:: :maxdepth: 1 segmentalign2d_functions