CCP-EM Jobs: Heterogeneity, Particle Analysis and Simulation
cryoDRGN, CryoVAE, CryoDANN and Parakeet jobs for heterogeneity, particle analysis and simulation
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().
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. Callingget_continuation_job()on any of them raisesNotImplementedError. To extend cryoDRGN training, schedule a newcryodrgn.train_vaejob withcontinue_from_weightsset toYesand pointweightsat the previous job's.pklfile. - 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 addnr_mpito their parameter dicts; doing so raisesValueError. - 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 callnew_job_of_type(), the job loads withjobinfo.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
| Attribute | Value |
|---|---|
| Class | CryodrgnTrainVAEJob |
| Entry point | cryodrgn.train_vae |
| Output directory | CryoDRGN/ |
| Category | Continuous Heterogeneity |
| External program | cryodrgn |
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 key | Label | Default | Notes |
|---|---|---|---|
fn_img | Input particles STAR file | (required) | Must contain CTF and pose information |
downsample | Downsample picked particle images to size: | 128 | Must be divisible by 2 |
zdim | Dimension of latent variable | 8 | Controls latent space dimensionality |
num_epochs | Total number of training epochs | 25 | |
continue_from_weights | Continue training starting from these initial weights? | False | When Yes, also set weights |
weights | CryoDRGN trained weights pkl file to continue from: | (blank) | Only used when continue_from_weights=Yes |
rand_seed | Random seed | (blank) | Leave blank for non-reproducible |
use_chunk | Split stacks into chunks? | False | Reduces RAM usage |
chunk | Chunk size | 50000 | Active only when use_chunk=Yes |
advanced_options | Edit advanced options? | False | GUI toggle only |
uninvert_data | Do not invert data sign | False | |
checkpoint | Checkpointing interval in N_EPOCHS | 1 | |
log_interval | Logging interval in N_IMGS | 1000 | |
max_threads | Maximum number of CPU cores for data loading | 16 | |
batch_size | Minibatch size | 8 | |
weight_decay | Weight decay in Adam optimizer | 0.0 | |
learning_rate | Learning rate in Adam optimizer | 0.0001 | |
enc_layers | Number of hidden layers in encoder | 3 | |
enc_dim | Size of hidden layers in encoder | 1024 | |
dec_layers | Number of hidden layers in decoder | 3 | |
dec_dim | Size of hidden layers in decoder | 1024 | |
cryoDRGN_other_args | Additional CryoDRGN arguments: | (blank) | Passed directly to cryodrgn train_vae |
Outputs
| Node | Type |
|---|---|
train_<D>/weights.pkl | NODE_MLMODEL |
cryodrgn.abinit_het — CryoDRGN ab initio heterogeneous reconstruction
| Attribute | Value |
|---|---|
| Class | CryodrgnAbinitHetJob |
| Entry point | cryodrgn.abinit_het |
| Output directory | CryoDRGN/ |
| Category | Continuous Heterogeneity |
| External program | cryodrgn |
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 key | Label | Default |
|---|---|---|
zdim | Dimension of latent variable | 8 |
num_epochs | Total number of training epochs | 30 |
Outputs
| Node | Type |
|---|---|
train_<D>/weights.pkl | NODE_MLMODEL |
cryodrgn.abinit_homo — CryoDRGN ab initio homogeneous reconstruction
| Attribute | Value |
|---|---|
| Class | CryodrgnAbinitHomoJob |
| Entry point | cryodrgn.abinit_homo |
| Output directory | CryoDRGN/ |
| Category | Continuous Heterogeneity |
| External program | cryodrgn |
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 key | Label | Default |
|---|---|---|
num_epochs | Total number of training epochs | 30 |
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
| Node | Type |
|---|---|
train_<D>/weights.pkl | NODE_MLMODEL |
train_<D>/reconstruct.mrc | NODE_DENSITYMAP |
cryodrgn.filter — CryoDRGN subset selection
| Attribute | Value |
|---|---|
| Class | CryodrgnFilterJob |
| Entry point | cryodrgn.filter |
| Output directory | Select/ |
| Category | Subset Selection |
| External programs | cryodrgn, 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 key | Label | Default | Notes |
|---|---|---|---|
weights | CryoDRGN trained weights pkl file | (required) | Usually weights.pkl from a cryodrgn.train_vae or cryodrgn.abinit_het job |
Outputs
| Node | Type |
|---|---|
selection.star | NODE_PARTICLEGROUPMETADATA |
inverse_selection.star | NODE_PARTICLEGROUPMETADATA |
cryovae.image_analysis — CryoVAE particle denoising
| Attribute | Value |
|---|---|
| Class | CryoVAE |
| Entry point | cryovae.image_analysis |
| Output directory | CryoVAE/ |
| Category | Image Analysis (from get_category_label(); the class sets no CATEGORY_LABEL) |
| External programs | cryovae, 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 key | Label | Default | Notes |
|---|---|---|---|
input_star | Input particles file name: | (blank) | Mutually exclusive with input_raw_stack |
input_raw_stack | OR: Input a raw particle stack: | (blank) | Mutually exclusive with input_star |
lowpass_filter | Low pass filer before denoising? | True | Filters to 10 Å |
beta | Beta value for VAE: | 0.1 | |
epochs | Max number of epochs: | 100 |
Outputs
| Node | Type |
|---|---|
recons.mrcs | NODE_IMAGE2DSTACK |
denoised_particles.star | NODE_PARTICLEGROUPMETADATA |
cryodann.select.particles — CryoDANN particle filtering
| Attribute | Value |
|---|---|
| Class | CryoDANN |
| Entry point | cryodann.select.particles |
| Output directory | CryoDANN/ |
| Category | Subset Selection |
| External program | cryodann |
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 key | Label | Default | Notes |
|---|---|---|---|
input_starfile | Input particles STAR file: | (blank) | Required if input_stack is blank |
input_stack | OR: Input a particle stack: | (blank) | Required if input_starfile is blank |
run_cryovae | Do cryoVAE denoising? | True | Runs CryoVAE pipeline internally |
vae_beta | Beta value for cryoVAE: | 0.1 | Active when run_cryovae=Yes |
vae_epochs | Max number of epochs for cryoVAE: | 100 | Active when run_cryovae=Yes |
threshold | Score threshold: | 0.006 | Passed to cryodann as --keep_percent; help text: "score threshold to retain top N particles" |
gamma | Gamma value: | 0.01 | Controls domain-adaptation vs classification trade-off |
dann_epochs | Max number of epochs for CryoDANN: | 50 | |
batch_size | Batch size: | 128 | |
lr | Learning rate: | 0.001 | |
train_set | Path for training data: | (required) | Path to training data from the git repo |
Outputs (conditional on options)
| Node | Type | Condition |
|---|---|---|
recons.mrcs | NODE_IMAGE2DSTACK | only when run_cryovae=Yes |
denoised_particles.star | NODE_PARTICLEGROUPMETADATA | only when run_cryovae=Yes |
lightning_logs/index_confidence.txt | NODE_LOGFILE | always |
lightning_logs/good_particles_t<threshold>.star | NODE_PARTICLEGROUPMETADATA | only when input_starfile is set |
parakeet.simulate — Parakeet micrograph simulation
| Attribute | Value |
|---|---|
| Class | ParakeetJob |
| Entry point | parakeet.simulate |
| Output directory | Parakeet/ |
| Category | Simulate (from get_category_label(); the class sets no CATEGORY_LABEL) |
| External programs | parakeet.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 key | Label | Default | Notes |
|---|---|---|---|
use_conf_yaml | Set Parakeet simulation parameters via YAML configuration? | True | When Yes, reads from conf; when No, uses individual parameters |
conf | Parakeet configuration file (YAML format): | (blank) | Required when use_conf_yaml=Yes; node type NODE_PARAMSDATA |
keep_confs | Keep the configuration file (YAML) for every image: | True | |
opticsGroupName | Optics group name | opticsGroup1 | |
particles | Total number of particles to simulate | 1 | |
pdb_filepaths | The filename(s) of the atomic coordinates to use (*.pdb, *.cif) | (blank) | MultiInputNodeJobOption; active when use_conf_yaml=No |
pdb_instances | The number of particles of the corresponding molecule to simulate per micrograph | (blank) | MultiStringJobOption; values separated by ::: |
device | Whether to run on GPU or CPU | gpu | Active when use_conf_yaml=No |
fast_ice | Use the Gaussian Random Field ice model? | False | Active when use_conf_yaml=No |
dqe | Use the DQE model? | False | Active when use_conf_yaml=No |
radiation_damage_model | Use the radiation damage model? | False | Active when use_conf_yaml=No |
Outputs
| Node | Type |
|---|---|
relion/mtf_<energy>kV.star | NODE_MICROSCOPEDATA |
synthetic_micrographs.star | NODE_MICROGRAPHGROUPMETADATA |
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_mpito any job on this page (none register MPI options). - Adding
enc_dim,dec_dim,enc_layers, ordec_layerstocryodrgn.abinit_homo(those belong only tocryodrgn.train_vaeandcryodrgn.abinit_het). - Using
max_threadsoncryodrgn.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.