CCPEM Pipeliner
Guide

Tomography Jobs: Tilt-series Processing and Reconstruction

Tomography jobs from tilt-series import through alignment, reconstruction and denoising


Overview

This page covers the complete set of tomography job types in CCPEM-Pipeliner, from importing raw tilt-series images through motion correction, CTF estimation, tilt-series alignment, tomogram reconstruction, and denoising. Tomography workflows in pipeliner are represented as directed graphs of specialised jobs that track tilt-series metadata through each processing stage in a reproducible, auditable way. Understanding the exact process names, required inputs, key options, and external programs for each job type lets you build robust automated pipelines — either via the Python API or from the command line — that can run headlessly at facilities or on HPC clusters.


Usage

Tomography jobs follow a strict data-flow order. Each job consumes a TiltSeriesGroupMetadata or TomogramGroupMetadata node produced by the previous step and emits a new node that the next job can consume. The registered tomography job types, in workflow order, are:

Process nameClassOutput
relion.importtomoRelionImportTiltSeriesMoviestilt_series.star
relion.importtomo.coordinatesRelionImportCoordinatesparticles.star
relion.motioncorr.tomo.ownTomoRelionMotionCorrOwncorrected_tilt_series.star
relion.motioncorr.tomo.motioncor2TomoRelionMotionCorrMotionCor2corrected_tilt_series.star
relion.ctffind.tomo.ctffind4TomoRelionCtfFindCtffind4tilt_series_ctf.star
relion.excludetiltsRelionExcludeTiltSeriesselected_tilt_series.star
relion.aligntiltseries.aretomoAreTomoJobaligned_tilt_series.star
relion.aligntiltseries.imod_fiducialImodAlignFiducialJobaligned_tilt_series.star
relion.aligntiltseries.imod_patchtrackImodAlignPatchTrackJobaligned_tilt_series.star
relion.reconstructtomogramsRelionTomoReconstructJobtomograms.star
relion.joinstar.tomogramsRelionJoinStarTomogramsmerged_tomograms.star or merged_tilt_series.star
relion.denoisetomoRelionDenoiseJobtomograms.star
relion.denoisetomo.trainRelionDenoiseTrainJobdenoising_model.tar.gz

All tomography jobs run against a pipeliner project in the current working directory. The typical sequence is:

  1. Import tilt series with relion.importtomo.
  2. Correct beam-induced motion with relion.motioncorr.tomo.own or relion.motioncorr.tomo.motioncor2.
  3. Estimate CTF with relion.ctffind.tomo.ctffind4.
  4. Optionally exclude bad tilts with relion.excludetilts.
  5. Align tilt series with one of the three alignment jobs.
  6. Reconstruct tomograms with relion.reconstructtomograms.
  7. Optionally train and apply a denoiser with relion.denoisetomo.train then relion.denoisetomo.

Generating and editing a run.job file (CLI)

Generate a default parameter file for any tomography job:

pipeliner --default_runjob relion.importtomo
# writes relion_importtomo_run.job

Edit the file (it uses label == value format), then schedule and run it:

pipeliner --run_job relion_importtomo_run.job

To continue a job that supports continuation (e.g. relion.motioncorr.tomo.own, relion.reconstructtomograms):

pipeliner --continue_job MotionCorr/job002/

Key option keys by job

relion.importtomo — required options:

  • fn_in_raw — tilt image file glob (e.g. frames/*.tif)
  • fn_mdoc — mdoc file glob
  • angpix — pixel size in Å
  • kV — voltage in kV
  • Cs — spherical aberration in mm
  • Q0 — amplitude contrast
  • dose_rate_pertilt — dose per tilt image (e/Ų)
  • tilt_angle — nominal tilt axis angle in degrees

Optional: optics_gp_name, prefix, mtf_file, is_motion_corrected, is_doserate_per_frame, do_invert_hand.

relion.motioncorr.tomo.own / relion.motioncorr.tomo.motioncor2 — required options:

  • input_star_mics — input tilt series STAR file (TiltSeriesGroupMetadata)
  • eer_grouping, bfactor, patch_x, patch_y, group_frames, bin_factor

The relion.motioncorr.tomo.motioncor2 variant requires the MotionCor2 executable (default MotionCor2, overridable via PIPELINER_MOTIONCOR2_EXECUTABLE or RELION_MOTIONCOR2_EXECUTABLE). Both variants support continuation (can_continue=True) and append --only_do_unfinished when continued. do_float16 defaults to True on the own implementation.

relion.ctffind.tomo.ctffind4 — required option:

  • input_star_mics — input tilt series STAR file

use_given_ps (default Yes) must stay Yes if the upstream motion correction used do_float16=Yes (the default).

Key options inherited from the SPA CTF job: box, resmin, resmax, dfmin, dfmax, dfstep, dast, do_phaseshift. Additional tomo-specific options: localsearch_nominal_defocus, exp_factor_dose, slow_search.

Requires relion_run_ctffind, which is passed --ctffind_exe ctffind (default, overridable via PIPELINER_CTFFIND_EXECUTABLE / RELION_CTFFIND_EXECUTABLE). Supports continuation (can_continue=True) and appends --only_do_unfinished when continued.

relion.excludetilts — required options:

  • in_tiltseries — input tilt series STAR file with CTF information
  • cache_size — number of tilt series to cache in memory (default 5)

Requires relion_python_tomo_exclude_tilt_images.

relion.aligntiltseries.aretomo — required options:

  • in_tiltseries — input tilt series STAR file
  • tomogram_thickness — estimated thickness in nm (default 300)

Optional: do_aretomo_tiltcorrect, aretomo_tiltcorrect_angle, do_aretomo_ctf, do_aretomo_phaseshift, other_aretomo_args, gpu_ids.

Requires relion_align_tiltseries and AreTomo2 (default, overridable via PIPELINER_ARETOMO_EXECUTABLE / RELION_ARETOMO_EXECUTABLE).

relion.aligntiltseries.imod_fiducial — required options:

  • in_tiltseries — input tilt series STAR file
  • fiducial_diameter — fiducial diameter in nm (default 10)

Requires relion_align_tiltseries and batchruntomo (default, overridable via PIPELINER_BATCHTOMO_EXECUTABLE / RELION_BATCHTOMO_EXECUTABLE).

relion.aligntiltseries.imod_patchtrack — required options:

  • in_tiltseries — input tilt series STAR file
  • tomogram_thickness — estimated thickness in nm
  • patch_size — patch size in nm
  • patch_overlap — patch overlap percentage

Requires relion_align_tiltseries and batchruntomo.

relion.reconstructtomograms — required options:

  • in_tiltseries — aligned tilt series STAR file
  • width, height, thickness — unbinned tomogram dimensions in pixels
  • binned_pixel_size — output binned pixel size in Å

Optional: do_need_denoising (generate split tomograms for denoising), do_write_centralslices, do_fourierinversion_filter, ignore_ctf, only_this_tomo, tilt_angle_offset.

Supports continuation (can_continue=True). Requires relion_tomo_reconstruct_tomogram.

relion.joinstar.tomograms — requires at least two inputs in either input_tomo_files (tomogram STAR files) or input_ts_files (tilt series STAR files), but not both simultaneously. Validates that at least 2 files are present at scheduling time; column/block mismatch is detected at execution time. Optional: remove_duplicates (default True).

relion.denoisetomo.train — required options:

  • cryocare_path — directory containing cryoCARE executables
  • in_tomoset — tomograms STAR file (must have half-tomogram columns)
  • tomograms_for_training — list of tomogram names (multistring, ::: separated)
  • subvolume_dimensions — sub-volume side length in pixels
  • gpu_ids — single GPU ID (e.g. 0)

Only a single GPU may be used. Requires relion_python_tomo_denoise.

relion.denoisetomo — required options:

  • cryocare_path — directory containing cryoCARE executables
  • in_tomoset — tomograms STAR file with half-tomogram columns
  • care_denoising_model — path to .tar.gz model from a relion.denoisetomo.train job
  • ntiles_x, ntiles_y, ntiles_z — number of tiles per dimension (minimum 2)
  • gpu_ids — single GPU ID

Requires relion_python_tomo_denoise.

Continuation support

The following tomography jobs have can_continue=True:

  • relion.motioncorr.tomo.own
  • relion.motioncorr.tomo.motioncor2
  • relion.ctffind.tomo.ctffind4
  • relion.reconstructtomograms

The import, alignment, exclude-tilts, join-star, and denoising jobs do not support continuation.


Examples

Example 1 — Import a tilt-series dataset

Import raw tilt images and their SerialEM mdoc files into a new project. The job outputs tilt_series.star (a NODE_TILTSERIESGROUPMETADATA node).

import os
from pipeliner.api.manage_project import PipelinerProject

os.chdir("/data/my_tomo_project")
proj = PipelinerProject(make_new_project=True)

import_job = proj.run_job(
    {
        "_rlnJobTypeLabel": "relion.importtomo",
        "fn_in_raw": "frames/*.tif",
        "fn_mdoc": "mdoc/*.mdoc",
        "angpix": "1.35",
        "kV": "300",
        "Cs": "2.7",
        "Q0": "0.1",
        "dose_rate_pertilt": "3.0",
        "tilt_angle": "84.1",
        "is_motion_corrected": "false",
    },
    run_in_foreground=True,
)
print(import_job.output_dir)  # Import/job001/

Example 2 — Motion-correct the tilt series (RELION's own algorithm)

The relion.motioncorr.tomo.own job requires relion_run_motioncorr and reads the tilt_series.star produced by the import job. It outputs corrected_tilt_series.star.

motioncorr_job = proj.run_job(
    {
        "_rlnJobTypeLabel": "relion.motioncorr.tomo.own",
        "input_star_mics": "Import/job001/tilt_series.star",
        "bfactor": "150",
        "patch_x": "1",
        "patch_y": "1",
        "bin_factor": "1",
        "eer_grouping": "32",
        "do_even_odd_split": "true",  # required for later denoising
        "nr_mpi": "4",
    },
    run_in_foreground=True,
)

To continue an unfinished run (for example after adding new movies), edit continue_job.star in the job directory and call:

proj.continue_job(motioncorr_job.output_dir, run_in_foreground=True)

Both relion.motioncorr.tomo.own and relion.motioncorr.tomo.motioncor2 append --only_do_unfinished automatically when is_continue=True.


Example 3 — Estimate CTF for each tilt

The relion.ctffind.tomo.ctffind4 job wraps relion_run_ctffind and CTFFIND4 (executable resolved from PIPELINER_CTFFIND_EXECUTABLE or RELION_CTFFIND_EXECUTABLE, default ctffind). It reads the corrected tilt-series STAR file and outputs tilt_series_ctf.star.

ctf_job = proj.run_job(
    {
        "_rlnJobTypeLabel": "relion.ctffind.tomo.ctffind4",
        "input_star_mics": "MotionCorr/job002/corrected_tilt_series.star",
        "use_given_ps": "true",
        "box": "512",
        "resmin": "30",
        "resmax": "5",
        "dfmin": "5000",
        "dfmax": "50000",
        "dfstep": "500",
        "dast": "100",
        "localsearch_nominal_defocus": "10000",
        "exp_factor_dose": "100",
        "nr_mpi": "4",
    },
    run_in_foreground=True,
)

Example 4 — Align tilt series with AreTomo2

relion.aligntiltseries.aretomo requires both relion_align_tiltseries and AreTomo2 (resolved from PIPELINER_ARETOMO_EXECUTABLE or RELION_ARETOMO_EXECUTABLE, default AreTomo2). It outputs aligned_tilt_series.star.

align_job = proj.run_job(
    {
        "_rlnJobTypeLabel": "relion.aligntiltseries.aretomo",
        "in_tiltseries": "CtfFind/job003/tilt_series_ctf.star",
        "tomogram_thickness": "300",
        "do_aretomo_tiltcorrect": "false",
        "do_aretomo_ctf": "false",
        "gpu_ids": "0",
        "nr_mpi": "2",
    },
    run_in_foreground=True,
)

For IMOD fiducial-based alignment, use relion.aligntiltseries.imod_fiducial with the fiducial_diameter option (in nm). For IMOD patch-tracking, use relion.aligntiltseries.imod_patchtrack with patch_size and patch_overlap; both require batchruntomo (default batchruntomo, overridable via PIPELINER_BATCHTOMO_EXECUTABLE or RELION_BATCHTOMO_EXECUTABLE).


Example 5 — Exclude bad tilts interactively

relion.excludetilts launches a Napari-based UI. It is not recommended for remote sessions. It reads a tilt-series STAR file that already has CTF information.

exclude_job = proj.schedule_job(
    {
        "_rlnJobTypeLabel": "relion.excludetilts",
        "in_tiltseries": "CtfFind/job003/tilt_series_ctf.star",
        "cache_size": "5",
    }
)

Run it in the foreground so the Napari window opens on your display:

proj.run_scheduled_job(exclude_job, run_in_foreground=True)

Example 6 — Reconstruct tomograms

relion.reconstructtomograms requires relion_tomo_reconstruct_tomogram. It outputs tomograms.star (a NODE_TOMOGRAMGROUPMETADATA node).

reconstruct_job = proj.run_job(
    {
        "_rlnJobTypeLabel": "relion.reconstructtomograms",
        "in_tiltseries": "AlignTiltSeries/job005/aligned_tilt_series.star",
        "width": "3838",
        "height": "3710",
        "thickness": "1200",
        "binned_pixel_size": "10.0",
        "do_need_denoising": "true",   # generates half-tomograms for cryoCARE
        "do_write_centralslices": "true",
        "nr_mpi": "4",
        "nr_threads": "4",
    },
    run_in_foreground=True,
)

Set do_need_denoising to true if you plan to run the cryoCARE denoising jobs; this instructs RELION to write even/odd half-tomograms alongside the full reconstruction.


Example 7 — Train a cryoCARE denoising model

relion.denoisetomo.train requires relion_python_tomo_denoise plus the cryoCARE executables directory (set via PIPELINER_CRYOCARE_EXECUTABLES_DIR). It outputs denoising_model.tar.gz (a NODE_MLMODEL node). Supply tomogram names as a list using the ::: separator for MultiStringJobOption values.

train_job = proj.run_job(
    {
        "_rlnJobTypeLabel": "relion.denoisetomo.train",
        "cryocare_path": "/opt/cryocare/bin",
        "in_tomoset": "Tomograms/job006/tomograms.star",
        "tomograms_for_training": "TS_001:::TS_002:::TS_003",
        "number_training_subvolumes": "1200",
        "subvolume_dimensions": "72",
        "gpu_ids": "0",
    },
    run_in_foreground=True,
)

Note: gpu_ids must be a single GPU identifier — spaces, colons, commas, and semicolons are rejected with a validation error.


Example 8 — Apply a trained denoising model

relion.denoisetomo reads the model produced by the training job and outputs tomograms.star with denoised reconstructions.

denoise_job = proj.run_job(
    {
        "_rlnJobTypeLabel": "relion.denoisetomo",
        "cryocare_path": "/opt/cryocare/bin",
        "in_tomoset": "Tomograms/job006/tomograms.star",
        "care_denoising_model": "Denoise/job007/denoising_model.tar.gz",
        "ntiles_x": "2",
        "ntiles_y": "2",
        "ntiles_z": "2",
        "gpu_ids": "0",
    },
    run_in_foreground=True,
)

Example 9 — Join multiple tilt-series STAR files

relion.joinstar.tomograms can merge either tomogram or tilt-series STAR files. Supply at least two input files (checked at scheduling time). Files whose blocks or columns differ, such as a mix of tomogram and tilt-series files, are not rejected at scheduling time; the job fails at run time with ValueError('Star files have different blocks/columns').

join_job = proj.run_job(
    {
        "_rlnJobTypeLabel": "relion.joinstar.tomograms",
        "input_ts_files": (
            "AlignTiltSeries/job005/aligned_tilt_series.star"
            ":::AlignTiltSeries/job008/aligned_tilt_series.star"
        ),
        "remove_duplicates": "true",
    },
    run_in_foreground=True,
)

Example 10 — Generate a default run.job file for CLI use

Use pipeliner --default_runjob to generate an editable parameter file, then submit it:

# Generate default parameter file
pipeliner --default_runjob relion.importtomo
# Produces: relion_importtomo_run.job

# Edit the file (labels must match exactly)
# Then schedule and run:
pipeliner --run_job relion_importtomo_run.job

run.job files use the <option_label> == <value> format. For example:

job_type == relion.importtomo
is_continue == false
is_tomo == true
Tilt image files: == frames/*.tif
mdoc files: == mdoc/*.mdoc
Pixel size (Angstrom): == 1.35
Voltage (kV): == 300
Spherical aberration (mm): == 2.7
Amplitude contrast: == 0.1
Dose rate per tilt-image: == 3.0
Tilt axis angle (deg): == 84.1