CCPEM Pipeliner
Guide

CCP-EM Jobs: Heterogeneity, Particle Analysis and Simulation

cryoDRGN, CryoVAE, CryoDANN and Parakeet jobs for heterogeneity, particle analysis and simulation


Overview

This page covers the CryoDRGN, CryoVAE, CryoDANN, and Parakeet job types available in ccpem-pipeliner for continuous heterogeneity analysis, particle denoising, particle filtering, and micrograph simulation. These jobs let you explore conformational variability in your particle dataset, clean and denoise particle images using variational autoencoders, and generate synthetic cryo-EM data for benchmarking. None of these CCP-EM job types support continuation — to extend CryoDRGN training, run a new job with continue_from_weights=True rather than calling continue_job().


Usage

All four job families share the same scheduling and execution API. You pass a parameters dict containing _rlnJobTypeLabel and any options you want to override, or you generate a default run.job file and edit it before passing the path to run_job().

Scheduling and running jobs via the Python API

import os
from pipeliner.api.manage_project import PipelinerProject
from pipeliner.api.api_utils import job_default_parameters_dict

os.chdir("/path/to/my/project")
proj = PipelinerProject()

For any job type on this page you can get a parameters dict, inspect or override values, and pass it to schedule_job() or run_job():

params = job_default_parameters_dict("cryodrgn.train_vae")
params["fn_img"] = "Select/job005/particles.star"
params["zdim"] = "8"
params["num_epochs"] = "25"
job = proj.run_job(params, run_in_foreground=False)
proj.wait_for_job_to_finish(job)

Generating and editing a run.job file via the CLI

pipeliner --default_runjob cryodrgn.train_vae
# produces: cryodrgn_train_vae_run.job
# edit it, then:
pipeliner --run_job cryodrgn_train_vae_run.job

Key constraints that apply to all jobs on this page

  • No continuation. All CCP-EM jobs have can_continue=False. Calling get_continuation_job() on any of them raises NotImplementedError. To extend cryoDRGN training, schedule a new cryodrgn.train_vae job with continue_from_weights set to Yes and point weights at the previous job's .pkl file.
  • No MPI or threads. All jobs on this page call get_runtab_options(mpi=False, threads=False, ...) or the default with no MPI. Do not add nr_mpi to their parameter dicts; doing so raises ValueError.
  • External programs must be on PATH at job-creation time. Availability is checked when the job object is instantiated, not at import. If cryodrgn, cryovae, cryodann, or the Parakeet programs are not on PATH when you call new_job_of_type(), the job loads with jobinfo.is_available=False.
  • All parameter values in dicts are strings. job_default_parameters_dict() returns all values as strings regardless of the underlying type.

Job reference

cryodrgn.train_vae — CryoDRGN VAE training

AttributeValue
ClassCryodrgnTrainVAEJob
Entry pointcryodrgn.train_vae
Output directoryCryoDRGN/
CategoryContinuous Heterogeneity
External programcryodrgn

What it does. Trains a Variational Autoencoder on a particle STAR file to learn a continuous latent representation of structural heterogeneity, producing a trained weights .pkl file and analysis plots.

Inputs

Option keyLabelDefaultNotes
fn_imgInput particles STAR file(required)Must contain CTF and pose information
downsampleDownsample picked particle images to size:128Must be divisible by 2
zdimDimension of latent variable8Controls latent space dimensionality
num_epochsTotal number of training epochs25
continue_from_weightsContinue training starting from these initial weights?FalseWhen Yes, also set weights
weightsCryoDRGN trained weights pkl file to continue from:(blank)Only used when continue_from_weights=Yes
rand_seedRandom seed(blank)Leave blank for non-reproducible
use_chunkSplit stacks into chunks?FalseReduces RAM usage
chunkChunk size50000Active only when use_chunk=Yes
advanced_optionsEdit advanced options?FalseGUI toggle only
uninvert_dataDo not invert data signFalse
checkpointCheckpointing interval in N_EPOCHS1
log_intervalLogging interval in N_IMGS1000
max_threadsMaximum number of CPU cores for data loading16
batch_sizeMinibatch size8
weight_decayWeight decay in Adam optimizer0.0
learning_rateLearning rate in Adam optimizer0.0001
enc_layersNumber of hidden layers in encoder3
enc_dimSize of hidden layers in encoder1024
dec_layersNumber of hidden layers in decoder3
dec_dimSize of hidden layers in decoder1024
cryoDRGN_other_argsAdditional CryoDRGN arguments:(blank)Passed directly to cryodrgn train_vae

Outputs

NodeType
train_<D>/weights.pklNODE_MLMODEL

cryodrgn.abinit_het — CryoDRGN ab initio heterogeneous reconstruction

AttributeValue
ClassCryodrgnAbinitHetJob
Entry pointcryodrgn.abinit_het
Output directoryCryoDRGN/
CategoryContinuous Heterogeneity
External programcryodrgn

What it does. Runs cryodrgn abinit_het to simultaneously reconstruct density maps and learn a latent heterogeneity representation from scratch, without requiring pre-estimated poses.

Inputs — shares fn_img, downsample, rand_seed, use_chunk, chunk, advanced_options, uninvert_data, checkpoint, log_interval, max_threads, batch_size, weight_decay, learning_rate, enc_layers, enc_dim, dec_layers, dec_dim, cryoDRGN_other_args (same keys and defaults as cryodrgn.train_vae), plus:

Option keyLabelDefault
zdimDimension of latent variable8
num_epochsTotal number of training epochs30

Outputs

NodeType
train_<D>/weights.pklNODE_MLMODEL

cryodrgn.abinit_homo — CryoDRGN ab initio homogeneous reconstruction

AttributeValue
ClassCryodrgnAbinitHomoJob
Entry pointcryodrgn.abinit_homo
Output directoryCryoDRGN/
CategoryContinuous Heterogeneity
External programcryodrgn

What it does. Runs cryodrgn abinit_homo to reconstruct a single homogeneous density map from scratch without pre-estimated poses.

Inputs — shares fn_img, downsample, rand_seed, use_chunk, chunk, advanced_options, uninvert_data, checkpoint, log_interval, batch_size, weight_decay, learning_rate, cryoDRGN_other_args (same keys and defaults), plus:

Option keyLabelDefault
num_epochsTotal number of training epochs30

Note: cryodrgn.abinit_homo does not have a zdim, enc_dim, dec_dim, enc_layers, dec_layers, or max_threads option. Do not add these keys to its parameter dict.

Outputs

NodeType
train_<D>/weights.pklNODE_MLMODEL
train_<D>/reconstruct.mrcNODE_DENSITYMAP

cryodrgn.filter — CryoDRGN subset selection

AttributeValue
ClassCryodrgnFilterJob
Entry pointcryodrgn.filter
Output directorySelect/
CategorySubset Selection
External programscryodrgn, cryodrgn_utils

What it does. Opens an interactive lasso GUI (requires X11 forwarding on remote connections) allowing you to select a subset of particles from the cryoDRGN latent space. Writes a selected and an inverse-selected STAR file.

Option keyLabelDefaultNotes
weightsCryoDRGN trained weights pkl file(required)Usually weights.pkl from a cryodrgn.train_vae or cryodrgn.abinit_het job

Outputs

NodeType
selection.starNODE_PARTICLEGROUPMETADATA
inverse_selection.starNODE_PARTICLEGROUPMETADATA

cryovae.image_analysis — CryoVAE particle denoising

AttributeValue
ClassCryoVAE
Entry pointcryovae.image_analysis
Output directoryCryoVAE/
CategoryImage Analysis (from get_category_label(); the class sets no CATEGORY_LABEL)
External programscryovae, relion_image_handler, relion_stack_create

What it does. Denoises particle images using a beta-VAE. Accepts either a particles STAR file or a raw .mrcs stack, optionally low-pass filters to 10 Å before denoising, then writes denoised reconstructed images and a STAR file.

Option keyLabelDefaultNotes
input_starInput particles file name:(blank)Mutually exclusive with input_raw_stack
input_raw_stackOR: Input a raw particle stack:(blank)Mutually exclusive with input_star
lowpass_filterLow pass filer before denoising?TrueFilters to 10 Å
betaBeta value for VAE:0.1
epochsMax number of epochs:100

Outputs

NodeType
recons.mrcsNODE_IMAGE2DSTACK
denoised_particles.starNODE_PARTICLEGROUPMETADATA

cryodann.select.particles — CryoDANN particle filtering

AttributeValue
ClassCryoDANN
Entry pointcryodann.select.particles
Output directoryCryoDANN/
CategorySubset Selection
External programcryodann

What it does. Scores particle images using domain-adversarial neural network training to separate "good" particles from junk. Optionally runs CryoVAE denoising before scoring. Outputs a confidence score file and, if a STAR file was provided, a selected-particles STAR file.

Option keyLabelDefaultNotes
input_starfileInput particles STAR file:(blank)Required if input_stack is blank
input_stackOR: Input a particle stack:(blank)Required if input_starfile is blank
run_cryovaeDo cryoVAE denoising?TrueRuns CryoVAE pipeline internally
vae_betaBeta value for cryoVAE:0.1Active when run_cryovae=Yes
vae_epochsMax number of epochs for cryoVAE:100Active when run_cryovae=Yes
thresholdScore threshold:0.006Passed to cryodann as --keep_percent; help text: "score threshold to retain top N particles"
gammaGamma value:0.01Controls domain-adaptation vs classification trade-off
dann_epochsMax number of epochs for CryoDANN:50
batch_sizeBatch size:128
lrLearning rate:0.001
train_setPath for training data:(required)Path to training data from the git repo

Outputs (conditional on options)

NodeTypeCondition
recons.mrcsNODE_IMAGE2DSTACKonly when run_cryovae=Yes
denoised_particles.starNODE_PARTICLEGROUPMETADATAonly when run_cryovae=Yes
lightning_logs/index_confidence.txtNODE_LOGFILEalways
lightning_logs/good_particles_t<threshold>.starNODE_PARTICLEGROUPMETADATAonly when input_starfile is set

parakeet.simulate — Parakeet micrograph simulation

AttributeValue
ClassParakeetJob
Entry pointparakeet.simulate
Output directoryParakeet/
CategorySimulate (from get_category_label(); the class sets no CATEGORY_LABEL)
External programsparakeet.sample.new, parakeet.sample.add_molecules, parakeet.metadata.export, parakeet.simulate.exit_wave, parakeet.simulate.optics, parakeet.simulate.image, parakeet.export

What it does. Simulates synthetic single-particle cryo-EM micrographs using the Parakeet digital-twin pipeline. You can either supply a complete Parakeet YAML configuration file or specify individual parameters directly. Output micrographs are placed in a Micrographs/ subdirectory of the job. The job registers an MTF STAR file and a micrographs STAR file as output nodes.

Key options

Option keyLabelDefaultNotes
use_conf_yamlSet Parakeet simulation parameters via YAML configuration?TrueWhen Yes, reads from conf; when No, uses individual parameters
confParakeet configuration file (YAML format):(blank)Required when use_conf_yaml=Yes; node type NODE_PARAMSDATA
keep_confsKeep the configuration file (YAML) for every image:True
opticsGroupNameOptics group nameopticsGroup1
particlesTotal number of particles to simulate1
pdb_filepathsThe filename(s) of the atomic coordinates to use (*.pdb, *.cif)(blank)MultiInputNodeJobOption; active when use_conf_yaml=No
pdb_instancesThe number of particles of the corresponding molecule to simulate per micrograph(blank)MultiStringJobOption; values separated by :::
deviceWhether to run on GPU or CPUgpuActive when use_conf_yaml=No
fast_iceUse the Gaussian Random Field ice model?FalseActive when use_conf_yaml=No
dqeUse the DQE model?FalseActive when use_conf_yaml=No
radiation_damage_modelUse the radiation damage model?FalseActive when use_conf_yaml=No

Outputs

NodeType
relion/mtf_<energy>kV.starNODE_MICROSCOPEDATA
synthetic_micrographs.starNODE_MICROGRAPHGROUPMETADATA

Examples

Example 1 — Schedule and run a cryoDRGN VAE training job

This example shows the typical pattern: generate a default parameters dict, override the options you need, schedule the job (without running it immediately), then run it and wait for completion.

import os
from pipeliner.api.manage_project import PipelinerProject
from pipeliner.api.api_utils import job_default_parameters_dict

os.chdir("/data/my_project")
proj = PipelinerProject()

params = job_default_parameters_dict("cryodrgn.train_vae")
params["fn_img"] = "Select/job005/particles.star"
params["zdim"] = "8"
params["num_epochs"] = "25"
params["downsample"] = "128"

job = proj.schedule_job(params)
proj.run_scheduled_job(job)
final_status = proj.wait_for_job_to_finish(job, error_on_fail=True)

Example 2 — Extend training with a new job using continue_from_weights

Because cryodrgn.train_vae has can_continue=False, you cannot call continue_job(). Instead, schedule a new job pointing weights at the previous job's .pkl file.

import os
from pipeliner.api.manage_project import PipelinerProject
from pipeliner.api.api_utils import job_default_parameters_dict

os.chdir("/data/my_project")
proj = PipelinerProject()

params = job_default_parameters_dict("cryodrgn.train_vae")
params["fn_img"] = "Select/job005/particles.star"
params["zdim"] = "8"
params["num_epochs"] = "50"  # cumulative target
params["downsample"] = "128"
params["continue_from_weights"] = "Yes"
params["weights"] = "CryoDRGN/job006/train_128/weights.pkl"

job = proj.run_job(params, run_in_foreground=False)
proj.wait_for_job_to_finish(job, error_on_fail=True)

Example 3 — Generate and edit a run.job file for a Parakeet simulation

This workflow is useful when you want to inspect or hand-edit every option before launching.

# Generate the default run.job file
pipeliner --default_runjob parakeet.simulate
# Produces: parakeet_simulate_run.job

# Edit the file: set your YAML config path
# Lines use the format:  <option label> == <value>
# For example:
#   Parakeet configuration file (YAML format): == /data/sim_config.yaml
#   Total number of particles to simulate == 500

# Run the job
pipeliner --run_job parakeet_simulate_run.job

Example 4 — Run a CryoDANN particle filtering job via the Python API

import os
from pipeliner.api.manage_project import PipelinerProject
from pipeliner.api.api_utils import job_default_parameters_dict

os.chdir("/data/my_project")
proj = PipelinerProject()

params = job_default_parameters_dict("cryodann.select.particles")
params["input_starfile"] = "Extract/job008/particles.star"
params["train_set"] = "/data/cryodann_training_data"
params["run_cryovae"] = "Yes"
params["dann_epochs"] = "50"
params["threshold"] = "0.006"

job = proj.run_job(params, run_in_foreground=False)
proj.wait_for_job_to_finish(job)
print(job.output_dir)

Troubleshooting

ValueError: Parameter <name> is not found in jobtype <type>

You passed an option key that does not exist for that job type. Common mistakes:

  • Adding nr_mpi to any job on this page (none register MPI options).
  • Adding enc_dim, dec_dim, enc_layers, or dec_layers to cryodrgn.abinit_homo (those belong only to cryodrgn.train_vae and cryodrgn.abinit_het).
  • Using max_threads on cryodrgn.abinit_homo (not registered on that job).

NotImplementedError when calling get_continuation_job()

All CCP-EM jobs have can_continue=False. You cannot continue any job on this page. To extend training, schedule a new job as shown in Example 2.

This job has been marked unavailable because: executable '<name>' not found

The external program (cryodrgn, cryovae, cryodann, or a Parakeet program) is not on your PATH at the time the job object is created. Activate the appropriate conda environment or set PIPELINER_ADDITIONAL_PROGRAM_PATHS before importing pipeliner. Check availability with:

pipeliner --check_jobs cryodrgn
pipeliner --check_jobs parakeet

An edited value in a run.job file has no effect

run.job lines are matched to job options by their exact label. A line whose label doesn't match is silently ignored (no error is raised), and any option whose label is missing keeps its default, with a no value for ... using default value warning logged. Use pipeliner --default_runjob <jobtype> to see the exact labels, then copy them verbatim.