DMcloud is a macromolecular structure modeling tool using point cloud matching with diffusion model for cryo-EM maps at 3-15A resolution
First, clone the DMCloud repository:
git clone https://github.com/kiharalab/DMCloud.git
cd DMCloudDownload 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.tarFirst, install a conda package manager if you don't have one:
- Miniforge (recommended): Download from https://github.com/conda-forge/miniforge
- Miniconda: Download from https://docs.conda.io/en/latest/miniconda.html
Using conda:
conda env create -f environment.yml
conda activate dmcloudOr using mamba (faster alternative):
mamba env create -f environment.yml
mamba activate dmcloudNote: If you installed Miniforge,
mambais included by default. For Miniconda users, install mamba with:conda install mamba -n base -c conda-forge
python DMcloud.py --Source <protein_structures> --Target <ldp_points_or_map_file> --OutPath <output_directory> [options]# 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# 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| 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) |
| 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) |
- Config File Path Resolution: When using MRC/MAP files as targets, DMcloud automatically uses
config/diffusion.jsonas the default configuration. The config path is resolved relative to theDMcloud.pyscript 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: GPL v3. (If you are interested in a different license, for example, for commercial use, please contact us.)
Contact: Genki Terashi ([email protected]) Daisuke Kihara ([email protected])
python diffusion.py -m <input_map_path> --config <config_path> -g <gpu_id> -o <output_directory> -c <contour_level>| 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) |