nanovis / DiffFit

DiffFit: Visually-Guided Differentiable Fitting of Molecule Structures to Cryo-EM Map
Other
5 stars 0 forks source link

Install DiffFit to ChimeraX #1

Closed RodenLuo closed 6 months ago

RodenLuo commented 6 months ago

To build and install the plugin

devel build D:\GIT\DiffFitViewer; devel install D:\GIT\DiffFitViewer

Commands to be typed in cmd, change the path to ChimeraX Python

Install PyTorch via

C:\Users\luod\AppData\Local\ChimeraX\bin\python.exe -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121

Install BioPython, mrcfile, scikit-learn

C:\Users\luod\AppData\Local\ChimeraX\bin\python.exe -m pip install biopython mrcfile scikit-learn

Now, DiffFit is fully installed.

Use these commands to prepare the simulated volumes in a batch processing mode when necessary.

runscript "D:\GIT\DiffFitViewer\src\split_chains.py" "D:\GIT\DiffFitViewer\dev_data\input\8SMK_all_subunits_shifted\8smk_shifted.cif" "D:\GIT\DiffFitViewer\dev_data\input\8SMK_all_subunits_shifted\subunits" 3.5 0.835

runscript "D:\GIT\DiffFitViewer\src\convert2mrc_npy.py" "D:\Research\IPM\PoseEstimation\DiffComp3D\data3D\dev_comp\domain_fit_demo_all\subunits_cif" "D:\Research\IPM\PoseEstimation\DiffComp3D\data3D\dev_comp\domain_fit_demo_all\subunits_mrc" "D:\Research\IPM\PoseEstimation\DiffComp3D\data3D\dev_comp\domain_fit_demo_all\subunits_npy" 4.0 1.37

The following replies are not necessary. They were used in early development.

RodenLuo commented 6 months ago

Download these two scripts and place in the script folder:

https://github.com/RodenLuo/DiffFitViewer/blob/get_DiffFit_in/script/common.py https://github.com/RodenLuo/DiffFitViewer/blob/get_DiffFit_in/script/DiffAtomComp.py

import sys
sys.path.append('D:\\Research\\IPM\\PoseEstimation\\DiffFitViewer\\script')
from DiffAtomComp import diff_atom_comp

e_sqd_log = diff_atom_comp("D:\Research\IPM\PoseEstimation\DiffFitViewer\dev_data\input\domain_fit_demo_3domains\density2.mrc", 0.7, 100, "D:\Research\IPM\PoseEstimation\DiffFitViewer\dev_data\input\domain_fit_demo_3domains\subunits_cif", "D:\Research\IPM\PoseEstimation\DiffFitViewer\dev_data\input\domain_fit_demo_3domains\subunits_mrc", out_dir="D:\Research\IPM\PoseEstimation\DiffFitViewer\dev_data\output", negative_space_value=-0.5, N_shifts=10, N_quaternions=20, out_dir_exist_ok=True)

A new folder is created at D:\Research\IPM\PoseEstimation\DiffFitViewer\dev_data\output for results

The variable e_sqd_log might be directly passed from memory to DiffFit Viewer.

Expose the first 5 parameters for beginner users; expose all for expert users.

RodenLuo commented 6 months ago

image

RodenLuo commented 6 months ago

image