This is an old revision of the document!
RELION to SPHIRE Conversion: Create several types of parameter text files and a particle image stack in SPHIRE format from parameters stored in a RELION STAR file
Usage in command line
sxrelion2sphire.py input_star_file output_directory --star_section=STAR_SECTION --box_size=BOX_SIZE --create_stack
sxrelion2sphire does not support MPI.
sxrelion2sphire.py Particles.star sphire_dir --box_size=256 --create_stack sxrelion2sphire.py Refine3D/run1_data.star sphire_dir --star_section=data_images --box_size=100 --create_stack
File Name | Discription | ||
sphire_micrographs.txt | Text file containing a list of micrograph names/paths (Micrograph selection file). It can be used as input of sxcter, sxwindow, sxunblur, sxsummovie, and sxpipe organize_micrographs. (requires Micrographs Category) | ||
sphire_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 sxgui_cter and sxwindow. (requires CTF Estimation Category) | ||
sphire_stack_ctf.txt | Text file containing a list of CTF parameters. It can be used as an input of sxheader --params=ctf. (requires CTF Estimation Category) | ||
Coordinates/*.box | Coordinates files. One for each micrograph. It can be used as an input of sxwindow. (requires Particle Extraction Category) | ||
sphire_stack_proj3d.txt | Text file containing a list of 3D projection parameters. It can be used as an input of sxheader --params=xform.projection. (requires 3D Alignment Category) | ||
sphire_stack_chunk*.txt | Text file containing a list of particle IDs for the subset (typically #0 and #1). It can be used as an input of sxheader --params=chunk_id. (requires Random Subset Category) | ||
sphire_stack.hdf | Particle image stack (only when --create_stack option is 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). Make sure the current directory is the project folder of the RELION (where you run RELION GUI).
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 adds or sets the following header entries of sphire_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_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. | ||
chunk_id | Chunk ID (or Subset ID) where this particle belongs. |
NOTE: If you run sxwindow 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).
Toshio Moriya
Category 1:: APPLICATIONS
sparx/bin/sxrelion2sphire.py
Beta:: Under evaluation and testing. Please let us know if there are any bugs.
There are no known bugs so far.