This repository contains code for running a generative pipeline for transmembrane β-barrel (TMB) design. It includes scripts demonstrating how to use TMB_RFD2 for backbone generation and TMB_MPNN for sequence design, as well as notebooks describing the curation and filtering of the distillation set used for training.
git clone https://github.com/baker-laboratory/TMB_pipeline.git
cd TMB_pipelineThe example commands in this repository use the following environment variables.
mkdir -p weights environments
export TMB_PIPELINE_DIR="$PWD"
export WEIGHTS_DIR="$TMB_PIPELINE_DIR/weights"
export ENV_DIR="$TMB_PIPELINE_DIR/environments"You may change the directory names if desired, but make sure the exported paths match your chosen locations.
Navigate to the weights directory and download the checkpoints.
cd "$WEIGHTS_DIR"
# TMB_RFD2 checkpoint for standard backbone generation
curl -O https://files.ipd.uw.edu/pub/TMB_pipeline/TMB_RFD2/TMB_RFD2.pt
# TMB_RFD2 checkpoint for motif scaffolding
curl -O https://files.ipd.uw.edu/pub/TMB_pipeline/TMB_RFD2/TMB_RFD2_motif_scaffolding.pt
# TMB_MPNN checkpoint for standard sequence design
curl -O https://files.ipd.uw.edu/pub/TMB_pipeline/TMB_MPNN/TMB_MPNN.pth
# TMB_MPNN checkpoint for tuning hydrophobic thickness
curl -O https://files.ipd.uw.edu/pub/TMB_pipeline/TMB_MPNN/TMB_MPNN_tuning_hydrophobic_thickness.pthSet checkpoint paths.
export TMB_RFD2_CKPT_PATH="$WEIGHTS_DIR/TMB_RFD2.pt"
export TMB_RFD2_MOTIF_SCAFFOLDING_CKPT_PATH="$WEIGHTS_DIR/TMB_RFD2_motif_scaffolding.pt"
export TMB_MPNN_CKPT_PATH="$WEIGHTS_DIR/TMB_MPNN.pth"
export TMB_MPNN_COND_CKPT_PATH="$WEIGHTS_DIR/TMB_MPNN_tuning_hydrophobic_thickness.pth"Navigate to the environments directory and download the containers.
cd "$ENV_DIR"
curl -O https://files.ipd.uw.edu/pub/TMB_pipeline/sif_file/modulus_latest.sif
curl -O https://files.ipd.uw.edu/pub/TMB_pipeline/sif_file/TMB_RFD2.sif
curl -O https://files.ipd.uw.edu/pub/TMB_pipeline/sif_file/TMB_MPNN.sifSet container paths.
export MODULUS_APPTAINER_PATH="$ENV_DIR/modulus_latest.sif"
export TMB_RFD2_APPTAINER_PATH="$ENV_DIR/TMB_RFD2.sif"
export TMB_MPNN_APPTAINER_PATH="$ENV_DIR/TMB_MPNN.sif"The container variables are used as follows:
# General utilities / examples
apptainer exec "$MODULUS_APPTAINER_PATH" python --version
# TMB_RFD2 backbone generation
apptainer exec "$TMB_RFD2_APPTAINER_PATH" python --version
# TMB_MPNN sequence design
apptainer exec "$TMB_MPNN_APPTAINER_PATH" python --versionCheck that all paths are set correctly.
echo "$TMB_PIPELINE_DIR"
echo "$WEIGHTS_DIR"
echo "$ENV_DIR"
echo "$TMB_RFD2_CKPT_PATH"
echo "$TMB_RFD2_MOTIF_SCAFFOLDING_CKPT_PATH"
echo "$TMB_MPNN_CKPT_PATH"
echo "$TMB_MPNN_COND_CKPT_PATH"
echo "$MODULUS_APPTAINER_PATH"
echo "$TMB_RFD2_APPTAINER_PATH"
echo "$TMB_MPNN_APPTAINER_PATH"Check that the files exist.
ls "$TMB_RFD2_CKPT_PATH"
ls "$TMB_RFD2_MOTIF_SCAFFOLDING_CKPT_PATH"
ls "$TMB_MPNN_CKPT_PATH"
ls "$TMB_MPNN_COND_CKPT_PATH"
ls "$MODULUS_APPTAINER_PATH"
ls "$TMB_RFD2_APPTAINER_PATH"
ls "$TMB_MPNN_APPTAINER_PATH"Environment variables are not permanent unless added to your shell startup file. If you open a new terminal session, rerun:
cd /path/to/TMB_pipeline
export TMB_PIPELINE_DIR="$PWD"
export WEIGHTS_DIR="$TMB_PIPELINE_DIR/weights"
export ENV_DIR="$TMB_PIPELINE_DIR/environments"
export TMB_RFD2_CKPT_PATH="$WEIGHTS_DIR/TMB_RFD2.pt"
export TMB_RFD2_MOTIF_SCAFFOLDING_CKPT_PATH="$WEIGHTS_DIR/TMB_RFD2_motif_scaffolding.pt"
export TMB_MPNN_CKPT_PATH="$WEIGHTS_DIR/TMB_MPNN.pth"
export TMB_MPNN_COND_CKPT_PATH="$WEIGHTS_DIR/TMB_MPNN_tuning_hydrophobic_thickness.pth"
export MODULUS_APPTAINER_PATH="$ENV_DIR/modulus_latest.sif"
export TMB_RFD2_APPTAINER_PATH="$ENV_DIR/TMB_RFD2.sif"
export TMB_MPNN_APPTAINER_PATH="$ENV_DIR/TMB_MPNN.sif"The notebook at Distillation_set_curation/distillation_set.ipynb loads the distillation-set silent file from:
- Distillation_set_curation/distillation_set.silent by default, or
- the path provided by the
DISTILLATION_SILENT_PATHenvironment variable.
The silent file is large, so it is intentionally excluded from git. Keep a local copy in the path above, or point the environment variable at your own copy before running the notebook.
This notebook also expects a PyRosetta-enabled environment. It adds TMB_RFD2/TMB_RFD2_code to sys.path automatically so it can reuse the repository's shared silent-file reader.
All assets are hosted at:
https://files.ipd.uw.edu/pub/TMB_pipeline/
This pipeline assumes access to:
- a SLURM cluster
- GPU resources for full-scale runs
- Singularity or Apptainer