CCPEM Pipeliner
Guide

Pipeliner CLI Reference

Every flag of the pipeliner command, grouped by task


Overview

This page documents every flag of the pipeliner command-line entry point, grouped by the task each flag supports. Use this reference when you need to create projects, run or schedule jobs, manage job state, clean up disk space, generate reports, or prepare depositions from the command line. For the auxiliary console scripts (pipeliner.check_setup, pipeliner.recover_project, pipeliner.merge_projects, and others), see the Maintenance commands page.


Usage

Run pipeliner from inside your project directory (the directory that contains default_pipeline.star) unless stated otherwise. The general form is:

pipeliner <flag> [arguments]

Most flags accept a single value; a few accept multiple values or act as switches. The sections below cover every flag, organised by task.


Project set-up

FlagNargsDefaultDescription
--new_project [project name]?"default" if flag is present, None if absentCreate a new pipeline file (<name>_pipeline.star) in the current directory. Omit the name to use default. Raises ValueError if a pipeline file already exists.
--available_jobs [search string]?"" (show all)List registered job types, optionally filtered by a search string. Does not open the project or read default_pipeline.star.
--check_jobs [search string]?"" (show all)Like --available_jobs but includes detailed availability information: the path to each required executable and an error line for every executable that is missing from $PATH.
# Create a new project with the default pipeline name
pipeliner --new_project

# Create a new project with a custom name
pipeliner --new_project my_spa_project

# List all registered job types
pipeliner --available_jobs

# Filter to motion-correction jobs
pipeliner --available_jobs motioncorr

Running jobs

FlagNargsDescription
--run_job [run.job or job.star file]?Create and immediately run a new job from a parameter file. Unless --overwrite is given, always creates a new job with the next sequential number.
--overwrite [job name]?Use with --run_job to delete and replace an existing job of the same type instead of creating a new one. Accepts full job names, short forms (job002, 2) and aliases.
--continue_job [job name]?Continue a previously run job. Edit the job's continue_job.star file before running this flag to modify parameters. Accepts full names, short forms (job001, 1), and aliases.
--abort_job [job name]?Abort a running job by writing the abort-trigger file. Does not wait for the job to stop.
--print_command [run.job or job.star file]?Read a parameter file and print the command(s) the job would produce without running anything.
--schedule_job [run.job, job.star file, or job name]?Register a job as Scheduled without running it. If a file path is given (ending in .job or .star), a new job is created; if a job name is given, a continuation of that job is scheduled.
# Generate a default run.job file for motion correction, then run it
pipeliner --default_runjob relion.motioncorr.own
pipeliner --run_job relion_motioncorr_own_run.job

# Overwrite an existing job with updated parameters
pipeliner --run_job updated_params.job --overwrite MotionCorr/job002/

# Continue MotionCorr/job002/ (edit its continue_job.star first)
pipeliner --continue_job MotionCorr/job002/

# Abort a running job
pipeliner --abort_job CtfFind/job003/

Executing schedules

Schedules let you chain a set of already-scheduled jobs and run them sequentially, optionally repeating the sequence.

FlagNargsDefaultDescription
--run_scheduleswitch—Create and run a schedule from the currently scheduled jobs. Requires --name and --jobs.
--name [name]?None(Required with --run_schedule) Name for the new schedule.
--jobs [job name …]*None(Required with --run_schedule) Ordered list of job names to include in the schedule.
--min_between [n]?0Minimum number of minutes from the start of one repeat of the schedule to the start of the next. It adds no wait between the jobs within a repeat.
--nr_repeats [n]?1Repeat the schedule this many times.
--wait_sec_after [n]?2Seconds to wait after a job finishes before starting the next.
--wait_min_before [n]?0Minutes to wait before starting the schedule.
--stop_schedule [name]?NoneStop a running schedule by name. For a schedule started with pipeliner --run_schedule this kills the schedule process and then tries to abort the last job the schedule started. The current job runs inside the schedule process, so its job runner stops without writing a status file, but any program the job had started is not killed and keeps running; stop it yourself. While a job is running the killed process still holds the pipeline lock, so the command then fails after 60 seconds with RuntimeError: Trying to open pipeline default_pipeline.star for editing but could not acquire lock ..., leaving a stale .relion_lock. If the schedule is between jobs (for example during the --wait_sec_after or --min_between wait), the command instead fails at once with RuntimeError: Only running jobs can be aborted. Job <job> is <status>. In both cases the RUNNING_PIPELINER_<pipeline>_<name> file is left behind; delete it, and remove any stale lock (for example with pipeliner.recover_project, which also restores default_pipeline.star from the newest per-job backup).
# Run two scheduled jobs (see --schedule_job) as a schedule called 'mcorr_ctf'
pipeliner --run_schedule \
  --name mcorr_ctf \
  --jobs MotionCorr/job002/ CtfFind/job003/

# Or repeat them three times, starting each repeat at least 2 minutes after
# the previous one started
pipeliner --run_schedule \
  --name mcorr_ctf_loop \
  --jobs MotionCorr/job002/ CtfFind/job003/ \
  --nr_repeats 3 \
  --min_between 2

# Stop a running schedule
pipeliner --stop_schedule mcorr_ctf

Deleting and undeleting jobs

FlagNargsDescription
--delete_job [job name]?Move a job and all its child processes to Trash/. Works regardless of job status.
--undelete_job [job name]?Restore a deleted job and any deleted parent processes from Trash/.
pipeliner --delete_job CtfFind/job003/
pipeliner --undelete_job CtfFind/job003/

Modifying jobs

FlagNargsDescription
--set_alias [job name] [new alias]2Set the alias for a job.
--clear_alias [job name]1Clear the alias for a job.
--set_status [job name] {success|failed|aborted|scheduled|running}2Manually set the status of a job. Job name comes first, then the status string. Valid status values are substrings of success, failed, aborted, scheduled, or running. The value finished is not valid and raises ValueError. A job in Running state cannot be set to aborted via this flag — use --abort_job instead.
# Set an alias
pipeliner --set_alias MotionCorr/job002/ motion_round1

# Clear an alias
pipeliner --clear_alias MotionCorr/job002/

# Manually mark a failed job as succeeded
pipeliner --set_status MotionCorr/job002/ success

Cleaning up jobs

Cleanup moves intermediate files into Trash/Cleanup/ to save disk space. The project-level log .CCPEM_pipeliner_cleanup records each cleanup operation.

FlagNargsDescription
--cleanup [job name …]*Delete intermediate files from the listed jobs. Pass ALL to clean up every job.
--harshswitchUse with --cleanup to remove even more files (harsh cleanup mode).
--restore_cleaned_files [job name]? (const "all")Restore files moved to Trash/Cleanup/ back to their original job directories. Omit a job name to restore all cleaned files.
--empty_trashswitchPermanently delete all files in Trash/. This cannot be undone. The CLI prompts for confirmation (Y/N) before proceeding.
# Standard cleanup on two jobs
pipeliner --cleanup MotionCorr/job002/ CtfFind/job003/

# Harsh cleanup on all jobs
pipeliner --cleanup ALL --harsh

# Restore cleaned files for one job
pipeliner --restore_cleaned_files MotionCorr/job002/

# Permanently empty the trash
pipeliner --empty_trash

Note: PipelinerProject.run_cleanup() in the Python API requires full job names such as MotionCorr/job002/. Short forms like job002 or 2 are only resolved by the CLI via parse_proclist.


Utilities

FlagNargsDescription
--validate_starfile [star file]?Check a STAR file for formatting errors and attempt to fix them.
--convert_pipeline_file [_pipeline.star file]?Convert a pipeline file from RELION 3.1 to the CCP-EM Pipeliner format on disk. A .old backup is kept.
--default_jobstar [job type]?Generate a <jobtype_with_underscores>_job.star file with default values for use with edit_jobstar(). The job type must be an exact entry-point process name (e.g., relion.motioncorr.own).
--relionstyleswitchUse with --default_jobstar to write a RELION 4.0-compatible job.star file.
--default_runjob [job type]?Generate a <jobtype_with_underscores>_run.job file with default values (e.g., relion.motioncorr.own → relion_motioncorr_own_run.job). Human-readable label == value format.
--job_info [job type]?Print information about a job type: description, author, program paths and versions, long description, and online documentation link.
--job_references [job type]?Print the literature references for a specific job type.
--references_report [job name]?Generate a reference report (written to ReferenceReports/) for the specified terminal job and all its upstream jobs.
# Generate a default run.job file
pipeliner --default_runjob relion.import.movies
# Produces: relion_import_movies_run.job

# Generate a default job.star file
pipeliner --default_jobstar relion.ctffind.ctffind4
# Produces: relion_ctffind_ctffind4_job.star

# Get job info
pipeliner --job_info relion.class2d.em

# Generate a reference report up to a 3D refinement job
pipeliner --references_report Refine3D/job010/

Project analysis

FlagNargsDescription
--metadata_report [terminal job]? (const "nojob")Generate a JSON metadata report in MetadataReports/ for the specified terminal job and all its upstream jobs. A terminal job name is required; omitting it prints a usage message and returns without creating a report.
pipeliner --metadata_report Refine3D/job010/

Project archiving

FlagNargsDescription
--full_archive [terminal job name]?Create a full archive containing the entire job directories for the terminal job and all upstream jobs.
--simple_archive [terminal job name]?Create a simple archive containing only the directory structure, parameter files, and a re-run script for the terminal job and all upstream jobs.

Failed and Aborted jobs are permitted in the upstream graph; Running or Scheduled jobs cause archive creation to fail.

pipeliner --full_archive Refine3D/job010/
pipeliner --simple_archive Refine3D/job010/

Preparing depositions

EMPIAR

FlagNargsDescription
--empiar_deposition [terminal job name]?Prepare an EMPIAR deposition. Output is written to EMPIAR/<datetime>_EMPIAR.json, or, with --empiar_jobstar_file, to deposition_data_EMPIAR.json in the directory containing that job.star file.
--empiar_moviesswitchInclude unprocessed movies in the deposition.
--empiar_micsswitchInclude corrected micrographs in the deposition.
--empiar_partsswitchInclude particles in the deposition.
--empiar_corr_partsswitchInclude corrected particles in the deposition.
--empiar_jobstar_file [file]?Optional: a job.star file from a pipeliner.deposition.empiar job containing additional metadata.

If none of --empiar_movies, --empiar_mics, --empiar_parts, or --empiar_corr_parts is specified, all four data types are included by default.

# Full EMPIAR deposition including all data types
pipeliner --empiar_deposition Refine3D/job010/

# Include only movies and micrographs
pipeliner --empiar_deposition Refine3D/job010/ \
  --empiar_movies --empiar_mics

OneDep (PDB/EMDB)

FlagNargsDescription
--onedep_depositionswitchPrepare files for a PDB/EMDB deposition. Does not submit — submission must be done separately via the OneDep web interface or API. The job directory containing --model (or --primary_map if no model is given) is used as the terminal job, so that file must be inside a job directory of the project; otherwise the command fails with ValueError: Unable to find terminal process. Output is written to EMDB/deposition_data_<deposition id>.cif.
--deposition_id [id]?Default "deposition". The deposition ID assigned by EBI. If not specified, a draft deposition is prepared.
--primary_map [file]singleThe primary map in MRC format.
--model [file]singleThe atomic model in mmCIF format.
--additional_maps [file …]*Additional maps in MRC format.
--masks [file …]*Masks in MRC format.
--halfmaps [file file]2The two half-maps in MRC format.
--sequences [file …]*Sequences in FASTA format.
pipeliner --onedep_deposition \
  --primary_map PostProcess/job011/postprocess.mrc \
  --model ModelBuild/job012/model.cif \
  --halfmaps Refine3D/job010/half1.mrc Refine3D/job010/half2.mrc

Examples

Check your installation

pipeliner.check_setup

Outputs four sections: Python version check, available job types, pipeliner console-script check, and a final setup report. No output is reproduced here because the exact terminal colours and paths vary per system.


Initialise a new project

cd /data/my_spa_project
pipeliner --new_project

Creates default_pipeline.star in the current directory and writes .CCPEM_pipeliner_project.


Generate and inspect a default run.job file

pipeliner --default_runjob relion.import.movies

Writes relion_import_movies_run.job (dots replaced by underscores, _run.job appended). Each line uses the format <option label> == <value>, for example:

job_type == relion.import.movies
is_continue == false
is_tomo == false
Raw input files: == frames/*.tif
Voltage (kV): == 300

Edit this file with a text editor, then pass it to --run_job.


Run an import job

pipeliner --run_job relion_import_movies_run.job

A new job is created at Import/job001/. The job runs in the background; status is tracked by sentinel files (PIPELINER_JOB_EXIT_SUCCESS, PIPELINER_JOB_EXIT_FAILED, PIPELINER_JOB_EXIT_ABORTED) in the job directory.


Overwrite an existing job with new parameters

pipeliner --run_job relion_import_movies_run.job --overwrite Import/job001/

The old Import/job001/ is replaced in-place. The new and old job types must match.


Get a default STAR job file for scripted editing

pipeliner --default_jobstar relion.motioncorr.own

Writes a STAR-format job.star template. Use edit_jobstar() from the Python API to modify it programmatically before passing to --run_job.


Schedule jobs and run them as a named sequence

# Schedule two jobs without running them immediately. First set the input
# file in each run.job; in the CTFFIND file also set
# "Use power spectra from MotionCorr job? == Yes", because MotionCorr writes
# float16 micrographs by default and CTFFIND can't be scheduled on them otherwise
pipeliner --schedule_job relion_motioncorr_own_run.job
pipeliner --schedule_job relion_ctffind_ctffind4_run.job

# Run the schedule
pipeliner --run_schedule \
  --name phase1 \
  --jobs MotionCorr/job002/ CtfFind/job003/ \
  --wait_sec_after 10

Continue a Class2D job from an intermediate iteration

Before calling --continue_job, manually set fn_cont in Class2D/job008/continue_job.star to point to the desired _optimiser.star file. Then:

pipeliner --continue_job Class2D/job008/

Abort a running job

pipeliner --abort_job MotionCorr/job002/

Writes PIPELINER_JOB_ABORT_NOW into the job directory. The job runner responds asynchronously.


Manually correct a job's status

pipeliner --set_status MotionCorr/job002/ success

Valid status substrings: success, failed, aborted, scheduled, running. Note: finished is not valid and raises ValueError.


Assign and clear an alias

pipeliner --set_alias MotionCorr/job002/ motion_round1
pipeliner --clear_alias MotionCorr/job002/

Clean up intermediate files

# Normal cleanup on specific jobs
pipeliner --cleanup MotionCorr/job002/ CtfFind/job003/

# Harsh cleanup removes even more files
pipeliner --cleanup MotionCorr/job002/ --harsh

# Clean everything
pipeliner --cleanup ALL

Files are moved to Trash/Cleanup/, not permanently deleted. Restore with:

pipeliner --restore_cleaned_files MotionCorr/job002/

Delete and restore a job

pipeliner --delete_job CtfFind/job003/
pipeliner --undelete_job CtfFind/job003/

Once you are sure you no longer need the trashed files:

pipeliner --empty_trash

Archive a project

Simple archive (directory structure and parameter files only, with a replay script):

pipeliner --simple_archive Refine3D/job015/

Full archive (complete job directories for the terminal job and all upstream jobs):

pipeliner --full_archive Refine3D/job015/

The archive is written to ProjectArchives/ with a date-time tag in the filename.


Generate a literature references report

pipeliner --references_report Refine3D/job015/

Writes a report to ReferenceReports/.


Generate a metadata report

pipeliner --metadata_report Refine3D/job015/

Writes a JSON report to MetadataReports/. Running --metadata_report without a job argument prints a usage message and returns without creating a report.


Prepare an EMPIAR deposition

Include all data types (movies, micrographs, particles, corrected particles) by default:

pipeliner --empiar_deposition Refine3D/job015/

Select specific data types:

pipeliner --empiar_deposition Refine3D/job015/ --empiar_movies --empiar_parts

Output is written to EMPIAR/<datetime>_EMPIAR.json. Submission must be completed separately via the EMPIAR web interface.


Prepare a OneDep deposition

pipeliner --onedep_deposition \
  --primary_map PostProcess/job016/postprocess.mrc \
  --model ModelBuild/job017/refined.mmcif \
  --halfmaps PostProcess/job016/postprocess_half1.mrc PostProcess/job016/postprocess_half2.mrc \
  --sequences sequences.fasta \
  --deposition_id deposition

This prepares files locally. Submission requires either the OneDep web interface or running a pipeliner.deposition.onedep job with submit_to_onedep set to Yes.


Print the command a job file would produce (without running it)

pipeliner --print_command relion_motioncorr_own_run.job

Validate a STAR file

pipeliner --validate_starfile MotionCorr/job002/corrected_micrographs.star

Convert a RELION pipeline file to pipeliner format

pipeliner --convert_pipeline_file default_pipeline.star

A .old backup is kept alongside the converted file.


Print job information and references

pipeliner --job_info relion.class2d.em
pipeliner --job_references relion.class2d.em

Job type arguments must be exact entry-point process names (e.g., relion.ctffind.ctffind4), not abbreviated names.


Write a RELION-compatible job.star

pipeliner --default_jobstar relion.refine3d --relionstyle

The --relionstyle flag (used together with --default_jobstar) produces a job.star compatible with RELION 4.0.


Troubleshooting

pipeliner command not found after installation

Symptom: Running pipeliner gives command not found.

Cause: The console scripts were not installed or the environment's bin/ directory is not on PATH.

Fix: Reinstall to restore entry points:

pip install --force-reinstall ccpem-pipeliner

Then verify:

pipeliner.check_setup

ValueError: ERROR: Could not initialize a new project in this directory. A pipeline called <name>_pipeline.star already exists

Symptom: pipeliner --new_project fails with this message.

Cause: A pipeline file already exists in the current directory.

Fix: You do not need --new_project for an existing project. Just cd into the project directory and run pipeliner commands directly. If you genuinely want a fresh project, remove or rename the existing pipeline file first.


ValueError: ERROR: The job status must be in [...]. The status entered was "finished"

Symptom: pipeliner --set_status <job> finished raises this error.

Cause: finished is not a valid status value. The accepted substrings are success, failed, aborted, scheduled, and running.

Fix:

pipeliner --set_status MotionCorr/job002/ success

An edited option in a .run.job file is ignored

Symptom: pipeliner --run_job <file> runs, but a value you edited has no effect, or validation reports a required option as missing even though you set it.

Cause: run.job lines are matched to job options by their exact label. A line whose label doesn't match (different case, missing trailing colon or parenthetical) or that has no == separator is silently ignored; no error is raised. Any option whose label is missing keeps its default, and a no value for ... using default value warning is logged.

Fix: Regenerate the file with pipeliner --default_runjob <jobtype> and compare labels. Copy labels verbatim rather than paraphrasing them, and keep the <option label> == <value> format on every line.


ValueError: Job type '<type>' not found; conversion failed

Symptom: pipeliner --run_job <file> or pipeliner --schedule_job <file> fails with this message.

Cause: The job_type == <type> line in the .run.job or .star file references a job type that is not registered (misspelled or from a plugin that is not installed).

Fix: Check the exact process name with pipeliner --available_jobs <search>. Job type names use dot notation, e.g. relion.motioncorr.own.


ValueError: Job cannot be run because: File <path> not found (queue submission enabled)

Symptom: pipeliner --run_job <file> or pipeliner --continue_job <job> fails with this message and no job is created.

Cause: Queue submission is enabled (Submit to queue? == Yes in a .run.job file, do_queue in a job.star file) but the job's submission template (Standard submission script: in a .run.job file, option name qsubscript) is empty or names a file that does not exist. Its default comes from the qsub_template setting. Input files, including this template, are checked before the job is created. Error reading template submission script in: <path> appears only when a job that was already scheduled is started from Python with PipelinerProject.run_scheduled_job() and the template can no longer be read; that job is then marked Failed and RuntimeError: Error starting job <dir> is raised.

Fix: Either point the Standard submission script: line (or qsubscript) at a valid template file, set PIPELINER_QSUB_TEMPLATE to a valid template file path (it sets the default for newly generated job files), or turn queue submission off for the job: in a .run.job file the line is Submit to queue? == No (lines are matched by label, so a do_queue == No line is ignored); in a job.star file or a parameters dict the option name is do_queue.


Cannot wait for completion when submitting jobs to a queue

Symptom: Python API call run_job(..., run_in_foreground=True) raises ValueError with this message.

Cause: The job has do_queue set to Yes and run_in_foreground=True was passed simultaneously — these are incompatible.

Fix: Set do_queue to No in the job options to run locally, then use run_in_foreground=True.


Job loads as UnavailableJob — class import failed

Symptom: pipeliner --check_jobs lists a job with no executable path information, and the Python API raises an error when instantiating it.

Cause: An exception occurred while loading the job class (e.g., a missing Python dependency for a plugin), not merely a missing external executable.

Fix: Check job.jobinfo.unavailable_message via the API or review the pipeliner.job_factory logger output for the full traceback. Fix the underlying import error or install the missing dependency.


No pipeline file found from pipeliner.recover_project

Symptom: Running pipeliner.recover_project prints this message and exits.

Cause: default_pipeline.star is completely absent from the project directory. pipeliner.recover_project requires the file to exist; it restores its contents from per-job backups, but cannot create the file from scratch if it is missing entirely.

Fix: Locate a per-job backup copy of default_pipeline.star (stored in each job subdirectory at scheduling time) and copy it manually back to the project root, then re-run pipeliner.recover_project.


--metadata_report produces no output when run without a job argument

Symptom: pipeliner --metadata_report (with no job name) does nothing.

Cause: A terminal job name is required. Running without one prints a usage message and returns immediately.

Fix:

pipeliner --metadata_report Refine3D/job015/

Continuing a job type that cannot be continued

Symptom: PipelinerProject.get_continuation_job() raises NotImplementedError("This type of job cannot be continued") for a servalcat, modelcraft, molrep, or similar CCP-EM job.

Cause: These job types have can_continue=False. Only get_continuation_job() checks this (through prepare_for_continuation()); pipeliner --continue_job does not call it and does not raise this error.

Fix: Run these jobs as new jobs rather than continuations.


ValueError: ERROR: --name and --jobs arguments are required

Symptom: pipeliner --run_schedule fails with this message.

Cause: The CLI requires both --name and --jobs arguments. (A TypeError about unexpected keyword arguments comes only from calling PipelinerProject.run_schedule() in Python with name= or jobs=; its parameters are fn_sched and job_ids.)

Fix:

pipeliner --run_schedule --name my_schedule --jobs Import/job001/ MotionCorr/job002/