From fe78979ca9f9dc5a455a452a4c05ecb86e55cbfa Mon Sep 17 00:00:00 2001 From: Xiaotong Xu <102460988+ntxxt@users.noreply.github.com> Date: Tue, 28 May 2024 11:57:22 +0200 Subject: [PATCH 1/2] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 73fb2d7..1292be2 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 From e697d7f598e202ecf2125671b44775c85705b431 Mon Sep 17 00:00:00 2001 From: Xiaotong Xu <102460988+ntxxt@users.noreply.github.com> Date: Wed, 29 May 2024 22:38:36 +0200 Subject: [PATCH 2/2] silence some pyg warnings --- tutorial.ipynb | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/tutorial.ipynb b/tutorial.ipynb index 7a71a43..2871410 100644 --- a/tutorial.ipynb +++ b/tutorial.ipynb @@ -55,7 +55,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 2, "metadata": { "vscode": { "languageId": "powershell" @@ -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\")" ] }, { @@ -138,8 +138,13 @@ "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", @@ -147,7 +152,7 @@ "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", @@ -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')" ] }, { @@ -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}')" ] } ],