Skip to content

SSDL-SNU/GenerativeSNUPI

Repository files navigation

Generative SNUPI

A diffusion-based design framework for DNA Origami nanostructures.

Table of Contents

Overview

Generative SNUPI harnesses diffusion-based generative modelling—the paradigm currently redefining protein engineering—to advance DNA-origami design.

Trained on a curated dataset of 450 equilibrium conformations DNA Origami structures generated by the multiscale SNUPI simulator, the framework learns structural priors and outputs strand-level designs that faithfully realise user-specified geometries and functional goals

Features

  • Multi-format Input Support: SVG, PLY, STL, and PT files
  • Conditional Generation: Generate designs from target shapes
  • Automated Routing: Converts coordinates to complete design files
  • Multiple Output Formats: CanDo, BILD, oxDNA, PDB, and PyTorch tensors
  • GPU Acceleration: CUDA support for faster generation

Installation

Prerequisites

  • Python 3.9
  • CUDA 11.7+ (for GPU acceleration)
  • Conda package manager
  • OS: Linux only (Ubuntu 20.04+ recommended) — Windows is not preferred due to NVTX dependencies and Linux-specific CUDA library paths

Environment Setup

Step 1: Get the GenerativeSNUPI source code

Option A – the repo is public
git clone https://github.com/SSDL-SNU/GenerativeSNUPI.git
cd /path/to/GenerativeSNUPI
Option B – the repo is still private

Download or copy the project folder you received (e.g. from Dropbox or a USB stick).

Open a terminal inside that folder:

cd /path/to/GenerativeSNUPI

Tip: Once the repository is made public, you can switch from Option B to Option A at any time by cloning the URL above.

Step 2: Create conda environment

🚀 GPU Installation (CUDA 11.7)
# Create environment
conda create -n generativeSNUPI python=3.9 -y
conda activate generativeSNUPI

# Install PyTorch with CUDA
conda install pytorch==1.13.1 torchvision torchaudio pytorch-cuda=11.7 -c pytorch -c nvidia -y

# Install DGL and PyTorch Geometric
conda install dglteam/label/cu117::dgl -y
pip install torch-geometric==2.2.0 torch-scatter==2.1.1+pt113cu117 torch-sparse==0.6.17+pt113cu117 torch-cluster==1.6.1+pt113cu117 torch-spline-conv==1.2.2+pt113cu117 -f https://data.pyg.org/whl/torch-1.13.1+cu117.html
🖥️ CPU Installation (for systems without GPU)

⚠️ Warning: CPU-only execution is NOT SUPPORTED due to NVTX (NVIDIA Tools Extension) function dependencies. This project requires an NVIDIA GPU to run. The CPU installation option is provided for reference only.

Step 3: Install additional dependencies

pip install ema-pytorch==0.7.7 geomloss==0.2.6 --no-deps
pip install accelerate==0.17.1 e3nn==0.5.6 einops==0.8.1 imageio==2.37.0 matplotlib==3.9.4 meshio==5.3.5 numpy==1.26.4 pandas==2.3.0 plotly==6.2.0 roma==1.5.3 shapely==2.0.7 svgpathtools==1.7.1 svgutils==0.3.4 svgwrite==1.4.3 torchmetrics==0.11.4 tqdm==4.67.1 svg.path==7.0

Usage

Conditional Generation

Generate DNA origami designs from target shapes:

# SVG files
python run_sampling.py --target_shape Flower_Logo.svg --num_samples 5 --design_scaffold_length 2000 --device cuda

# PLY files (2D/3D meshes)
python run_sampling.py --target_shape 01_triangle.ply --num_samples 3 --design_scaffold_length 600 --device cuda

# PT files (preprocessed tensors)
python run_sampling.py --target_shape Circle.pt --num_samples 4 --device cuda
python run_sampling.py --target_shape Monalisa_v1.pt --num_samples 10 --device cuda --no_plots

Input/Output

Input Files

Format Description Location
SVG Vector graphics target_shapes/svg/
PLY 3D mesh files target_shapes/ply/2D/, target_shapes/ply/3D/
STL 3D model files target_shapes/stl/
PT Preprocessed tensors target_shapes/pt/

Output Structure

generated_designs/design_name_YYYYMMDD_HHMMSS/
├── design_name_sample_001.pt      # Generated coordinates
├── design_name_sample_001.cndo    # CanDo design file
├── design_name_sample_001.bild    # Chimera visualization
├── design_name_sample_001.dat     # oxDNA configuration
├── design_name_sample_001.top     # oxDNA topology
├── design_name_sample_001.dat.pdb # PDB structure file
├── design_name_sample_001_mean.pt # PyTorch mean data
└── design_name_sample_001_seq.pt  # PyTorch sequence data

File Usage

  • .cndo: Load in CanDo software for design analysis
  • .bild: Visualize in Chimera/ChimeraX
  • .dat/.top: Molecular dynamics simulations with oxDNA
  • .pdb: Structural analysis in VMD, PyMOL, or Chimera
  • .pt: Machine learning analysis with PyTorch and Simulate with SNUPI

Configuration

Command Line Arguments

Required Parameters

  • Conditional mode: --target_shape - Path to target shape file

Optional Parameters

Parameter Description Default
--num_samples Number of samples to generate 2
--design_scaffold_length Scaffold length for SVG/PLY/STL files 7249
--device Computation device ('cpu' or 'cuda') 'cpu'
--output_dir Custom output directory generated_designs/
--design_name Name prefix for output files Auto-generated
--no_plots Disable visualization plots False
--variation_range Random variation range 0.01

Design Parameters

  • Scaffold Length: Controls target shape complexity (2000-7249 bp optimal)
  • Device: Use cuda for GPU acceleration

Development

System Requirements

  • Python 3.9 (binary wheels compatibility)
  • Windows: Visual C++ 14.3 runtime
  • Linux: GCC 7.5+ or equivalent

Environment Management

# Remove environment
conda env remove -n generativeSNUPI

# Recreate environment
conda create -n generativeSNUPI python=3.9 -y

Directory Structure

├── pretrained_models/    # Pre-trained model files
├── configs/              # Configuration files
├── target_shapes/        # Input shape files
├── generated_designs/    # Output directory
└── run_sampling.py       # Main execution script

Troubleshooting

CUDA Library Compatibility (System CUDA > 11.7)

If your system has a CUDA version newer than 11.7 (e.g. CUDA 12.x or 13.x), DGL may fail to load with an error like:

OSError: libcusparse.so.11: cannot open shared object file: No such file or directory

This happens because DGL 1.1.2+cu117 requires libcudart.so.11.0, libcublas.so.11, and libcusparse.so.11, which are bundled inside the conda environment but not on the default library search path. To resolve this, add the paths to these libraries (typically found under $CONDA_PREFIX/lib and the nvidia/ subdirectories inside your environment's site-packages) to LD_LIBRARY_PATH.

References

De novo design of DNA origami with a generative diffusion model (in preparation)

About

A generative diffusion-based design framework for DNA-origami nanostructures.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages