### Sidebar

#### Release history

pipeline:meridien:sp_relion_3dclassifi
This version (2021/03/16 11:33) is a draft.
Approvals: 0/1

## sp_relion_3dclassifi

3D classification : Apply relion 3D classficaton using SPHIRE GUI.

## Usage

Usage in command line

  sp_relion_3dclassifi.py post_refine_folder output_folder reference_map --reference_mask --abs_greyscale_map --ini_high --sym --do_ctf --ctf_corr_ref --ctf_ignore_peak --no_of_class --tau_val --no_of_iter --use_fast_sets --mask_diam --mask_zeros --limit_resol_estep --skip_img_align --heal_pix_order --off_range --off_step --ang_search --ang_search_range --ang_search_relax_sym --coarse_sampling --para_io --no_of_pool_part --skip_pad --skip_grid --pre_read_img --scratch_dir --combine_iter_disc --use_gpu --which_gpu --submission_template --submission_command --relion_mpirun_executable --relion_3dclassification_executable --mpi_procs --no_of_threads --mrc_reloc_folder --helical_recons --inner_diam --outer_diam --sig_tilt --sig_psi --sig_rot --sigma_dist --keep_tilt_fix --apply_helical_sym --unique_asym_unit --initial_twist --initial_rise --z_percent --do_local_search --twist_min --twist_max --twist_inistep --rise_min --rise_max --rise_inistep


## Typical usage

sp_relion_3dclassifi exists in both MPI and non-MPI versions (Running MPI version does not require –MPI flag).

The purpose of sp_relion_3dclassifi.py is to :

: Apply 3D classification from relion using the SPHIRE GUI.

: The SPHIRE module provides a wrapper around the 3d classification command.

: After running the 3d classification routine, the wrapper automatically converts the star file so that it can be used directly for further processing. (still in test phase).


## Input

#### Main Parameters

post_refine_folder
Input folder is the directory where the results of the post refiner are present and python routine automatically locates all the required files used for relion 3d classification. (default required string)
output_folder
Output folder is the directory where all the results of the relion 3d classification are saved. (default required string)
reference_map
Reference map to be used. (default required string)
Reference mask (optional) . In case reference mask is provided by user . (default none)
--ini_high
initial low pass filter in angstroms. (default 60)
--sym
symmetry use for classification. (default C1)
--do_ctf
Whether to apply CTF correction or not. (default True)
--ctf_corr_ref
Whether reference was CTF correction or not. (default False)
--ctf_ignore_peak
Whether or not the first peak should be ignored or not .(default False)
--no_of_class
Number of classes to have. (default 1)
--tau_val
Regularized parameter T adjusted. (default 4)
--no_of_iter
Number of iterations to be performed. (default 25)
--diam_mas
The diameter of the mask (A) which use. (default 200)
--zeros_mas
in case padding with zeros is required. (default True)
--limit_resol_estep
to limit the resolution E-step to (A) for fitting (default -1)
--heal_pix_order
Angular sampling interval in degrees. output value can be from 8 to 0 depends on selection of values from 0.1 to 30 degrees (default 7.5)
--off_range
Offset search range (pix). Probabilities will be calculated only for translations in a circle with this radius in pixels. (default 5)
--off_step
Offset search step (pix). Translations will be sampled with this step size in pixels. (default 1)
--coarse_sampling
Allow coarser sampling . flag only. (default False)
--no_of_pool_part
Number of pooled particles parameter controls how many particles are read together for each thread. (default 3)
--use_gpu
Whether to use gpu for computation or not. (default False)
--which_gpu
the index value of the GPU to use. (default None)
--submission_template
Submission template for MPI command. In case of running this tool on a cluster, always a submission template. The number of MPI processors and threads in the submission template should be the same as the one specified below in the MPI procs and threads value.(default none)
--submission_command
Submission commmand for cluster (default sbatch)
--relion_mpirun_executable
Since there can be more than one mpirun environment installed on a workstation or on a cluster. It can be sometimes necessary to provide the relion specific mpirun executable. Just type which mpirun -a in a terminal and choose the one which relion requires. (default mpirun)
--relion_ctfrefine_executable
Similar to the issue of relion mpirun executable, it can be sometime necessary to provide the specific relion polishing executable also. Just type which relion_ctf_refine_mpi and copy the path here. (default relion_ctf_refine_mpi)
--mpi_procs
The number of MPI processors used for Relion multiprocessing. For training part only one MPI processors is used. In case when running the program on cluster, the MPI processors value should be same as used in the submission template.(default 1)
The number of threads use during the polishing. In case when running the program on cluster, the thread value should be same as used in the submission template.(default 1)

--abs_greyscale_map
Ref map is on absolute greyscale . Whether the reference map is on absolute greyscale level or not. (default False)
--use_fast_sets
Use fast subsets for large datasets . if selected the first 5 iterations will be done with random subsets of only K*1500 particles. (default False)
--skip_img_align
Skip image alignment . Whether to skip image alignment or not . (default False)
--ang_search
Perform local angular searches . Whether to perform angular search or not. (default False)
--ang_search_range
Local angular search range . in case if is set to Yes, value is multiplied by 0.33333. (default 5)
--ang_search_relax_sym
to relax symmetry . (default None)
--para_io
Use parallel disc I/O. (default True)
depends on the answer for skip padding, if set to No , then pad is 2 , if set to yes then pad is 1. (default False)
--skip_grid
Whether to skip the grid or not. (default True)
Pre-read all particles in memory. (default False)
--scratch_dir
Copy particles to search directory. if –preread_images is set to No and if a directory link is provided in Copy particles to scratch directory (default None)
--combine_iter_disc
Combine iterations through disc. Whether to combine iterations or not. (default False)
--mrc_reloc_folder
mrc relocation folder
In case if the mrcs images were moved from original location where they were generated to a new location. Then the user has to provide a path directory link to the new location . (default None)
--helical_recons
Do helical reconstruction.(default False)
--inner_diam
Helical tube inner diameter (A). (default -1)
--outer_diam
Helical tube outer diameter (A). (default -1)
--sig_tilt
angular search range value in degrees for tilt. (default 15)
--sig_psi
angular search range value in degrees for psi. (default 10)
--sig_rot
angular search range value in degrees for rot. (default -1)
--sigma_dist
Range factor of local averaging
Local averaging of orientations and translations will be performed within a range of +/- this value * the box size.(default 1.5)
--keep_tilt_fix
Tilt prior will not change during the optimization. (default True)
--apply_helical_sym
Whether to apply helical symmetry or not . (default False)
--unique_asym_unit
Number of unique asymmetrical units in each segment box. (default 1)
--initial_twist
Initial twist (deg) set to positive value if it is a right-handed helix. (default 0)
--initial_rise
Initial rise (A) set to positivie value .(default 0)
--z_percent
Central Z length (%) for information from the central part of the box is used for search and imposing helical symmetry in real space. (default 30)
--do_local_search
Peform local searches of helical twist and rise within given range . (default False)
--twist_min
Miniumum value for twist search (deg). Set it to a positive value if it is a right-handed helix. (default 0)
--twist_max
Maxiumum value for twist search (deg). (default 0)
--twist_inistep
Need to set manually set if the default value (deg) does not guarantee convergence. (default 0)
--rise_min
Rise search minimum value (A) . Set is to a positive value in angstorms. (default 0)
--rise_max
Rise search maxiumum value (A). (default 0)
--rise_inistep
Rise search initial step (A). Need to set manually set if the default value does not guarantee convergence. (default 0)

## Output

3dstack.star
Output star file.
bdb:3dclassified_stack
: 3dclassified stack. (still in test phase)
BDB2STAR
Using sphire2relion tool , the bdb stack is converted to star file so that it can be used in relion. The star file is saved in BDB2STAR folder.
PostProcess
Since the input to the tool is Post refiner directory, the tool can automatically create the necessary file in PostProcess folder which is necessary to provide for ctf refinement.

To run it properly on cluster. Do the following task before running in case if you are running from MPI dortmund. These settings can be different if you are using it outside.

module unload sphire (unload the module sphire)

module load sphire/clem/Polishing_SPHIRE_v1.2 or sphire/clr/Polishing_SPHIRE_v1.2 (this has to be done only in case if you have a different installation then the default one, since this tool is still not released, the git branch is different).



Then go to the directory where you have all the data folders. Like Meridien , Post Refiner, ISAC etc etc. It is recommended to start SPHIRE in the folder structure where all the output folders are present e.g Post refinenment output folder, motioncorr output folder , ISAC substack output folder.

## Description

### Developer Notes

Apply relion 3D classification using SPHIRE GUI.

### Keywords

Category 1:: APPLICATIONS

### Files

sphire/bin/sp_relion_3dclassifi.py

### Maturity

Beta:: Under evaluation and testing. Please let us know if there are any bugs.