RELION Jobs: Maps, Post-processing and Utilities
RELION post-processing, local resolution, masks, map utilities, ModelAngelo and external jobs
This page covers the RELION post-processing, local resolution, mask creation, map utility, ModelAngelo model building, and external job types registered in ccpem-pipeliner. These jobs sit at the later stages of a typical SPA pipeline — after 3D refinement — and handle sharpening, resolution estimation, masking, map manipulation, automated model building, and wrapping arbitrary external scripts. Understanding the exact process names, input/output nodes, and key option keys lets you chain these jobs programmatically into automated workflows.
All jobs on this page are used through the same two interfaces: the pipeliner CLI (with a run.job or job.star file) and the PipelinerProject Python API. The pattern is identical regardless of job type:
- Generate a default parameter file.
- Edit it to set your inputs and options.
- Run or schedule the job.
Generating default parameter files
For CLI use, generate a run.job file (labels as keys):
pipeliner --default_runjob relion.postprocess
# writes relion_postprocess_run.job
For Python API use, generate a job.star file (option keys as keys):
pipeliner --default_jobstar relion.postprocess
# writes relion_postprocess_job.star
Running a job from the CLI
Edit the generated file to set your inputs, then run:
pipeliner --run_job relion_postprocess_run.job
To overwrite an existing job in place:
pipeliner --run_job relion_postprocess_run.job --overwrite PostProcess/job005/
To continue a job that supports continuation:
pipeliner --continue_job PostProcess/job005/
Running a job from the Python API
import os
os.chdir("/path/to/my/project")
from pipeliner.api.manage_project import PipelinerProject
from pipeliner.api.api_utils import write_default_jobstar, edit_jobstar, job_default_parameters_dict
proj = PipelinerProject()
Set options via a parameters dict (use option keys, not labels):
params = job_default_parameters_dict("relion.postprocess")
params["fn_in"] = "Refine3D/job003/run_half1_class001_unfil.mrc"
params["fn_mask"] = "MaskCreate/job004/mask.mrc"
params["do_auto_bfac"] = "true"
job = proj.run_job(params, run_in_foreground=True)
Or use write_default_jobstar / edit_jobstar / run_job with a file:
template = write_default_jobstar("relion.postprocess")
out_star = edit_jobstar(
template,
{"fn_in": "Refine3D/job003/run_half1_class001_unfil.mrc",
"fn_mask": "MaskCreate/job004/mask.mrc"},
"my_postprocess.star",
)
job = proj.run_job(out_star, run_in_foreground=True)
Job option assignment via the API object
If you have a PipelinerJob object directly, set option values via the .value property:
from pipeliner.job_factory import new_job_of_type
job = new_job_of_type("relion.maskcreate")
job.joboptions["fn_in"].value = "Refine3D/job003/run_class001.mrc"
job.joboptions["lowpass_filter"].value = 15
job.joboptions["inimask_threshold"].value = 0.02
Job reference
relion.postprocess — RELION post-processing
Class: PostprocessJob | Output directory: PostProcess/
Sharpens and masks a map from 3D refinement using the gold-standard FSC procedure (relion_postprocess). Supports continuation (can_continue=True).
Key inputs
| Option key | Type | Description |
|---|---|---|
fn_in | InputNode | One of the two unfiltered half-maps; file name must contain half |
fn_mask | InputNode | Soft-edged solvent mask (values 0–1) |
fn_mtf | InputNode | MTF STAR file (optional) |
Key options
| Option key | Default | Description |
|---|---|---|
angpix | (blank) | Calibrated pixel size in Å; if blank, read from MRC header |
do_auto_bfac | true | Estimate B-factor automatically (Rosenthal & Henderson) |
autob_lowres | 10 | Lowest resolution (Å) for auto-B fit |
do_adhoc_bfac | false | Use a manually supplied B-factor instead |
adhoc_bfac | -1000 | User B-factor (negative = sharpening); required when do_adhoc_bfac=true |
mtf_angpix | (blank) | Original detector pixel size (Å); used only when fn_mtf is set |
do_skip_fsc_weighting | false | Skip FSC weighting and apply an ad-hoc low-pass filter instead |
low_pass | 5 | Ad-hoc low-pass filter (Å); required when do_skip_fsc_weighting=true |
Validation: at least one of do_auto_bfac or do_adhoc_bfac must be true. If both are true, the automatic B-factor is used.
Outputs
| File | Node type |
|---|---|
postprocess.mrc | DensityMap |
postprocess_masked.mrc | DensityMap |
postprocess.star | ProcessData |
logfile.pdf | LogFile |
Cleanup removes postprocess_masked.mrc (non-harsh).
relion.localres.own — RELION local resolution
Class: RelionLocalResOwn | Output directory: LocalRes/
Calculates local resolution by sweeping a soft spherical mask across the map using relion_postprocess --locres. Does not support continuation (can_continue defaults to False).
Key inputs
| Option key | Type | Description |
|---|---|---|
fn_in | InputNode | One of the two unfiltered half-maps; name must contain _half |
fn_mask | InputNode | Solvent mask for the local resolution histogram |
fn_mtf | InputNode | MTF STAR file (optional) |
Key options
| Option key | Default | Description |
|---|---|---|
angpix | 1 | Calibrated pixel size in Å (required) |
adhoc_bfac | -100 | B-factor for sharpening during local resolution calculation |
Accepts MPI (get_runtab_options(mpi=True, threads=False)) and additional args.
Outputs
| File | Node type |
|---|---|
histogram.pdf | LogFile |
relion_locres_filtered.mrc | DensityMap |
relion_locres.mrc | Image3D |
relion.localres.resmap — RELION ResMap local resolution
Class: RelionLocalResResMap | Output directory: LocalRes/
Calculates local resolution using the external ResMap program. The ResMap executable is found via PIPELINER_RESMAP_EXECUTABLE or RELION_RESMAP_EXECUTABLE; defaults to ResMap-1.1.4-linux64 (Linux) or ResMap-1.1.4-mac64 (macOS).
Key inputs — same as relion.localres.own (fn_in, fn_mask, angpix).
Key options
| Option key | Default | Description |
|---|---|---|
pval | 0.05 | P-value threshold |
minres | 0.0 | Highest resolution to evaluate (Å); 0 = auto |
maxres | 0.0 | Lowest resolution to evaluate (Å); 0 = auto |
stepres | 1.0 | Resolution step size (Å) |
Output: half1_resmap.mrc (Image3D).
relion.maskcreate — RELION mask creation
Class: RelionMaskCreate | Output directory: MaskCreate/
Creates a 3D soft-edged mask from a density map using relion_mask_create. Supports continuation (can_continue=True).
Key inputs
| Option key | Type | Description |
|---|---|---|
fn_in | InputNode | Input 3D MRC map (DensityMap) |
Key options
| Option key | Default | Description |
|---|---|---|
lowpass_filter | 10 | Low-pass filter applied before binarisation (Å) |
angpix | (blank) | Pixel size (Å); read from header if blank |
inimask_threshold | 0.02 | Initial binarisation threshold |
extend_inimask | 3 | Extend binary mask by this many pixels |
width_mask_edge | 3 | Width of the raised-cosine soft edge (pixels) |
do_helix | false | Generate a cylindrical helical mask spanning Z |
helical_z_percentage | 30.0 | Central Z fraction (%) for helical mask |
Uses threads (get_runtab_options(mpi=False, threads=True)). Number of threads is passed to relion_mask_create --j.
Output: mask.mrc (Mask3D).
relion.map_utilities.filter_map — Filter map
Class: RelionFilterMap | Output directory: FilterMap/
Applies low-pass and/or high-pass filters to one or more maps using relion_image_handler. Accepts multiple input maps (MultiInputNodeJobOption).
Key inputs
| Option key | Type | Description |
|---|---|---|
input_map | MultiInputNode | One or more input DensityMap nodes |
Key options
| Option key | Default | Description |
|---|---|---|
do_lowpass | false | Apply a low-pass filter |
lowpass | 1 | Low-pass filter resolution (Å); required when do_lowpass=true |
do_highpass | false | Apply a high-pass filter |
highpass | 1 | High-pass filter resolution (Å); required when do_highpass=true |
do_advanced | false | Enable advanced options |
filter_direction | non-directional | Directionality of low-pass filter (non-directional, X, Y, Z) |
filter_edge_width | 2 | Filter edge width in resolution shells (advanced) |
Validation: at least one filter type must be enabled; low-pass and high-pass values must not be identical.
Outputs: one <basename>_filtered.mrc per input map, with node type inherited from the input node.
relion.map_utilities.flip_handedness — Flip map handedness
Class: RelionFlipMap | Output directory: Flip/
Flips the handedness of one or more maps using relion_image_handler --invert_hand. Accepts multiple input maps.
Key inputs
| Option key | Type | Description |
|---|---|---|
input_map | MultiInputNode | One or more input DensityMap nodes |
Outputs: one <basename>_flipped.mrc per input map.
relion.map_utilities.apply_symmetry — Apply symmetry
Class: RelionApplySymmetry | Output directory: ApplySymmetry/
Applies the chosen symmetry operator to one or more maps using relion_image_handler --sym.
Key inputs
| Option key | Type | Description |
|---|---|---|
input_map | MultiInputNode | One or more input DensityMap nodes |
Key options
| Option key | Default | Description |
|---|---|---|
sym | Cyclic (C) | Symmetry type: Cyclic (C), Dihedral (D), Tetrahedral (T), Octahedral (O), Icosahedral (I) |
fold | 1 | Symmetry fold (required for C and D; ignored for T, O, I) |
Outputs: one <basename>_<sym>sym.mrc per input map.
relion.map_utilities.align_symmetry — Align map symmetry
Class: RelionAlignSymmetry | Output directory: AlignSymmetry/
Aligns the symmetry axes of a map onto the main XYZ coordinate axes using relion_align_symmetry. Takes a single input map.
Key inputs
| Option key | Type | Description |
|---|---|---|
input_map | InputNode | Input DensityMap |
Key options
| Option key | Default | Description |
|---|---|---|
sym | Cyclic (C) | Symmetry type |
fold | 1 | Symmetry fold |
box_size | 64 | Box size for symmetry search (advanced) |
do_recentre | true | Recentre the map before finding symmetry axes |
nr_uniform | 400 | Number of uniform orientations to search |
only_rot | false | Search only rotations (fix tilt and psi) |
Output: aligned.mrc (DensityMap).
relion.map_utilities.apply_bfactor — Apply B-factor
Class: RelionApplyBFactor | Output directory: BFactor/
Applies a user-specified B-factor to one or more maps using relion_image_handler --bfactor.
Key inputs
| Option key | Type | Description |
|---|---|---|
input_map | MultiInputNode | One or more input DensityMap nodes |
Key options
| Option key | Default | Description |
|---|---|---|
bfact | -100 | B-factor to apply (Ų); use negative values for sharpening |
Outputs: one <basename>_bfact.mrc per input map.
relion.map_utilities.rebox_rescale_map — Change map box and pixel size
Class: RelionReboxRescaleMap | Output directory: ReboxRescale/
Modifies box size and/or pixel size of one or more maps using relion_image_handler. When both operations are applied, the new box size must be even.
Key inputs
| Option key | Type | Description |
|---|---|---|
input_map | MultiInputNode | One or more input DensityMap nodes |
Key options
| Option key | Default | Description |
|---|---|---|
do_rebox | false | Trim or pad the map to a new box size |
box_size | 100 | New box size in pixels (required when do_rebox=true) |
do_rescale | false | Resample the map at a new pixel size |
rescale_angpix | 1.0 | New pixel size (Å; required when do_rescale=true) |
force_pixel_size | true | Force the header pixel size to exactly match the requested value |
Validation: at least one of do_rebox or do_rescale must be true.
Outputs: one <basename>_reboxed.mrc, <basename>_rescaled.mrc, or <basename>_reboxed_rescaled.mrc per input map.
relion.reconstruct — RELION reconstruct
Class: RelionReconstruct | Output directory: Reconstruct/
Generates a map from a set of particles using relion_reconstruct. Optionally reconstructs half-maps when _rlnRandomSubset assignments are present in the input.
Key inputs
| Option key | Type | Description |
|---|---|---|
input_particles | InputNode | Particles STAR file (ParticleGroupMetadata) |
Key options
| Option key | Default | Description |
|---|---|---|
do_halfmaps | false | Reconstruct half-maps alongside the full map |
do_ctf | true | Apply CTF correction during reconstruction |
angpix | (blank) | Pixel size (Å); taken from first optics group if blank |
sym | C1 | Symmetry to apply |
maxres | (blank) | Maximum resolution to consider (Å); default is Nyquist |
Accepts MPI (get_runtab_options(mpi=True, threads=False)) and additional args.
Outputs
| File | Node type |
|---|---|
reconstruction.mrc | DensityMap |
reconstruction_half1.mrc | DensityMap (when do_halfmaps=true) |
reconstruction_half2.mrc | DensityMap (when do_halfmaps=true) |
Validation at run time: if do_halfmaps=true, the particles STAR file must contain a particles block with a _rlnRandomSubset column; missing either raises ValueError.
relion.reproject — RELION reproject
Class: ReprojectJob | Output directory: Reproject/
Generates 2D projections from a 3D map using relion_project. Projections can be generated from a supplied angles file or as a uniform set.
Key inputs
| Option key | Type | Description |
|---|---|---|
map_filename | InputNode | Input MRC map (DensityMap) |
angles_filename | InputNode | STAR file with Euler angles (EulerAngles; takes precedence over nr_uniform if both are set) |
Key options
| Option key | Default | Description |
|---|---|---|
nr_uniform | (blank) | Generate this many uniform projections (used only when angles_filename is blank) |
apix | (blank) | Reference pixel size (Å) |
No MPI or threads (get_runtab_options(mpi=False, threads=False)).
Outputs
| File | Node type |
|---|---|
reproj.mrcs | Image2DStack |
reproj.star | EulerAngles (only when using uniform projections) |
Validation: an angles_filename or a positive nr_uniform must be supplied; if both are set, the angles file is used.
modelangelo — ModelAngelo automated model building
Class: ModelAngelo | Output directory: ModelAngelo/
Builds an atomic model automatically from a cryo-EM map using ModelAngelo. Can optionally run an HMMer sequence search. Supports continuation (can_continue=True).
The executable is resolved via PIPELINER_MODELANGELO_EXECUTABLE or RELION_MODELANGELO_EXECUTABLE; defaults to relion_python_modelangelo if on PATH, otherwise modelangelo.
Key inputs
| Option key | Type | Description |
|---|---|---|
fn_map | InputNode | B-factor sharpened map (MRC; typically from relion.postprocess) |
fn_mask | InputNode | Optional 3D mask |
p_seq | InputNode | FASTA sequence for proteins (optional but strongly recommended) |
d_seq | InputNode | FASTA sequence for DNA (optional) |
r_seq | InputNode | FASTA sequence for RNA (optional) |
hmmer_input | InputNode | CIF model from a previous ModelAngelo job (for standalone HMMer run) |
fn_lib | InputNode | FASTA library for HMMer search (required when do_hmmer=true) |
Key options
| Option key | Default | Description |
|---|---|---|
do_hmmer | false | Run HMMer search (deactivated when sequences are provided) |
alphabet | amino | HMMer alphabet: amino, DNA, or RNA |
F1 | 0.02 | HMMer F1 parameter |
F2 | 0.001 | HMMer F2 parameter |
F3 | 0.00001 | HMMer F3 parameter |
E | 10 | HMMer E-value |
use_gpu | true | Use GPU for inference |
gpu_ids | "" | Comma-separated GPU IDs (optional override) |
Validation: hmmer_input, if set, must come from a ModelAngelo/ job directory.
Output: <job_dir_name>.cif (AtomCoords; only when fn_map is set).
relion.external — Run external program (RELION compatibility)
Class: RelionExternal | Output directory: External/
Wraps an arbitrary external script and passes standard pipeliner data nodes to it as command-line arguments. This job type is retained for compatibility with RELION's external job mechanism. For new workflows, prefer pipeliner.run_external_program.
Note:
jobinfo.alternative_unavailable_reasonis set on this job type to indicate thatpipeliner.run_external_programis the recommended replacement. The job still loads and can be run.
Key options
| Option key | Description |
|---|---|
fn_exe | Path to the external script |
in_mov | Input movies STAR (MicrographMovieGroupMetadata) — passed as --in_movies |
in_mic | Input micrographs STAR (MicrographGroupMetadata) — passed as --in_mics |
in_part | Input particles STAR (ParticleGroupMetadata) — passed as --in_parts |
in_coords | Input coordinates (MicrographCoordsGroup) — passed as --in_coords |
in_3dref | Input 3D reference map (DensityMap) — passed as --in_3Dref |
in_mask | Input 3D mask (Mask3D) — passed as --in_mask |
param1_label … param10_label | Label for optional parameter N |
param1_value … param10_value | Value for optional parameter N; passed as --<label> <value> |
fn_output | Output file name (optional; creates an output node if set) |
output_nodetype | Node type to assign to the output file |
alt_nodetype | Custom node type string (required when output_nodetype is NEW NODE TYPE (not recommended)) |
output_kwds | Keywords for the output node (separated by :::) |
No MPI; uses threads and additional args (get_runtab_options(mpi=False, threads=True, addtl_args=True)).
Success is determined by the script's exit code. The job runner writes PIPELINER_JOB_EXIT_SUCCESS when the script exits 0, and PIPELINER_JOB_EXIT_FAILED on any non-zero exit.
Generate and run a post-processing job via the Python API
import os
from pipeliner.api.manage_project import PipelinerProject
from pipeliner.api.api_utils import write_default_jobstar, edit_jobstar
os.chdir("/path/to/my/project")
proj = PipelinerProject()
# Generate a default job.star template for post-processing
template = write_default_jobstar("relion.postprocess")
# Edit the template: set the half-map, mask, and pixel size
edited = edit_jobstar(
template,
{
"fn_in": "Refine3D/job007/run_half1_class001_unfil.mrc",
"fn_mask": "MaskCreate/job008/mask.mrc",
"angpix": "1.06",
"do_auto_bfac": "Yes",
"autob_lowres": "10",
},
"postprocess_run.job.star",
)
# Run the job and wait for it to finish
job = proj.run_job(edited, run_in_foreground=True)
print(job.output_dir) # e.g. PostProcess/job009/
Run a post-processing job from the CLI
# Generate a default run.job file
pipeliner --default_runjob relion.postprocess
# This writes relion_postprocess_run.job in the current directory
# Edit the file — lines use the format: <label> == <value>
# Key lines to set:
# One of the 2 unfiltered half-maps: == Refine3D/job007/run_half1_class001_unfil.mrc
# Solvent mask: == MaskCreate/job008/mask.mrc
# Calibrated pixel size (A) == 1.06
pipeliner --run_job relion_postprocess_run.job
Create and run a mask from a refined map
import os
from pipeliner.api.manage_project import PipelinerProject
from pipeliner.api.api_utils import write_default_jobstar, edit_jobstar
os.chdir("/path/to/my/project")
proj = PipelinerProject()
template = write_default_jobstar("relion.maskcreate")
edited = edit_jobstar(
template,
{
"fn_in": "PostProcess/job009/postprocess.mrc",
"lowpass_filter": "15",
"inimask_threshold": "0.03",
"extend_inimask": "3",
"width_mask_edge": "6",
},
"maskcreate_run.job.star",
)
job = proj.run_job(edited, run_in_foreground=True)
Run ModelAngelo with a protein sequence
import os
from pipeliner.api.manage_project import PipelinerProject
from pipeliner.api.api_utils import write_default_jobstar, edit_jobstar
os.chdir("/path/to/my/project")
proj = PipelinerProject()
template = write_default_jobstar("modelangelo")
edited = edit_jobstar(
template,
{
"fn_map": "PostProcess/job009/postprocess_masked.mrc",
"p_seq": "sequences/myprotein.fasta",
"use_gpu": "Yes",
},
"modelangelo_run.job.star",
)
# Schedule now, run later
job = proj.schedule_job(edited)
print(job.output_dir) # e.g. ModelAngelo/job010/
Apply symmetry to a map
import os
from pipeliner.api.manage_project import PipelinerProject
from pipeliner.api.api_utils import write_default_jobstar, edit_jobstar
os.chdir("/path/to/my/project")
proj = PipelinerProject()
template = write_default_jobstar("relion.map_utilities.apply_symmetry")
edited = edit_jobstar(
template,
{
"input_map": "PostProcess/job009/postprocess.mrc",
"sym": "Cyclic (C)",
"fold": "4",
},
"apply_symmetry_run.job.star",
)
job = proj.run_job(edited, run_in_foreground=True)
# Output: ApplySymmetry/job011/postprocess_c4sym.mrc
Run RELION local resolution and continue post-processing
import os
from pipeliner.api.manage_project import PipelinerProject
from pipeliner.api.api_utils import write_default_jobstar, edit_jobstar
os.chdir("/path/to/my/project")
proj = PipelinerProject()
template = write_default_jobstar("relion.localres.own")
edited = edit_jobstar(
template,
{
"fn_in": "Refine3D/job007/run_half1_class001_unfil.mrc",
"angpix": "1.06",
"fn_mask": "MaskCreate/job008/mask.mrc",
"adhoc_bfac": "-50",
"nr_mpi": "4",
},
"localres_run.job.star",
)
job = proj.run_job(edited, run_in_foreground=True)
# Outputs: LocalRes/jobNNN/relion_locres.mrc, relion_locres_filtered.mrc, histogram.pdf
Wrap an external script with relion.external
import os
from pipeliner.api.manage_project import PipelinerProject
from pipeliner.api.api_utils import write_default_jobstar, edit_jobstar
os.chdir("/path/to/my/project")
proj = PipelinerProject()
template = write_default_jobstar("relion.external")
edited = edit_jobstar(
template,
{
"fn_exe": "/path/to/my_script.sh",
"in_mic": "MotionCorr/job002/corrected_micrographs.star",
"param1_label": "threshold",
"param1_value": "0.5",
"fn_output": "my_result.star",
"output_nodetype": "ParticleGroupMetadata",
},
"external_run.job.star",
)
job = proj.run_job(edited, run_in_foreground=True)
The script at /path/to/my_script.sh will be called with --in_mics, --o, and --threshold 0.5 arguments. It must exit with code 0 on success. The pipeliner writes PIPELINER_JOB_EXIT_SUCCESS or PIPELINER_JOB_EXIT_FAILED in the job directory based on the exit code.