RELION to SPHIRE Conversion: Create several types of parameter text files and per-micrograph virtual stacks of particle images in bdb format from parameters stored in a RELION STAR file
Usage in command line
sp_relion2sphire.py input_star_file output_directory --relion_project_dir=DIR_PATH --star_section=SECTION_STRING --outputs_root=ROOT_NAME_STRING --box_size=BOX_SIZE --do_not_create_stack
sp_relion2sphire does not support MPI.
sp_relion2sphire.py 'Particles.star' 'Sphire_Project' --box_size=256 --do_not_create_stack sp_relion2sphire.py 'Refine3D/run1_data.star' 'Sphire_Project' --star_section='data_images' --box_size=100 --do_not_create_stack sp_relion2sphire.py 'Relion_Project/Refine3D/run1_data.star' 'Sphire_Project' --relion_project_dir='Relion_Project' --outputs_root='my_protein' --do_not_create_stack
The program copies the subdirectory structure under the RELION project directory based on the information stored in the input RELION STAR file. For example, if two sets of micrographs are stored in two different subdirectories (e.g. “EM_Session01” and “EM_Session02” under a root micrograph directory (e.g. “Micrograph”), the program creates two subdirectories under the user-specified output directory (e.g. “Sphire_Project/EM_Session01” and “Sphire_Project/EM_Session02”). Each output subdirectory will contain the files in the table below.
File Name | Discription | ||
*_micrographs.txt | Text file containing a list of micrograph names/paths (Micrograph selection file). It can be used as input of sp_cter, sp_window, sp_unblur, sp_summovie, and sp_pipe organize_micrographs. (requires Micrographs Category) | ||
*_cter_partres.txt | Text file containing a list of CTF parameters in CTER format (CTER partres file). It can be used as an input of sp_gui_cter and sp_window. (requires CTF Estimation Category) | ||
Coordinates/*.box | Coordinates files. One for each micrograph. These files can be used as inputs of sp_window. (requires Particle Extraction Category) | ||
Rebox/*.rbx | SPHIRE rebox files. One for each micrograph. These files can be used as inputs of sp_rewindow. (requires Particle Extraction Category) | ||
EMAN2DB/*_stack.bdb | Per-micrograph virtual stacks of particle meta information in bdb format (only when --do_not_create_stack is not used) containing the header entries associated with the extracted information. (requires Particle Extraction Category) |
Run the script to create several types of parameter text files and particle image stack in SPHIRE format from parameters stored in a RELION STAR file. The RELION STAR should contain entries related to Micrographs, CTF Estimation, Particle Extraction, 3D Alignment, or/and Random Subset. The entries for Micrographs category are required. If it does not contain some parameters associated with CTF Estimation, Particle Extraction, 3D Alignment, or/and Random Subset, then the command does not produce the related output file(s).
The following RELION STAR file entries are necessary to extract information for certain categories. The entries can exist in the file but won't be used by this command.
Category | Required entries | Optional entries | Dependent category | ||||
Micrographs (Required) | _rlnMicrographName | None | None | ||||
CTF Estimation | _rlnDefocusU _rlnDefocusV _rlnDefocusAngle _rlnAmplitudeContrast _rlnVoltage _rlnSphericalAberration _rlnMagnification | _rlnPhaseShift _rlnCtfFigureOfMerit _rlnCtfMaxResolution _rlnCtfImage | Micrographs | ||||
Particle Extraction | _rlnImageName _rlnCoordinateX _rlnCoordinateY | None | Micrographs | ||||
3D Alignment | _rlnOriginX _rlnOriginY _rlnAngleRot _rlnAngleTilt _rlnAnglePsi _rlnMaxValueProbDistribution _rlnNormCorrection | None | None | ||||
Random Subset | _rlnRandomSubset | None | None |
The script sets the following header entries of EMAN2DB/*_stack.bdb or *_stack.hdf.
Header Entry | Discription | ||
ptcl_source_relion | RELION's image name (_rlnImageName) which the script extracted this particle image. | ||
ptcl_source_image | Micrograph path (relative path) where RELION extracted this particle image. | ||
ptcl_source_coord | Coordinates of this particle in the Micrograph in SPHIRE format. | ||
ptcl_source_coord_id | Coordinates ID in the original coordinate file RELION used. | ||
data_path | Relative path to the original particle image location. | ||
data_n | Serial particle image ID. Here, it is same as ptcl_source_coord_id. | ||
resample_ratio | Resampling ratio of dimensions or pixel size of extracted particle images relative to micrograph. Here, it is always set to 1.0. | ||
ctf | CTF parameters. | ||
ctf_applied | Flag indicating if CTF parameters are applied to image or not. | ||
ptcl_source_apix | Pixel size of the associated micrograph. | ||
xform.projection | 3D projection parameters. | ||
relion_max_prob_dist | Maximum probability distribution value computed by RELION. | ||
relion_norm_correct | Normalisation correction value computed by RELION. | ||
chunk_id | Chunk ID (or Subset ID) where this particle belongs. |
NOTE: If you run sp_window using the coordinates files generated by this script, ptcl_source_coord_id will be reassigned. It can be different from the RELION's local particle ID (the number before '@' in ptcl_source_relion).
These changes require user not to break the relative path whenever they move or copy the micrographs because sp_relion2sparx.py use full name including the path stored in the input RELION STAR file.
The program does not generate the following output files anymore.
File Name | Discription | ||
sphire_stack_ctf.txt | Text file containing a list of CTF parameters. It can be used as an input of sp_header --params=ctf. (requires CTF Estimation Category) | ||
sphire_stack_proj3d.txt | Text file containing a list of 3D projection parameters. It can be used as an input of sp_header --params=xform.projection. (requires 3D Alignment Category) | ||
sphire_stack_chunk*.txt | Text file containing a list of particle IDs for the subset (#0 and #1). It can be used as an input of sp_header --params=chunk_id. (requires Random Subset Category) |
To create these files, please use sp_header to extract information from the output stack or rewindowed stack with the output SPHIRE rebox files using sp_rewindow.
Toshio Moriya Markus Stabrin
Category 1:: APPLICATIONS
sparx/bin/sp_relion2sphire.py
sp_cter, sp_gui_cter, sp_window, sp_rewindow, sp_header, sp_pipe organize_micrographs, sp_unblur, and sp_summovie.
Beta:: Under evaluation and testing. Please let us know if there are any bugs.
There are no known bugs so far.