From 2ff2d49fdf0005b41676bbe2f48c97781d32bb41 Mon Sep 17 00:00:00 2001 From: SeonghwanSeo Date: Mon, 12 Aug 2024 17:00:02 +0900 Subject: [PATCH] bugfix, 2.0.3 --- .gitignore | 1 - feature_extraction.py | 2 +- pyproject.toml | 2 +- src/pmnet/__init__.py | 2 +- src/pmnet/module.py | 2 +- src/pmnet/pharmacophore_model.py | 3 ++- test/maintain.sh | 8 ++++++++ 7 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 test/maintain.sh diff --git a/.gitignore b/.gitignore index bc76713..25b5a33 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,6 @@ run.sh result/ examples/library/ nogit/ -test.sh # Byte-compiled / optimized / DLL files diff --git a/feature_extraction.py b/feature_extraction.py index 02173e8..e152841 100644 --- a/feature_extraction.py +++ b/feature_extraction.py @@ -14,7 +14,7 @@ def __init__(self): help="custom path of protein pdb file (.pdb)", required=True, ) - self.add_argument("--out", type=str, help="save path of features (torch object)", required=True) + self.add_argument("-o", "--out", type=str, help="save path of features (torch object)", required=True) self.add_argument( "--ref_ligand", type=str, diff --git a/pyproject.toml b/pyproject.toml index 258d994..6c051a0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "pharmaconet" -version = "2.0.2" +version = "2.0.3" description = "PharmacoNet: Open-Source Software for Protein-based Pharmacophore Modeling and Virtual Screening" license = { text = "MIT" } authors = [{ name = "Seonghwan Seo", email = "shwan0106@kaist.ac.kr" }] diff --git a/src/pmnet/__init__.py b/src/pmnet/__init__.py index fef68fb..dc1e6dd 100644 --- a/src/pmnet/__init__.py +++ b/src/pmnet/__init__.py @@ -1,6 +1,6 @@ from .pharmacophore_model import PharmacophoreModel -__version__ = "2.0.2" +__version__ = "2.0.3" __citation_information__ = ( "Seo, S., & Kim, W. Y. (2023, December). " "PharmacoNet: Accelerating Large-Scale Virtual Screening by Deep Pharmacophore Modeling. " diff --git a/src/pmnet/module.py b/src/pmnet/module.py index 8ed4eb9..cedbac4 100644 --- a/src/pmnet/module.py +++ b/src/pmnet/module.py @@ -141,7 +141,7 @@ def get_center( extension = os.path.splitext(ref_ligand_path)[1] assert extension in [".sdf", ".pdb", ".mol2"] ref_ligand = next(pybel.readfile(extension[1:], str(ref_ligand_path))) - x, y, z = np.mean([atom.coords for atom in ref_ligand.atoms], axis=0, dtype=np.float32).to_list() + x, y, z = np.mean([atom.coords for atom in ref_ligand.atoms], axis=0, dtype=np.float32).tolist() return float(x), float(y), float(z) @torch.no_grad() diff --git a/src/pmnet/pharmacophore_model.py b/src/pmnet/pharmacophore_model.py index 2bc9cae..aafba26 100644 --- a/src/pmnet/pharmacophore_model.py +++ b/src/pmnet/pharmacophore_model.py @@ -121,7 +121,8 @@ def create( center = (x, y, z) graph = DensityMapGraph(center, resolution, size) for node in hotspot_infos: - graph.add_node(node["type"], node["position"], node["score"], node["map"]) + x, y, z = tuple(node["hotspot_position"].tolist()) + graph.add_node(node["nci_type"], (x, y, z), float(node["hotspot_score"]), node["point_map"]) graph.setup() model = cls() diff --git a/test/maintain.sh b/test/maintain.sh new file mode 100644 index 0000000..ad4a4a7 --- /dev/null +++ b/test/maintain.sh @@ -0,0 +1,8 @@ +/bin/rm -rf result/6oim +python modeling.py --cuda --pdb 6oim +python modeling.py --cuda --pdb 6oim --ref_ligand ./result/6oim/6oim_B_MG.pdb +python modeling.py --cuda --protein ./result/6oim/6oim.pdb --prefix 6oim +python modeling.py --cuda --protein ./result/6oim/6oim.pdb --ref_ligand ./result/6oim/6oim_B_MG.pdb --prefix 6oim +python modeling.py --cuda --protein ./result/6oim/6oim.pdb --center 1.872 -8.260 -1.361 --prefix 6oim +python screening.py -p ./result/6oim/6oim_D_MOV_model.pm -d ./examples/library/ --cpus 4 -o tmp.csv +python feature_extraction.py --cuda -p ./result/6oim/6oim.pdb --center 1.872 -8.260 -1.361 -o tmp.pt