Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
HaotianZhangAI4Science committed May 18, 2023
1 parent 53f0d97 commit baf3ff7
Showing 19 changed files with 11,551 additions and 129 deletions.
1,050 changes: 1,050 additions & 0 deletions tmp/geoattn_gnn.ipynb

Large diffs are not rendered by default.

1,375 changes: 1,375 additions & 0 deletions tmp/geodesic_gnn.ipynb

Large diffs are not rendered by default.

950 changes: 950 additions & 0 deletions tmp/model_development.ipynb

Large diffs are not rendered by default.

Binary file modified utils/__pycache__/surface.cpython-39.pyc
Binary file not shown.
Binary file modified utils/__pycache__/transforms.cpython-39.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion utils/datasets/__init__.py
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
import os
import numpy as np
from torch.utils.data import Subset
from .pl import SurfLigandPairDataset
from .dataset import SurfLigandPairDataset


def get_dataset(config, *args, **kwargs):
Binary file modified utils/datasets/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
Binary file added utils/datasets/__pycache__/dataset.cpython-39.pyc
Binary file not shown.
6 changes: 3 additions & 3 deletions utils/datasets/pl.py → utils/datasets/dataset.py
Original file line number Diff line number Diff line change
@@ -11,12 +11,12 @@

class SurfLigandPairDataset(Dataset):

def __init__(self, raw_path, transform=None):
def __init__(self, raw_path, suffix='_processed.lmdb', name2id='_name2id.pt', transform=None):
super().__init__()
self.raw_path = raw_path.rstrip('/')
self.index_path = os.path.join(self.raw_path, 'index.pkl')
self.processed_path = os.path.join(os.path.dirname(self.raw_path), os.path.basename(self.raw_path) + '_processed.lmdb')
self.name2id_path = os.path.join(os.path.dirname(self.raw_path), os.path.basename(self.raw_path) + '_name2id.pt')
self.processed_path = os.path.join(os.path.dirname(self.raw_path), os.path.basename(self.raw_path) + suffix)
self.name2id_path = os.path.join(os.path.dirname(self.raw_path), os.path.basename(self.raw_path) + name2id)
self.transform = transform
self.db = None
self.keys = None
704 changes: 704 additions & 0 deletions utils/leadopt.py

Large diffs are not rendered by default.

644 changes: 644 additions & 0 deletions utils/masif/6F7I.sdf

Large diffs are not rendered by default.

5,888 changes: 5,888 additions & 0 deletions utils/masif/6F7I_noligand.pdb

Large diffs are not rendered by default.

689 changes: 689 additions & 0 deletions utils/masif/6F7I_noligand_pocket_8.0.ply

Large diffs are not rendered by default.

Binary file modified utils/masif/__pycache__/generate_prot_ply.cpython-36.pyc
Binary file not shown.
Binary file modified utils/masif/__pycache__/generate_prot_ply.cpython-39.pyc
Binary file not shown.
64 changes: 64 additions & 0 deletions utils/masif/gen_ply.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"#os.environ[\"LD_LIBRARY_PATH\"] = '/home/haotian/Molecule_Generation/APBS-3.0.0.Linux/lib:/home/haotian/software/miniconda3/envs/deepdock/lib'\n",
"msms_bin=\"/home/haotian/Molecule_Generation/SurfBP/dataset/install_software/APBS-3.0.0.Linux/bin/msms\"\n",
"apbs_bin = '/home/haotian/Molecule_Generation/SurfBP/dataset/install_software/APBS-3.0.0.Linux/bin/apbs'\n",
"pdb2pqr_bin=\"/home/haotian/Molecule_Generation/SurfBP/dataset/install_software/pdb2pqr-linux-bin64-2.1.1/pdb2pqr\"\n",
"multivalue_bin=\"/home/haotian/Molecule_Generation/SurfBP/dataset/install_software/APBS-3.0.0.Linux/share/apbs/tools/bin/multivalue\""
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"from generate_prot_ply import compute_inp_surface"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"prot_path = './6F7I_noligand.pdb'\n",
"lig_path = './6F7I.sdf'\n",
"compute_inp_surface(prot_path,lig_path)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3.6.15 ('surf_maker')",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.15"
},
"orig_nbformat": 4,
"vscode": {
"interpreter": {
"hash": "43285577f0cb8bf3462fa2876b934996820ec37ae2cd1190b73c5736fa092e38"
}
}
},
"nbformat": 4,
"nbformat_minor": 2
}
13 changes: 9 additions & 4 deletions utils/masif/generate_prot_ply.py
Original file line number Diff line number Diff line change
@@ -26,11 +26,16 @@
from save_ply import save_ply


msms_bin="./install_software/APBS-3.0.0.Linux/bin/msms"
apbs_bin = './install_software/APBS-3.0.0.Linux/bin/apbs'
pdb2pqr_bin="./install_software/pdb2pqr-linux-bin64-2.1.1/pdb2pqr"
multivalue_bin="./install_software/APBS-3.0.0.Linux/share/apbs/tools/bin/multivalue"
# msms_bin="./install_software/APBS-3.0.0.Linux/bin/msms"
# apbs_bin = './install_software/APBS-3.0.0.Linux/bin/apbs'
# pdb2pqr_bin="./install_software/pdb2pqr-linux-bin64-2.1.1/pdb2pqr"
# multivalue_bin="./install_software/APBS-3.0.0.Linux/share/apbs/tools/bin/multivalue"

#os.environ["LD_LIBRARY_PATH"] = '/home/haotian/Molecule_Generation/APBS-3.0.0.Linux/lib:/home/haotian/software/miniconda3/envs/deepdock/lib'
msms_bin="/home/haotian/Molecule_Generation/SurfBP/dataset/install_software/APBS-3.0.0.Linux/bin/msms"
apbs_bin = '/home/haotian/Molecule_Generation/SurfBP/dataset/install_software/APBS-3.0.0.Linux/bin/apbs'
pdb2pqr_bin="/home/haotian/Molecule_Generation/SurfBP/dataset/install_software/pdb2pqr-linux-bin64-2.1.1/pdb2pqr"
multivalue_bin="/home/haotian/Molecule_Generation/SurfBP/dataset/install_software/APBS-3.0.0.Linux/share/apbs/tools/bin/multivalue"
def compute_inp_surface(prot_path,
lig_path,
outdir='.',
16 changes: 8 additions & 8 deletions utils/surface.py
Original file line number Diff line number Diff line change
@@ -29,22 +29,22 @@ def geodesic_matrix(pos,edge_index):
return shortest_path_mat


def dst2knn_graph(dst_mat, num_knn=24, self_loop=False):
'''
dst_mat = distance_matrix(pos,pos)
geo_mat = geodesic_matrix(pos,edge_index)
'''
def dst2knnedge(dst_mat, num_knn=24, self_loop=False):
knn_edge_index_src = []
knn_edge_index_tgt = []
knn_edge_dist = []
num_nodes = dst_mat.shape[0]
for node_idx in range(num_nodes):
knn_edge_index_src.extend([node_idx]*num_knn)

if self_loop:
knn_edge_index_tgt.extend(np.argsort(dst_mat[node_idx])[num_knn+1])
knn_edge_index_tgt.extend(np.argsort(dst_mat[node_idx])[:num_knn])
knn_edge_dist.extend(np.sort(dst_mat[node_idx])[:num_knn])
else:
knn_edge_index_tgt.extend(np.argsort(dst_mat[node_idx])[1:num_knn+1])

return np.array([knn_edge_index_src,knn_edge_index_tgt])
knn_edge_dist.extend(np.sort(dst_mat[node_idx])[1:num_knn+1])

return torch.tensor(np.array([knn_edge_index_src,knn_edge_index_tgt])), torch.tensor(np.array(knn_edge_dist,dtype=np.float32))


def read_ply(path, read_face=None):
279 changes: 166 additions & 113 deletions utils/transforms.py

Large diffs are not rendered by default.

0 comments on commit baf3ff7

Please sign in to comment.