Skip to content

DMcloud is a macromolecular structure modeling tool using point cloud matching with diffusion model for cryo-EM maps at 3-15A resolution.

License

Notifications You must be signed in to change notification settings

kiharalab/DMCloud

Repository files navigation

DMCloud

License: GPL v3 Python Platform Conda Dependencies

DMcloud is a macromolecular structure modeling tool using point cloud matching with diffusion model for cryo-EM maps at 3-15A resolution

Installation

Clone the Repository

First, clone the DMCloud repository:

git clone https://github.com/kiharalab/DMCloud.git
cd DMCloud

Download Model Weights

Download the pre-trained diffusion model weights:

mkdir -p best_model
wget -O best_model/diffusion_best.pth.tar https://github.com/kiharalab/DMCloud/releases/download/weights/diffusion_best.pth.tar

Prerequisites

First, install a conda package manager if you don't have one:

Environment Setup

Using conda:

conda env create -f environment.yml
conda activate dmcloud

Or using mamba (faster alternative):

mamba env create -f environment.yml
mamba activate dmcloud

Note: If you installed Miniforge, mamba is included by default. For Miniconda users, install mamba with: conda install mamba -n base -c conda-forge

Usage

python DMcloud.py --Source <protein_structures> --Target <ldp_points_or_map_file> --OutPath <output_directory> [options]

Examples

Example 1: Basic Fitting with MRC Map (with Diffusion)

# Fit AlphaFold2 model to cryo-EM map using automatic diffusion to generate LDP points
# Uses default config file (config/diffusion.json)
python DMcloud.py --Source example/af2_model.pdb --Target example/1461_complex.mrc --OutPath ./results/ --contour 0.52

Example 2: Scoring Mode for Existing Models

# Score existing fitted models without running fitting
python DMcloud.py --Source fitted_model.pdb --Target example/1461_complex.mrc --OutPath ./scoring_results/ --ScoreMode True --ScoreWindow 3

Parameters

Parameter Type Default Required Description
--Source str - Yes Protein structures in PDB or CIF format. For multiple files, split filenames by comma or use pattern like DATA/*.pdb
--Target str - Yes LDP points in CIF format, or MRC/MAP file (diffusion will be run automatically to generate LDP points)
--OutPath str ./FitModels/ No Final output directory
--ransac_dcut float 3.0 No Corresponding distance cutoff for RANSAC
--icp_dcut float 3.0 No Corresponding distance cutoff for ICP
--clash_dist float 2.0 No Clash definition distance
--n_ransac_iter int 2000000 No Number of RANSAC iterations
--n_iter int 1 No Number of iterations
--MinClstSize int 200 No Minimum size of fitting
--LocalRadius float 8.0 No Local radius of FPFH
--LocalNN int 5 No Number of nearest neighbors for FPFH
--LocalSegment int 100 No Size of the local segment for RANSAC
--LocalSegmentDistance float 15.0 No Radius of the local segment for RANSAC
--MinSim float 50.0 No Minimum similarity of FPFH
--Alpha float 1.0 No DBSCAN weight = exp(-alpha*deviation)
--AveLDDT_cut float 0.4 No Average LDDT cutoff
--NrRate float 0.95 No Non-redundant ratio of models (A&B)/(AorB)>X
--DownsampleSpace float 10.0 No Sampling space for local fitting
--FillGaps float 5.0 No Fill gaps within X angstroms from aligned positions
--Threads int 8 No Maximum number of threads in CP
--CPtime int 600 No Maximum CP computing time (seconds)
--CPpen int 1400 No Penalty for conflict models
--pLDDT float 50.0 No pLDDT filtering. If negative, use all points. Set to 100 for all points
--DomEps float 5.0 No Domain splitting eps parameter
--DomSamples int 5 No Domain splitting samples parameter
--SaveTemp bool False No Save temporary files
--pkl str - No Resume computation from the pkl file of fitting
--cp_pkl str - No Resume computation for CP part
--cp_size int 2000 No Number of models per iteration
--ScoreMode bool False No Scoring mode for the given model
--ScoreWindow int 0 No Window size of the score ±N (0 = only that residue)

Diffusion-Related Parameters (for MRC/MAP files)

Parameter Type Default Required Description
--diffusion_config str config/diffusion.json No Config file for diffusion parameters (uses default config/diffusion.json when target is MRC/MAP file)
--diffusion_gpu str 0 No GPU ID for diffusion (when target is MRC/MAP file, defaults to 0)
--contour float 0.0 No Contour level for input map (when target is MRC/MAP file)

Important Notes

  • Config File Path Resolution: When using MRC/MAP files as targets, DMcloud automatically uses config/diffusion.json as the default configuration. The config path is resolved relative to the DMcloud.py script location, so the tool works correctly when called from any directory.
  • Cross-Directory Usage: You can run DMcloud from any directory, and it will automatically find the default config file relative to its installation location.

License

License: GPL v3. (If you are interested in a different license, for example, for commercial use, please contact us.)

Contact

Contact: Genki Terashi ([email protected]) Daisuke Kihara ([email protected])


Standalone Backbone Diffusion Module

Usage

python diffusion.py -m <input_map_path> --config <config_path> -g <gpu_id> -o <output_directory> -c <contour_level>

Parameters

Parameter Type Default Required Description
-m, --map str - Yes Input map path
--config str config/diffusion.json No Config path specifying diffusion and LDP parameters (defaults to config/diffusion.json)
-g, --gpu str - No GPU ID to use
-o, --output str - No Output directory
-c, --contour float 0.0 No Contour level for input map (suggested: 0.5 × author_contour)

About

DMcloud is a macromolecular structure modeling tool using point cloud matching with diffusion model for cryo-EM maps at 3-15A resolution.

Resources

License

Stars

Watchers

Forks

Packages

No packages published