Skip to content

Commit

Permalink
Update notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
amorehead committed Feb 3, 2025
1 parent 47bbb92 commit 80aa109
Showing 1 changed file with 29 additions and 4 deletions.
33 changes: 29 additions & 4 deletions notebooks/failure_modes_analysis_plotting.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1378,6 +1378,7 @@
"\n",
"failed_complexes_to_study_further = []\n",
"failed_complex_pdb_ids_to_study_further = []\n",
"failed_complex_function_annotations_to_study_further = []\n",
"for complex_pdb_id in collated_complexes:\n",
" collated_complex_chains = collated_complexes[complex_pdb_id]\n",
" all_chains_after_cutoff_deposition_date = True\n",
Expand All @@ -1393,22 +1394,46 @@
" all_chains_after_cutoff_deposition_date = False\n",
" break\n",
" if all_chains_after_cutoff_deposition_date:\n",
" complex_pdb_id_ = complex_pdb_id.lower().split(\"_\")[0]\n",
" if complex_pdb_id_ == \"?\":\n",
" continue\n",
" if complex_pdb_id_ in pdb_info_cache:\n",
" complex_pdb_info = pdb_info_cache[complex_pdb_id_]\n",
" else:\n",
" complex_pdb_info = pypdb.get_all_info(complex_pdb_id_)\n",
" pdb_info_cache[complex_pdb_id_] = complex_pdb_info\n",
" if not complex_pdb_info:\n",
" continue\n",
" complex_function_annotation = (\n",
" # NOTE: these represent functional keywords\n",
" complex_pdb_info[\"struct_keywords\"][\"pdbx_keywords\"]\n",
" .lower()\n",
" .split(\", \")[0]\n",
" )\n",
" failed_complexes_to_study_further.append(collated_complex_chains)\n",
" failed_complex_pdb_ids_to_study_further.append(complex_pdb_id)\n",
" print(f\"{complex_pdb_id}: {collated_complex_chains}\")\n",
" failed_complex_function_annotations_to_study_further.append(complex_function_annotation)\n",
" print(f\"{complex_pdb_id}, {complex_function_annotation} : {collated_complex_chains}\")\n",
"\n",
"for complex_index, complex_pdb_id in enumerate(failed_complex_pdb_ids_to_study_further):\n",
"for complex_index, (complex_pdb_id, complex_function_annotation) in enumerate(\n",
" zip(\n",
" failed_complex_pdb_ids_to_study_further,\n",
" failed_complex_function_annotations_to_study_further,\n",
" )\n",
"):\n",
" if complex_index == 0:\n",
" print()\n",
" pb_path = os.path.join(\n",
" \"..\", \"data\", \"posebusters_benchmark_set\", f\"{complex_pdb_id.upper()}_*\", \"*.pdb\"\n",
" )\n",
" if glob.glob(pb_path):\n",
" pb_path = glob.glob(pb_path)[0]\n",
" print(f\"Posebusters Benchmark target: {complex_pdb_id} -> {pb_path}\")\n",
" print(\n",
" f\"Posebusters Benchmark target: {complex_pdb_id}, {complex_function_annotation} -> {pb_path}\"\n",
" )\n",
" else:\n",
" casp_matches = [k for k, v in casp15_target_pdb_id_mapping.items() if v == complex_pdb_id]\n",
" print(f\"CASP15 target: {complex_pdb_id} -> {casp_matches}\")\n",
" print(f\"CASP15 target: {complex_pdb_id}, {complex_function_annotation} -> {casp_matches}\")\n",
"\n",
"print(\n",
" f\"{len(failed_complexes_to_study_further)} ((failed complex, deposition date), (top match, deposition date)) novel (multi-chain) protein-ligand PDB complexes AlphaFold 3 failed to predict that are worth studying further.\"\n",
Expand Down

0 comments on commit 80aa109

Please sign in to comment.