Skip to content

Commit

Permalink
fix error in data processing tutorials notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
gcroci2 committed Feb 19, 2024
1 parent 6ab611d commit 43fb72d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 22 deletions.
16 changes: 5 additions & 11 deletions tutorials/data_generation_ppi.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,7 @@
" grid_map_method=grid_map_method,\n",
")\n",
"\n",
"print(\n",
" f'The queries processing is done. The generated HDF5 files are in {os.path.join(processed_data_path, \"residue\")}.'\n",
")"
"print(f'The queries processing is done. The generated HDF5 files are in {os.path.join(processed_data_path, \"residue\")}.')"
]
},
{
Expand Down Expand Up @@ -341,7 +339,7 @@
"outputs": [],
"source": [
"processed_data = glob.glob(os.path.join(processed_data_path, \"residue\", \"*.hdf5\"))\n",
"dataset = GraphDataset(processed_data)\n",
"dataset = GraphDataset(processed_data, target=\"binary\")\n",
"df = dataset.hdf5_to_pandas()\n",
"df.head()"
]
Expand All @@ -360,9 +358,7 @@
"metadata": {},
"outputs": [],
"source": [
"fname = os.path.join(\n",
" processed_data_path, \"residue\", \"_\".join([\"res_mass\", \"distance\", \"electrostatic\"])\n",
")\n",
"fname = os.path.join(processed_data_path, \"residue\", \"_\".join([\"res_mass\", \"distance\", \"electrostatic\"]))\n",
"dataset.save_hist(features=[\"res_mass\", \"distance\", \"electrostatic\"], fname=fname)\n",
"\n",
"im = img.imread(fname + \".png\")\n",
Expand Down Expand Up @@ -480,9 +476,7 @@
" grid_map_method=grid_map_method,\n",
")\n",
"\n",
"print(\n",
" f'The queries processing is done. The generated HDF5 files are in {os.path.join(processed_data_path, \"atomic\")}.'\n",
")"
"print(f'The queries processing is done. The generated HDF5 files are in {os.path.join(processed_data_path, \"atomic\")}.')"
]
},
{
Expand All @@ -500,7 +494,7 @@
"outputs": [],
"source": [
"processed_data = glob.glob(os.path.join(processed_data_path, \"atomic\", \"*.hdf5\"))\n",
"dataset = GraphDataset(processed_data)\n",
"dataset = GraphDataset(processed_data, target=\"binary\")\n",
"df = dataset.hdf5_to_pandas()\n",
"df.head()"
]
Expand Down
21 changes: 10 additions & 11 deletions tutorials/data_generation_srv.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,7 @@
" grid_map_method=grid_map_method,\n",
")\n",
"\n",
"print(\n",
" f'The queries processing is done. The generated HDF5 files are in {os.path.join(processed_data_path, \"residue\")}.'\n",
")"
"print(f'The queries processing is done. The generated HDF5 files are in {os.path.join(processed_data_path, \"residue\")}.')"
]
},
{
Expand Down Expand Up @@ -359,7 +357,7 @@
"outputs": [],
"source": [
"processed_data = glob.glob(os.path.join(processed_data_path, \"residue\", \"*.hdf5\"))\n",
"dataset = GraphDataset(processed_data)\n",
"dataset = GraphDataset(processed_data, target=\"binary\")\n",
"df = dataset.hdf5_to_pandas()\n",
"df.head()"
]
Expand All @@ -378,9 +376,7 @@
"metadata": {},
"outputs": [],
"source": [
"fname = os.path.join(\n",
" processed_data_path, \"residue\", \"_\".join([\"res_mass\", \"distance\", \"electrostatic\"])\n",
")\n",
"fname = os.path.join(processed_data_path, \"residue\", \"_\".join([\"res_mass\", \"distance\", \"electrostatic\"]))\n",
"dataset.save_hist(features=[\"res_mass\", \"distance\", \"electrostatic\"], fname=fname)\n",
"\n",
"im = img.imread(fname + \".png\")\n",
Expand Down Expand Up @@ -500,9 +496,7 @@
" grid_map_method=grid_map_method,\n",
")\n",
"\n",
"print(\n",
" f'The queries processing is done. The generated HDF5 files are in {os.path.join(processed_data_path, \"atomic\")}.'\n",
")"
"print(f'The queries processing is done. The generated HDF5 files are in {os.path.join(processed_data_path, \"atomic\")}.')"
]
},
{
Expand All @@ -520,7 +514,7 @@
"outputs": [],
"source": [
"processed_data = glob.glob(os.path.join(processed_data_path, \"atomic\", \"*.hdf5\"))\n",
"dataset = GraphDataset(processed_data)\n",
"dataset = GraphDataset(processed_data, target=\"binary\")\n",
"df = dataset.hdf5_to_pandas()\n",
"df.head()"
]
Expand Down Expand Up @@ -548,6 +542,11 @@
"source": [
"Note that some of the features are different from the ones generated with the residue-level queries. There are indeed features in `deeprank2.features.components` module which are generated only in atomic graphs, i.e. `atom_type`, `atom_charge`, and `pdb_occupancy`, because they don't make sense only in the atomic graphs' representation.\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
}
],
"metadata": {
Expand Down

0 comments on commit 43fb72d

Please sign in to comment.