RELION Jobs: Import and Preprocessing
RELION jobs from import through motion correction, CTF, picking, extraction and selection
This page documents every RELION job type involved in the import-through-selection preprocessing pipeline: importing raw movies and other data, motion correction, CTF estimation, manual and automated particle picking, particle extraction, and subset selection (including joining STAR files). Understanding these jobs and their exact option keys is essential for scripting reproducible, headless workflows with PipelinerProject or the pipeliner CLI.
All jobs on this page follow the same lifecycle: create a parameter file or dict, schedule the job, and (optionally) run it. The three most common patterns are shown below.
1. CLI: generate a default parameter file and run it
For any job type, replace dots with underscores to form the file name:
pipeliner --default_runjob relion.import.movies
# Generates: relion_import_movies_run.job
# Edit the generated file, then run:
pipeliner --run_job relion_import_movies_run.job
The run.job format uses <option label> == <value> lines. For example, the movies import job file starts with:
job_type == relion.import.movies
is_continue == false
is_tomo == false
Raw input files: == Movies/*.tif
Are these multi-frame movies? == Yes
...
Labels must match exactly those printed by pipeliner --default_runjob. Lines are matched to options by label, and a line whose label doesn't match is silently ignored: no error is raised, the option keeps its default value, and a no value for ... using default value warning is logged.
2. Python API: run a job from a dict
Pass a dict whose _rlnJobTypeLabel key names the job type. All other keys are option names (not labels). Import PipelinerProject from pipeliner.api.manage_project:
import os
from pipeliner.api.manage_project import PipelinerProject
os.chdir("/path/to/my/project")
proj = PipelinerProject(make_new_project=True)
job = proj.run_job(
{
"_rlnJobTypeLabel": "relion.import.movies",
"fn_in_raw": "Movies/*.tif",
"angpix": "1.06",
"kV": "300",
"Cs": "2.7",
"Q0": "0.1",
"is_multiframe": "Yes",
"optics_group_name": "opticsGroup1",
},
run_in_foreground=True,
)
print(job.output_dir) # e.g. Import/job001/
Unknown option keys raise ValueError('Parameter <name> is not found in jobtype <type>').
3. Python API: continue an existing job
# After the job has succeeded, edit continue_job.star in the job directory,
# then call:
cont = proj.continue_job("MotionCorr/job002/", run_in_foreground=True)
Most RELION preprocessing jobs support continuation (can_continue=True). These jobs on this page cannot be continued: relion.import, relion.import.coordinates, relion.joinstar.movies, relion.joinstar.micrographs, relion.joinstar.particles, relion.select.interactive, relion.select.onvalue, relion.select.class2dauto, relion.select.discard, relion.select.split and relion.select.removeduplicates. Of the import jobs, only relion.import.movies can be continued.
Job option values
Set option values via the .value property on the joboptions dict:
from pipeliner.job_factory import new_job_of_type
job = new_job_of_type("relion.motioncorr.own")
job.joboptions["input_star_mics"].value = "Import/job001/movies.star"
job.joboptions["dose_per_frame"].value = "1.2"
job.joboptions["do_dose_weighting"].value = "Yes"
Checking availability
A job with missing executables loads normally but has job.jobinfo.is_available == False and job.jobinfo.unavailable_message set. You can still schedule it; it will fail at execution time.
from pipeliner.job_factory import new_job_of_type
job = new_job_of_type("relion.ctffind.ctffind4")
if not job.jobinfo.is_available:
print(job.jobinfo.unavailable_message)
# e.g. "This job has been marked unavailable because: executable 'ctffind' not found"
Example 1 — Import movies and run motion correction in sequence
This script creates a project in the current directory, imports multi-frame movies, and runs RELION's own motion correction. run_in_foreground=True ensures each job completes before the next one starts.
import os
from pipeliner.api.manage_project import PipelinerProject
os.chdir("/path/to/project")
proj = PipelinerProject(
pipeline_name="default",
project_name="My SPA project",
make_new_project=True,
)
# --- Import movies ---
import_job = proj.run_job(
{
"_rlnJobTypeLabel": "relion.import.movies",
"fn_in_raw": "Movies/*.tif",
"angpix": "1.06",
"kV": "300",
"Cs": "2.7",
"Q0": "0.1",
"optics_group_name": "opticsGroup1",
},
run_in_foreground=True,
)
# --- Motion correction (RELION's own implementation) ---
motioncorr_job = proj.run_job(
{
"_rlnJobTypeLabel": "relion.motioncorr.own",
"input_star_mics": import_job.output_dir + "movies.star",
"dose_per_frame": "1.2",
"patch_x": "5",
"patch_y": "5",
"nr_mpi": "4",
"nr_threads": "6",
},
run_in_foreground=True,
)
Example 2 — CTF estimation with CTFFIND4, then automated picking with LoG
# --- CTF estimation ---
ctf_job = proj.run_job(
{
"_rlnJobTypeLabel": "relion.ctffind.ctffind4",
"input_star_mics": motioncorr_job.output_dir + "corrected_micrographs.star",
"box": "512",
"resmin": "30",
"resmax": "5",
"dfmin": "5000",
"dfmax": "50000",
"dfstep": "500",
"dast": "100",
"use_given_ps": "Yes", # required: MotionCorr wrote float16 micrographs
"nr_mpi": "4",
},
run_in_foreground=True,
)
# --- Laplacian-of-Gaussian autopicking ---
autopick_job = proj.run_job(
{
"_rlnJobTypeLabel": "relion.autopick.log",
"fn_input_autopick": ctf_job.output_dir + "micrographs_ctf.star",
"log_diam_min": "150",
"log_diam_max": "180",
"log_invert": "Yes",
"nr_mpi": "4",
},
run_in_foreground=True,
)
Example 3 — Extract particles, then select by value
# --- Extract particles ---
extract_job = proj.run_job(
{
"_rlnJobTypeLabel": "relion.extract",
"star_mics": ctf_job.output_dir + "micrographs_ctf.star",
"coords_suffix": autopick_job.output_dir + "autopick.star",
"extract_size": "256",
"do_invert": "Yes",
"do_norm": "Yes",
"do_float16": "Yes",
"nr_mpi": "4",
},
run_in_foreground=True,
)
# --- Select particles on a metadata value (CTF max resolution) ---
select_job = proj.run_job(
{
"_rlnJobTypeLabel": "relion.select.onvalue",
"fn_data": extract_job.output_dir + "particles.star",
"select_label": "rlnCtfMaxResolution",
"select_minval": "-9999",
"select_maxval": "5",
},
run_in_foreground=True,
)
Example 4 — Generate a default run.job file and edit it for CLI use
# Generate a default parameter file for relion.motioncorr.own
pipeliner --default_runjob relion.motioncorr.own
# Produces: relion_motioncorr_own_run.job
# Edit the file: option labels must match exactly (e.g. 'Input movies STAR file:')
# Then run the job:
pipeliner --run_job relion_motioncorr_own_run.job
Example 5 — Join two micrograph STAR files
from pipeliner.api.api_utils import write_default_jobstar, edit_jobstar
# Write a default star file for joinstar micrographs
template = write_default_jobstar("relion.joinstar.micrographs")
# Edit to add the two input files (MultiInputNodeJobOption uses ':::' separator)
edit_jobstar(
fn_template=template,
params_to_change={
"fn_mics": "MotionCorr/job001/corrected_micrographs.star:::MotionCorr/job002/corrected_micrographs.star",
},
out_fn="join_mics_job.star",
)
join_job = proj.run_job("join_mics_job.star", run_in_foreground=True)
Job reference
Import
relion.import.movies — Import movies or raw micrographs
Runs relion_import. Supports continuation (can_continue=True); when the job is continued, --continue is passed to relion_import so newly added files are picked up.
Key input options:
| Option key | Label | Notes |
|---|---|---|
fn_in_raw | Raw input files: | Linux wildcard, must be inside the project |
is_multiframe | Are these multi-frame movies? | True → outputs movies.star; False → micrographs.star |
angpix | Pixel size (Angstrom): | required |
kV | Voltage (kV): | required |
Cs | Spherical aberration (mm): | required |
Q0 | Amplitude contrast: | required |
optics_group_name | Optics group name: | alphanumeric/underscore/hyphen only |
fn_mtf | MTF of the detector: | optional .star file |
beamtilt_x | Beamtilt in X (mrad): | default 0.0 |
beamtilt_y | Beamtilt in Y (mrad): | default 0.0 |
validate_output | Validate output files? | fails if output is empty |
Output nodes: movies.star (MicrographMovieGroupMetadata) when is_multiframe=True; micrographs.star (MicrographGroupMetadata) when False.
relion.import — Import other node types
Runs relion_import when is_relion is set (the inputs are RELION STAR files); otherwise it copies the files into the job directory. Used to import coordinates, maps, masks, optimiser files, and other data types not covered by the dedicated import jobs. Does not support continuation.
Key input option: fn_in_other — input file paths (several files of the same type can be imported at once); node_type — selects the output node type from the RELION node-type list when is_relion is set; otherwise pipeliner_node_type sets it.
relion.import.coordinates — Import particle coordinates
Copies the coordinate files into the job directory and matches them to the micrographs with helper scripts; it does not run relion_import. Does not support continuation. Output node: coordinates.star (MicrographCoordsGroup).
Motion Correction
Both motion correction jobs share the base class RelionMotionCorrJob and use relion_run_motioncorr. Both set can_continue=True and always_continue_in_schedule=True, appending --only_do_unfinished when continued.
relion.motioncorr.own — RELION's own motion correction
Key input options:
| Option key | Label |
|---|---|
input_star_mics | Input movies STAR file: |
first_frame_sum | First frame for corrected sum: |
last_frame_sum | Last frame for corrected sum: |
dose_per_frame | Dose per frame (e/A2): |
patch_x | Number of patches X: |
patch_y | Number of patches Y: |
bin_factor | Binning factor: |
bfactor | Bfactor: |
eer_grouping | EER fractionation: |
fn_gain_ref | Gain-reference image: |
fn_defect | Defect file: |
do_dose_weighting | Do dose-weighting? |
do_float16 | Write output in float16? |
do_save_ps | Save sum of power spectra? |
group_for_ps | Sum power spectra every e/A2: |
nr_mpi | Number of MPI procs: |
Output nodes: corrected_micrographs.star (MicrographGroupMetadata), logfile.pdf (LogFile).
Note: relion.motioncorr.own has no angpix option — pixel size is read from the input movies STAR file.
relion.motioncorr.motioncor2 — MotionCor2-based motion correction
Same as relion.motioncorr.own but adds:
| Option key | Label |
|---|---|
gpu_ids | Which GPUs to use: |
other_motioncor2_args | Other MOTIONCOR2 arguments |
The MotionCor2 executable is resolved from PIPELINER_MOTIONCOR2_EXECUTABLE (fallback RELION_MOTIONCOR2_EXECUTABLE), defaulting to MotionCor2.
Does not have do_float16, do_save_ps, or group_for_ps options.
CTF Estimation
Both CTF jobs share RelionCtfFindJob, running relion_run_ctffind. Both set can_continue=True and always_continue_in_schedule=True, appending --only_do_unfinished when continued.
relion.ctffind.ctffind4 — CTF estimation with CTFFIND4
Requires the ctffind executable (configurable via PIPELINER_CTFFIND_EXECUTABLE / RELION_CTFFIND_EXECUTABLE, default ctffind).
Key input options:
| Option key | Label |
|---|---|
input_star_mics | Input micrographs STAR file: |
box | FFT box size (pix): |
resmin | Minimum resolution (A): |
resmax | Maximum resolution (A): |
dfmin | Minimum defocus value (A): |
dfmax | Maximum defocus value (A): |
dfstep | Defocus step size (A): |
dast | Amount of astigmatism (A): |
do_phaseshift | Estimate phase shifts? |
phase_min | Phase shift (deg) - Min: |
phase_max | Phase shift (deg) - Max: |
phase_step | Phase shift (deg) - Step: |
use_noDW | Use micrograph without dose-weighting? |
use_given_ps | Use power spectra from MotionCorr job? |
ctf_win | Estimate CTF on window size (pix) |
validate_output | Validate output files? |
nr_mpi | Number of MPI procs: |
Output nodes: micrographs_ctf.star (MicrographGroupMetadata), logfile.pdf (LogFile).
relion.ctffind.gctf — CTF estimation with Gctf
Same output nodes as relion.ctffind.ctffind4; its options differ slightly (no use_given_ps or slow_search; adds do_ignore_ctffind_params, do_EPA, other_gctf_args and gpu_ids). Requires the Gctf executable (configurable via PIPELINER_GCTF_EXECUTABLE / RELION_GCTF_EXECUTABLE, default Gctf). The job is always reported as unavailable: jobinfo.alternative_unavailable_reason is set to Gctf is no longer supported.
Manual Particle Picking
relion.manualpick — RELION manual particle picking
Runs relion_manualpick (checks relion_display for availability). Supports continuation (can_continue=True). No MPI.
Key input options:
| Option key | Label |
|---|---|
fn_in | Input micrographs: |
diameter | Particle diameter (A): |
micscale | Scale for micrographs: |
sigma_contrast | Sigma contrast: |
lowpass | Lowpass filter (A) |
highpass | Highpass filter (A) |
angpix | Pixel size (A) |
do_color | Blue<>red color particles? |
color_label | MetaDataLabel for color: |
fn_color | STAR file with color label: |
do_topaz_denoise | OR: use Topaz denoising? |
fn_topaz_exec | Topaz executable: |
do_fom_threshold | Use autopick FOM threshold? |
minimum_pick_fom | Minimum autopick FOM: |
Output nodes: micrographs_selected.star (MicrographGroupMetadata), manualpick.star (MicrographCoordsGroup).
relion.manualpick.helical — RELION manual picking (helical)
Same options as relion.manualpick; it adds --do_startend to the relion_manualpick command. Output nodes have the same names, and manualpick.star carries the extra helixstartend keyword.
Automated Particle Picking
All autopick jobs share RelionAutoPickJob and run relion_autopick. All support continuation (can_continue=True) and always_continue_in_schedule=True. All except relion.autopick.topaz.train produce autopick.star (MicrographCoordsGroup) and logfile.pdf (LogFile).
Common input options (most autopick variants; exceptions below):
| Option key | Label |
|---|---|
fn_input_autopick | Input micrographs for autopick: |
angpix | Pixel size in micrographs (A) |
do_write_fom_maps | Write FOM maps? |
do_read_fom_maps | Read FOM maps? |
use_gpu | Use GPU acceleration? |
gpu_ids | Which GPUs to use: |
nr_mpi | Number of MPI procs: |
The LoG variants have no use_gpu or gpu_ids, the Topaz variants have no do_write_fom_maps or do_read_fom_maps, and relion.autopick.topaz.train also has no use_gpu or nr_mpi.
relion.autopick.log — Laplacian-of-Gaussian picking
Adds LoG-specific options. Does not register use_gpu or gpu_ids — adding these to a parameters dict raises ValueError.
relion.autopick.log.helical — LoG picking (helical)
Adds helical options (helical_tube_outer_diameter, helical_nr_asu, helical_rise, helical_tube_kappa_max, helical_tube_length_min, do_amyloid).
relion.autopick.ref2d — 2D reference-based template matching
Adds options: fn_refs_autopick, do_invert_refs, angpix_ref, lowpass, highpass, psi_sampling_autopick, do_ctf_autopick, do_ignore_first_ctfpeak_autopick, shrink, threshold_autopick, mindist_autopick, maxstddevnoise_autopick, minavgnoise_autopick, use_gpu, gpu_ids.
relion.autopick.ref2d.helical — 2D reference picking (helical)
Same as relion.autopick.ref2d plus the helical options listed above.
relion.autopick.ref3d — 3D reference-based autopicking
Uses a 3D map as the template.
relion.autopick.ref3d.helical — 3D reference picking (helical)
Same as relion.autopick.ref3d plus helical options.
relion.autopick.topaz.pick — Topaz neural-network picking
Runs Topaz for particle picking. When RELION 5 is detected, relion_python_topaz is used; otherwise the Topaz executable is resolved from PIPELINER_TOPAZ_EXECUTABLE / RELION_TOPAZ_EXECUTABLE, defaulting to relion_python_topaz if on PATH, otherwise topaz.
relion.autopick.topaz.pick.helical — Topaz picking (helical)
relion.autopick.topaz.train — Topaz model training
Trains a Topaz model; does not produce autopick.star. Output is a trained model node.
Particle Extraction
relion.extract — Extract particles (SPA)
Runs relion_preprocess. Supports continuation (can_continue=True) and always_continue_in_schedule=True. MPI-parallelised.
Key input options:
| Option key | Label |
|---|---|
star_mics | micrograph STAR file: |
coords_suffix | Input coordinates: |
fndata_reextract | OR: Re-extract refined particles from a STAR file: |
extract_size | Particle box size (pix): |
do_invert | Invert contrast? |
do_norm | Normalize particles? |
bg_diameter | Diameter background circle (pix): |
white_dust | Stddev for white dust removal: |
black_dust | Stddev for black dust removal: |
do_rescale | Rescale particles? |
rescale | Re-scaled size (pixels): |
do_float16 | Write output in float16? |
do_reset_offsets | Reset the refined offsets to zero? |
do_recenter | OR: re-center refined coordinates? |
recenter_x | Re-center on X-coordinate (in pix): |
recenter_y | Re-center on Y-coordinate (in pix): |
recenter_z | Re-center on Z-coordinate (in pix): |
do_fom_threshold | Use autopick FOM threshold? |
minimum_pick_fom | Minimum autopick FOM: |
nr_mpi | Number of MPI procs: |
Either coords_suffix or fndata_reextract must be set, but not both.
Output node: particles.star (ParticleGroupMetadata).
relion.extract.helical — Extract helical segments
Same as relion.extract with additional helical-specific options for segment extraction. Supports continuation.
Subset Selection
All relion.select.* jobs do not support continuation (can_continue defaults to False). Rerun them as new jobs when inputs change. None have MPI options.
relion.select.interactive — Interactive (manual) class selection
Runs relion_display. Used to manually select 2D/3D classes from an optimiser file or to select from micrograph/particle STAR files.
Key input options:
| Option key | Label |
|---|---|
fn_model | Select classes from optimiser.star: |
fn_mic | OR select from micrographs.star: |
fn_data | OR select from particles.star: |
do_regroup | Regroup the particles? |
nr_groups | Approximate nr of groups: |
image_angpix | Pixel size before extraction (A) |
Exactly one of fn_model, fn_mic, or fn_data must be set.
Output nodes: depend on input type — particles.star (ParticleGroupMetadata) and optionally class_averages.star (Image2DGroupMetadata) when selecting from a 2D model, or micrographs.star (MicrographGroupMetadata) when selecting from micrographs.
relion.select.class2dauto — Automatic 2D class selection
Runs relion_class_ranker. Accepts only the fn_model option for input.
relion.select.onvalue — Select by metadata value
Runs relion_star_handler. Selects particles or micrographs where a named column falls within a numeric range.
Key input options:
| Option key | Label | Default |
|---|---|---|
fn_data | OR select from particles.star: | |
fn_mic | OR select from micrographs.star: | |
select_label | Metadata label for subset selection: | rlnCtfMaxResolution |
select_minval | Minimum metadata value: | -9999 |
select_maxval | Maximum metadata value: | 9999 |
relion.select.removeduplicates — Remove duplicate particles
Runs relion_star_handler. Accepts fn_data, duplicate_threshold, and image_angpix. The option fn_mic is not present on this job type.
relion.select.discard — Discard particles on image statistics
Runs relion_star_handler. Selects/discards particles based on image-level statistics.
relion.select.split — Split into subsets
Runs relion_star_handler. Splits a particle or micrograph STAR file into random subsets.
Join STAR Files
All join jobs run relion_star_handler with --combine. None support continuation. Require at least two input files (validated at scheduling time; a column-mismatch error is raised at execution time).
Input uses MultiInputNodeJobOption — in run.job and star files, multiple values are joined with ::: (triple colon).
relion.joinstar.movies — Join movie STAR files
| Option key | Label |
|---|---|
fn_movs | Movie STAR files: |
Output: join_movies.star (MicrographMovieGroupMetadata).
relion.joinstar.micrographs — Join micrograph STAR files
| Option key | Label |
|---|---|
fn_mics | Micrograph STAR files: |
Output: join_mics.star (MicrographGroupMetadata).
relion.joinstar.particles — Join particle STAR files
| Option key | Label |
|---|---|
fn_parts | Particle STAR files: |
Output: join_particles.star (ParticleGroupMetadata).
Continuation behaviour summary
| Job | can_continue | Notes |
|---|---|---|
relion.import.movies | ✅ | Picks up new files with --continue |
relion.import | ❌ | Rerun as new job |
relion.import.coordinates | ❌ | Rerun as new job |
relion.motioncorr.own | ✅ | Appends --only_do_unfinished |
relion.motioncorr.motioncor2 | ✅ | Appends --only_do_unfinished |
relion.ctffind.ctffind4 | ✅ | Appends --only_do_unfinished |
relion.ctffind.gctf | ✅ | Appends --only_do_unfinished |
relion.manualpick | ✅ | |
relion.manualpick.helical | ✅ | |
relion.autopick.* | ✅ | All variants |
relion.extract | ✅ | |
relion.extract.helical | ✅ | |
relion.select.* | ❌ | All select variants |
relion.joinstar.* | ❌ | All join variants |