Skip to content

Relion 2D classification (Maximum likelihood)

Michael A. Cianfrocco edited this page Jun 7, 2018 · 1 revision

Home > 2D classification > Relion 2D classification

##Relion 2D classification

In contrast to other programs (e.g. Auto_Align.py), Relion utilizes the underlying statistics of the single particles to calculate the likelihood that a given particle belongs to a given 2D class within your dataset. Due to the way that this is calculated, this type of analysis is extremely computational intensive and requires the use of a computing cluster setup (80 - 150 CPUs per job).

  1. Inputs for 2D classification
  2. Launching & using Relion's GUI
  3. Submitting job to cluster
  4. Example cluster submission script
  5. Outputs
  6. Continuing stopped Relion run

Pro tip: Extract particles using a binning factor for 2D classification and then use the unbinned (or less binned) data for 3D classification & refinement. It will speed up 2D classification dramatically.


###Inputs for 2D classification

After extracting your particles in Relion, you will have all the inputs necessary to run 2D classification. This includes:

  • .star file generated with per-particle CTF and micrograph information. This is named [rootname].star by the extraction step.
  • .mrcs and .star files for each micrograph within the folder Particles/Micrographs

###Launching & using Relion's GUI

To begin creating the 2D classification command, first open Relion's GUI:

$ relion &

This will open Relion's general menu, where you need to provide:

  • The pixel size of the particle stacks to be analyzed (Angstrom/pixel)
  • Diameter of your sample in Angstroms

Now click on the 2D Classification tab on the left. This will bring you to a new menu. Provide the following:

  • STAR file for particle stack (e.g. [rootname].star created after particle extraction
  • Output rootname for 2D classification results
  • Number of output classes - maximum is 250 classes

Moving on to the next tab 'CTF', you need to decide if you will be correcting the CTF in your data. NOTE: you can only correct the CTF if you included CTF information during the particle extraction step.

Now going to 'Optimisation', you will provide the following:

  • The the number of iterations that you wish to analyze your data. Typically 25 (default) is pretty good, but you may need to change this depending on your data.
  • An analysis parameter that is '1' or '2' for 2D classification data. '2' means that the data more strongly drive the alignment, whereas '1' they are not weighted as strongly.

In the next tab, you will input sample for angular in-plane rotations and shifts in X & Y. The default values work well for these parameters, but you can change them depending on your sample.

After this step, you can ignore the 'Running' tab because we will be formatting our own cluster submission script.

Click 'Print command' and you will a command printed to the terminal that will look like this:

 *** The command is:
`which relion_refine` --o Class2D/run1 --i  --particle_diameter 200 --angpix 1 --ctf  --iter 25 --tau2_fudge 2 --K 1 --flatten_solvent  --zero_mask  --oversampling 1 --psi_step 10 --offset_range 5 --offset_step 2 --norm --scale  --j 1 --memory_per_thread 4

###Submitting job to cluster

Depending on your specific cluster setup, these details will change. But, generally, you will need to place this Relion command into a shell script that can be submitted to your cluster (or the cloud) so that it can run over 100+ CPUs.

Most clusters will use a job submission script like Sun Grid Engine (Oracle), where you can submit a text file using the 'qsub' command:

$ qsub relion2d_submit.run

And then you can monitor the outputs into the folder Class2D.

###Example cluster submission script

Here is an example of a cluster submission script:

#!/bin/csh

#Wall time in seconds
#$ -l h_rt=3600,m_mem_free=4g 

#Name of job
#$ -N submit_relion2d

#Use current working directory
#$ -cwd 

#Use verbose output
#$ -V

#Number of CPUs
#$ -N 120

#Submission command

mpirun -np $NSLOTS relion_refine_mpi --o Class3D/run5_test --i particles_binx2_march15_update_sel.star --particle_diameter 240 --angpix 3.54 --ref emd_2275_scaled_bin4_filt60A_sca_120.mrc --firstiter_cc --ctf --iter 3 --tau2_fudge 4 --K 2 --flatten_solvent --zero_mask --oversampling 1 --healpix_order 2 --offset_range 5 --offset_step 2 --sym C1 --norm --scale  --j 1 --memory_per_thread 4

###Outputs

As Relion runs on your cluster, there will be text output to the standard out files, which includes information that will look like this:

Auto-refine: Angular step= 3.75 degrees; local searches= false
 Auto-refine: Offset search range= 6.5 pixels; offset step= 1.5 pixels
 CurrentResolution= 18.6 Angstroms, which requires orientationSampling of at least 12.8571 degrees for a particle of diameter 160 Angstroms
 Oversampling= 0 NrHiddenVariableSamplingPoints= 479232
 OrientationalSampling= 7.5 NrOrientations= 36864
 TranslationalSampling= 3 NrTranslations= 13

For each iteration that it completes, there will be five files. For example, iteration 8 for run1:

  • run1_iter008_classes.mrcs - class average images in a .mrcs stack
  • run1_iter008_data.star - text file with per-particle CTF/score information
  • run1_iter008_model.star - STAR file that should be opened in Relion to view class averages
  • run1_iter008_optimiser.star - STAR file with 2D classification information
  • run1_iter008_sampling.star - STAR file with 2D classification information
Clone this wiki locally