samrelion.py

(Last update 07/27/2013, Maofu Liao)

Get Samrelion.py

A mini package of "samrelion.py" can be downloaded from here: [pkg_samrelion.tar]
Untar the files. "samrelion.py" can run without the whole SAMUEL package.

 

Run Samrelion.py

Samrelion.py operates in the following 4 modes. Each mode contains a set of functions.
===> Usage: samrelion.py 
     setup : Input parameters
     cmd : Print commands
     new : New star file
     data : Analyze *dat.star file
     2dcls : 2D classification


(1) "setup" mode to input parameters for printing out commands
      "samrelion.inp" is created if not already present. If present, the parameters will be displayed and ready to be modified.
      Some parameters only affect certain RELION functions, indicated as [3D only], [CLS only], etc.
 
 
(2) "cmd" mode to print out commands
===> Usage: samrelion.py cmd 3dcls/3dref/2dcls

    [Example] samrelion.py cmd 3dcls

    Note that only parameters are printed out. The RELION (and MPI) program path has to be added to complete the command.

    For example: mpirun -np 9 relion_refine_mpi ...(the printed out parameters)...
 
 
(3) "new" mode to generate a new star file
===> Usage: samrelion.py new Star_file Stack1_name,kV,Cs,Wgh,DF_file[--selection] [Stack2_name,kV,Cs,Wgh,DF_file[--selection]]
     Stack_name : Particle stack name (*.mrcs), the stack should match the DF_file;
     DF_file : *.par or *.def, --selection also give IDs for "ID@Stack.mrcs"
    [Example] samrelion.py new all_img.star stack.mrcs,300,2.0,0.1,output.par
    (*.par or *.def can be generated from defocus calculation using samdefocus.py)
    This is derived from a shell script from Relion Wiki.
 
 
(4) "data" mode to analyze "*_data.star" files
 
===> Usage: samrelion.py data *_data.star METHOD PARAMETERS...
     count    Column_Name Selection
     dfmerge  Column_name(e.g. MicrographName) MinGrpSize(e.g. 20) 
     makesel  Column_name(e.g. ClassNumber)
     replace  Column_Name New_Value
     select   Column_Name Selection(or Min----Max)
     unique   Column_Name1 [Column_Name2 ...]
     stable   Column_Name(e.g. ClassNumber) File1(#)--#list [File2(#)--#list ...] [--grp=1,6--2-4]
 
    (count) [Example] samrelion.py data relion_it025_data.star count ClassNumber 1-4
        This generates a "rlnct_ClassNumber.plt" file, containing the total number of each class.
 
    (dfmerge) [Example] samrelion.py data relion_it025_sel01_data.star dfmerge MicrographName 20
        Some micrographs contain very few particles, and it is better to merge them with the particles with similar defocus values. (It seems that 20 is the smallest number for one group to prevent warning message shown by Relion.) Here is the grouping procedure suggested in Relion Wiki
 
     (makesel) [Example] samrelion.py data relion_it025_sel01_data.star makesel ClassNumber
          Make a selection folder with a set of selectiion files ("sel/sel#####.dat") according to the *_data.star file. For example, this can generate the required selection files to display particle numbers for each class average from Relion 2D classification (in SamViewer mode 3).
 
     (replace) ...
 
    (select) [Example] samrelion.py data relion_it025_data.star select ClassNumber 1-2
        This selects the data lines with ClassNumber = 1 or 2, and saves into a new start file "rlnsel_ClassNumber_1_2.star". The particle IDs are saved into a list file "rlnsel_ClassNumber_1_2.plt". Note that the selection can base on any data Column_name, and also on a range of actual data values.
 
    (unique) ...
 
    (stable) [Example] samrelion.py data relion_it025_data.star stable ClassNumber relion_it###_data.star--0-25
        According to Relion Wiki, for 3D classification, "there is currently no convergence criterion implemented, so the user is responsible for monitoring the convergence." It is not easy to tell whether 3D classification becomes stable after certain number of iterations. 
        This script checks the Class assignment of every particle in each cycle. The command above generates an overall stability analysis file "rlnstable.plt", which contains the number of stable particles (the class assignment of a certain cycle is the same as that of the last cycle), for the whole data set as well as for each class. Another generated file "rlnstable_parts.plt" summarizes, during all these 25 cycles, the chances of each particle to be grouped into each class.
        Note that 2 or more classes can be considered as one class by providing a "--grp" option. For example, "--grp=1,6--2-4" will consider 1 and 6 as one class, 2, 3 and 4 as another class.
 
 
(5) "2dcls" mode to run 2D classification
 
===> Usage: samrelion.py 2dcls setup/run
 
    Run Relion 2D classification. It can automatically run multiple rounds of 2D classification for predetermined groups/classes such as those from "samtree2dv2.py" and "samclasscas.py".
 
AttachmentSize
File pkg_samrelion.tar100 KB