CCPEM Pipeliner
Guide

Depositions (OneDep/EMDB and EMPIAR)

Preparing EMDB (OneDep) and EMPIAR depositions from a project


Overview

This page explains how to prepare EMDB (via OneDep) and EMPIAR depositions from a completed pipeliner project. Pipeliner automates the collection of metadata from your processing pipeline and packages it into the formats each archive requires. PDB-only depositions are not supported; EMDB (OneDep) and EMPIAR are the two supported targets. You can drive depositions through the pipeliner CLI flags, the PipelinerProject Python API, or the dedicated pipeliner.deposition.onedep and pipeliner.deposition.empiar job types.


Prerequisites

Before preparing a deposition you need:

  • ccpem-pipeliner installed (pip install ccpem-pipeliner) and a completed pipeliner project in your working directory.
  • Python ≥ 3.9.
  • OneDep depositions only:
    • A wwPDB account with an ORCID linked at https://deposit.wwpdb.org/.
    • A OneDep refresh token generated from the Deposition API panel on that site.
    • The onedep_lib Python package (installed automatically with ccpem-pipeliner).
    • OneDep credentials stored with pipeliner.setup_onedep_credentials (see the pipeliner.setup_onedep_credentials section of the Maintenance commands page for setup instructions).
  • EMPIAR depositions only:
    • Note that the pipeliner.deposition.empiar job type currently loads with jobinfo.is_available=False because EMPIAR is updating their automated deposition system. The CLI route (pipeliner --empiar_deposition) and the PipelinerProject.prepare_project_empiar_deposition() method remain usable.
  • A terminal job (the last job in the chain you wish to deposit) whose status is Succeeded.

Usage

OneDep (EMDB) deposition

There are two routes: a job-based route that can authenticate and submit directly to OneDep, and a prepare-only CLI route that assembles local files without contacting OneDep.

Job-based route (recommended)

The pipeliner.deposition.onedep job traces your pipeline, assembles a draft mmCIF, and — when you continue it with submit_to_onedep set to Yes — authenticates and calls OneDep's API to create the deposition.

Step 1 – Generate a default run.job template.

From your project root:

pipeliner --default_runjob pipeliner.deposition.onedep

This writes pipeliner_deposition_onedep_run.job.

Step 2 – Edit the template.

Open the file and set the relevant fields. Values use the format <label> == <value>. For example:

Main map == PostProcess/job030/postprocess.mrc
Half maps == Refine3D/job028/run_half1_class001_unfil.mrc:::Refine3D/job028/run_half2_class001_unfil.mrc
Entry image for public display == PostProcess/job030/entry.png
Start a OneDep deposition? == No
Depositor email == depositor@example.org
Depositor ORCID ID == 0000-0002-1825-0097
Depositor country == UK
EM subtype == SPA
Primary map contour level == 0.02

Separate multiple paths (e.g. half-maps, masks) with :::. Leave Start a OneDep deposition? as No for the first run.

Step 3 – Run the prepare step.

pipeliner --run_job pipeliner_deposition_onedep_run.job

Pipeliner creates a new job directory such as Deposition/job031/ and writes draft_deposition.mmcif and an uploads/ directory there. No remote deposition is created yet.

Step 4 – Review and submit.

Inspect Deposition/job031/draft_deposition.mmcif. When you are satisfied, edit Deposition/job031/continue_job.star (a STAR job file, not a run.job file — use edit_jobstar or a text editor that understands STAR format) and set:

submit_to_onedep  Yes
onedep_dry_run    No

Then continue the existing job:

pipeliner --continue_job Deposition/job031/

On success, pipeliner writes the deposition ID, session link, and status to Deposition/job031/onedep_result.json and marks the upload complete. The job refuses to submit again once the upload has completed; edit the existing deposition online if further changes are needed.

Prepare-only CLI route

The --onedep_deposition flag prepares local files without authenticating or creating a remote deposition. Use this when you want to inspect the assembled data before committing to a submission:

pipeliner --onedep_deposition \
    --primary_map PostProcess/job030/postprocess.mrc \
    --model ServalCat/job031/refined.mmcif \
    --halfmaps Refine3D/job028/run_half1_class001_unfil.mrc \
                Refine3D/job028/run_half2_class001_unfil.mrc

Additional flags: --masks, --sequences, --additional_maps, --deposition_id. This route does not submit to OneDep; use the job-based route for actual submission.

Python API

PipelinerProject.prepare_project_onedep_deposition prepares deposition files programmatically. It is a staticmethod, so it does not require an active project object, though you will usually call it from one.

from pipeliner.api.manage_project import PipelinerProject
from validate_mmcif import ValidationError

output_file, errors = PipelinerProject.prepare_project_onedep_deposition(
    model="ServalCat/job031/refined.mmcif",
    primary_map="PostProcess/job030/postprocess.mrc",
    halfmaps=["Refine3D/job028/run_half1_class001_unfil.mrc",
               "Refine3D/job028/run_half2_class001_unfil.mrc"],
    masks=[],
    sequences=[],
    additional_maps=[],
    depo_id="deposition",
)
if errors:
    for err in errors:
        print(err)
else:
    print(output_file)

The method signature is:

PipelinerProject.prepare_project_onedep_deposition(
    model: str = "",
    primary_map: str = "",
    additional_maps=None,
    sequences=None,
    masks=None,
    halfmaps=None,
    depo_id: str = "deposition",
) -> Tuple[str, List[ValidationError]]

model must be a path to an mmCIF atomic model file; it defaults to an empty string (map-only depositions are supported). The method returns a tuple of the output file path and a list of validation errors.


EMPIAR deposition

Because the pipeliner.deposition.empiar job type is currently unavailable (EMPIAR is updating their deposition system), use the CLI flag or the prepare_project_empiar_deposition static method.

CLI route

pipeliner --empiar_deposition <terminal_job>

By default, all four data types are included. Use the optional selectors to include only specific types:

FlagIncludes
--empiar_moviesRaw unprocessed movies
--empiar_micsCorrected micrographs
--empiar_partsParticles
--empiar_corr_partsPer-particle motion-corrected particles

If none of the four selectors is specified, all four types are included. You can also provide a job.star file from a pipeliner.deposition.empiar job to supply contact and citation information:

pipeliner --empiar_deposition Refine3D/job028/ \
    --empiar_movies \
    --empiar_mics \
    --empiar_jobstar_file Deposition/job032/job.star

Without --empiar_jobstar_file, output is written to EMPIAR/<datetime>_EMPIAR.json. With it, output is written as deposition_data_EMPIAR.json (with the linked data in deposition_data/) in the directory that contains the job.star file, so the example above writes Deposition/job032/deposition_data_EMPIAR.json. The job.star file must be in a subdirectory; one in the project root fails with FileNotFoundError.

Python API

PipelinerProject.prepare_project_empiar_deposition is a staticmethod:

from pipeliner.api.manage_project import PipelinerProject

PipelinerProject.prepare_project_empiar_deposition(
    terminal_job="Refine3D/job028/",
    empiar_do_mov=True,
    empiar_do_mics=True,
    empiar_do_parts=True,
    empiar_do_rparts=False,
    jobstar_file=None,
)

The jobstar_file parameter (Optional[str], defaults to None) accepts a path to a job.star file from a pipeliner.deposition.empiar job, which supplies author, contact, and citation data that cannot be inferred automatically from the pipeline graph.


Examples

Example 1 – Prepare and review an OneDep deposition from the CLI

Generate a template, set it up for a dry run (no live submission), and schedule the job:

$ cd /path/to/my_project
$ pipeliner --default_runjob pipeliner.deposition.onedep
# Edit pipeliner_deposition_onedep_run.job, then:
$ pipeliner --run_job pipeliner_deposition_onedep_run.job

After reviewing Deposition/jobNNN/draft_deposition.mmcif, edit Deposition/jobNNN/continue_job.star to set submit_to_onedep to Yes and onedep_dry_run to No, then:

$ pipeliner --continue_job Deposition/jobNNN/

Example 2 – OneDep deposition via the Python API

import os
from pipeliner.api.manage_project import PipelinerProject

os.chdir("/path/to/my_project")

# Prepare the deposition files (no live submission)
output_file, errors = PipelinerProject.prepare_project_onedep_deposition(
    model="ServalCat/job031/refined.mmcif",
    primary_map="PostProcess/job030/postprocess.mrc",
    halfmaps=[
        "Refine3D/job028/half1.mrc",
        "Refine3D/job028/half2.mrc",
    ],
    depo_id="deposition",
)
if errors:
    for err in errors:
        print(err)
else:
    print(f"Deposition file written to: {output_file}")

Example 3 – EMPIAR deposition for movies and particles only

$ cd /path/to/my_project
$ pipeliner --empiar_deposition Refine3D/job028/ \
    --empiar_movies \
    --empiar_parts

This writes the deposition JSON to EMPIAR/<datetime>_EMPIAR.json containing only movie and particle imagesets derived from the upstream graph of Refine3D/job028/.


Troubleshooting

Symptom: pipeliner.setup_onedep_credentials stores credentials, but the OneDep job fails with an authentication error.

  • Cause: The environment variables ONEDEP_ACCESS_TOKEN or ONEDEP_REFRESH_TOKEN are set and override the config file.
  • Fix: Unset those variables in your shell before running pipeliner. Do not add them to shell startup files.

Symptom: The OneDep job fails with a message that the config file is not found or not readable.

  • Cause: The OneDep config TOML path job option points to a file that does not exist, is not readable, or is not writable (rotation of refresh tokens requires write access).
  • Fix: Run pipeliner.setup_onedep_credentials to (re-)create the credential file at the default location for your platform (~/.config/ccpem/pipeliner/onedep/config.toml on Linux, ~/Library/Application Support/ccpem/pipeliner/onedep/config.toml on macOS). Verify the file has mode 600 and its parent directory mode 700.

Symptom: Continuing a Deposition/jobNNN/ job (for example with pipeliner --continue_job Deposition/jobNNN/) raises ValueError: Cannot continue job Deposition/jobNNN because it already completed a OneDep upload.

  • Cause: The marker file .onedep_upload_complete is present in the job directory, meaning the upload already succeeded.
  • Fix: Edit the existing deposition via the OneDep web interface instead of re-running. Do not delete the marker file.

Symptom: The JSON written by pipeliner --empiar_deposition contains only experiment_type and imagesets, with no author, contact or citation information.

  • Cause: Without --empiar_jobstar_file, this information cannot be inferred from the pipeline graph, and it is left out without any error.
  • Fix: Write a template with pipeliner --default_jobstar pipeliner.deposition.empiar (this writes pipeliner_deposition_empiar_job.star in the current directory even though the job type is marked unavailable). Fill in its values, including entry_authors (Surname, Initials entries separated by :::; left empty it fails with IndexError). Move it into a subdirectory (a file in the project root fails with FileNotFoundError) and pass it via --empiar_jobstar_file.

Symptom: pipeliner --check_jobs lists pipeliner.deposition.empiar under Unavailable jobs. (pipeliner.check_setup still shows it as Success, because it only checks that the job's executables are found.)

  • Cause: The job's alternative_unavailable_reason is set because EMPIAR is updating their deposition system and the automated scripts it relies on are no longer supported.
  • Fix: Use pipeliner --empiar_deposition <terminal_job> or PipelinerProject.prepare_project_empiar_deposition() instead. Do not attempt to run the job type directly.

Symptom: edit_jobstar raises File <name> is not a valid STAR file. when passed the continue_job.star.

  • Cause: continue_job.star is a STAR job file and must be edited with edit_jobstar using a STAR-formatted template. If you accidentally passed a run.job file (which uses label == value format), the STAR parser rejects it.
  • Fix: Use edit_jobstar(fn_template, params_to_change, out_fn) where fn_template is a valid STAR job file such as one produced by write_default_jobstar. For continue_job.star specifically, edit the _rlnJobOptionVariable/_rlnJobOptionValue rows directly in the file using edit_jobstar or a text editor, then pass the edited file to pipeliner --continue_job.