Skip to content

Commit

Permalink
Merge pull request #12 from haddocking/ntxxt-patch-1
Browse files Browse the repository at this point in the history
silence pyg warnings
  • Loading branch information
ntxxt authored May 29, 2024
2 parents 2e4c090 + e697d7f commit 6ca9d04
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ $ cd DeepRank-GNN-esm

2. Install either the CPU or GPU version of DeepRank-GNN-esm
```bash
$ conda env create -f environment-cpu.yml && conda activate deeprank-gnn-esm-cpu-env
$ conda env create -f environment-cpu.yml && conda activate deeprank-gnn-esm-cpu
```
OR
```bash
$ conda env create -f environment-gpu.yml && conda activate deeprank-gnn-esm-gpu-env
$ conda env create -f environment-gpu.yml && conda activate deeprank-gnn-esm-gpu
```

3. Install the command line tool
Expand Down Expand Up @@ -63,8 +63,8 @@ $ wget https://files.rcsb.org/view/1B6C.pdb -q

# make sure the environment is activated
$ conda activate deeprank-gnn-esm-gpu-env
(deeprank-gnn-esm-gpu-env) $ export MODEL=../paper_pretrained_models/scoring_of_docking_models/gnn_esm/treg_yfnat_b64_e20_lr0.001_foldall_esm.pth.tar
(deeprank-gnn-esm-gpu-env) $ deeprank-gnn-esm-predict 1B6C.pdb A B $MODEL
(deeprank-gnn-esm-gpu) $ export MODEL=../paper_pretrained_models/scoring_of_docking_models/gnn_esm/treg_yfnat_b64_e20_lr0.001_foldall_esm.pth.tar
(deeprank-gnn-esm-gpu) $ deeprank-gnn-esm-predict 1B6C.pdb A B $MODEL
2023-06-28 06:08:21,889 predict:64 INFO - Setting up workspace - /home/DeepRank-GNN-esm/1B6C-gnn_esm_pred_A_B
2023-06-28 06:08:21,945 predict:72 INFO - Renumbering PDB file.
2023-06-28 06:08:22,294 predict:104 INFO - Reading sequence of PDB 1B6C.pdb
Expand Down
26 changes: 16 additions & 10 deletions tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 2,
"metadata": {
"vscode": {
"languageId": "powershell"
Expand Down Expand Up @@ -117,12 +117,12 @@
"embedding_path = \"embedding\"\n",
"nproc = 20\n",
"outfile = \"1ATN_residue.hdf5\"\n",
"GraphHDF5(pdb_path = pdb_path,\n",
" embedding_path = embedding_path,\n",
" graph_type = \"residue\",\n",
" outfile = outfile,\n",
" nproc = nproc,\n",
" tmpdir=\"./tmpdir\")"
"hdf5 = GraphHDF5(pdb_path = pdb_path,\n",
" embedding_path = embedding_path,\n",
" graph_type = \"residue\",\n",
" outfile = outfile,\n",
" nproc = nproc,\n",
" tmpdir=\"./tmpdir\")"
]
},
{
Expand All @@ -138,16 +138,21 @@
"metadata": {},
"outputs": [],
"source": [
"import warnings\n",
"warnings.filterwarnings('ignore', category=UserWarning, message='TypedStorage is deprecated')\n",
"\n",
"from deeprank_gnn.ginet import GINet\n",
"from deeprank_gnn.NeuralNet import NeuralNet as NN\n",
"import os\n",
"\n",
"database_test = \"1ATN_residue.hdf5\"\n",
"gnn = GINet\n",
"target = \"fnat\"\n",
"edge_feature = [\"dist\"]\n",
"node_features=[\"type\", \"polarity\", \"bsa\", \"charge\", \"embedding\"]\n",
"threshold = 0.3\n",
"pretrained_model=\"../paper_pretrained_models/scoring_of_docking_models/gnn_esm/treg_yfnat_b64_e20_lr0.001_foldall_esm.pth.tar\"\n",
"device_name = \"cuda:0\"\n",
"device_name = \"cuda:0\" if 'CUDA_VISIBLE_DEVICES' in os.environ and os.environ['CUDA_VISIBLE_DEVICES'] else 'cpu'\n",
"num_workers = 10\n",
"model = NN(\n",
" database_test,\n",
Expand All @@ -159,7 +164,8 @@
" num_workers = num_workers,\n",
" pretrained_model=pretrained_model,\n",
" threshold = threshold)\n",
"model.test(hdf5 = \"GNN_esm_prediction.hdf5\")"
"model.test(hdf5 = \"GNN_esm_prediction.hdf5\")\n",
"print(f'Fnat predictions for input PDBs saved in GNN_esm_prediction.hdf5')"
]
},
{
Expand All @@ -180,7 +186,7 @@
"mol_names = f[\"epoch_0000\"][\"test\"][\"mol\"][()]\n",
"fnats = f[\"epoch_0000\"][\"test\"][\"outputs\"][()]\n",
"for mol, fnat in zip(mol_names, fnats):\n",
" print(mol.decode(), fnat)"
" print(f'Fnat for {mol.decode()}: {fnat}')"
]
}
],
Expand Down

0 comments on commit 6ca9d04

Please sign in to comment.