Skip to content

Commit

Permalink
Update plots
Browse files Browse the repository at this point in the history
  • Loading branch information
amorehead committed Sep 24, 2024
1 parent 296f81a commit fd39e14
Show file tree
Hide file tree
Showing 5 changed files with 299 additions and 226 deletions.
35 changes: 20 additions & 15 deletions notebooks/casp15_inference_results_plotting.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
" \"neuralplexer\",\n",
" \"neuralplexer_no_ilcl\",\n",
" \"rfaa\",\n",
" \"chai-lab\",\n",
" \"tulip\",\n",
" \"vina_diffdock\",\n",
" \"vina_p2rank\",\n",
Expand All @@ -90,6 +91,7 @@
" \"neuralplexer\": \"NeuralPLexer\",\n",
" \"neuralplexer_no_ilcl\": \"NeuralPLexer w/o ILCL\",\n",
" \"rfaa\": \"RoseTTAFold-AA\",\n",
" \"chai-lab\": \"Chai-1\",\n",
" \"tulip\": \"TULIP\",\n",
" \"vina_diffdock\": \"DiffDock-L-Vina\",\n",
" \"vina_p2rank\": \"P2Rank-Vina\",\n",
Expand All @@ -103,6 +105,7 @@
" \"neuralplexer\": \"DL-based blind\",\n",
" \"neuralplexer_no_ilcl\": \"DL-based blind\",\n",
" \"rfaa\": \"DL-based blind\",\n",
" \"chai-lab\": \"DL-based blind\",\n",
" \"tulip\": \"Conventional blind\",\n",
" \"vina_diffdock\": \"Conventional blind\",\n",
" \"vina_p2rank\": \"Conventional blind\",\n",
Expand Down Expand Up @@ -136,11 +139,11 @@
" \"casp15\",\n",
" f\"top_{method}{'' if 'ensemble' in method else '_ensemble'}_predictions_{repeat_index}\",\n",
" )\n",
" globals()[f\"{method}{config}_scoring_results_csv_filepath_{repeat_index}\"] = (\n",
" os.path.join(\n",
" globals()[f\"{method}_output_dir_{repeat_index}\"] + config,\n",
" \"scoring_results.csv\",\n",
" )\n",
" globals()[\n",
" f\"{method}{config}_scoring_results_csv_filepath_{repeat_index}\"\n",
" ] = os.path.join(\n",
" globals()[f\"{method}_output_dir_{repeat_index}\"] + config,\n",
" \"scoring_results.csv\",\n",
" )\n",
" globals()[f\"{method}{config}_bust_results_csv_filepath_{repeat_index}\"] = os.path.join(\n",
" globals()[f\"{method}_output_dir_{repeat_index}\"] + config,\n",
Expand Down Expand Up @@ -523,7 +526,7 @@
"colors = [\"#FB8072\", \"#BEBADA\"]\n",
"\n",
"bar_width = 0.75\n",
"r1 = [item - 0.25 for item in range(2, 22, 2)]\n",
"r1 = [item - 0.25 for item in range(2, 24, 2)]\n",
"r2 = [x + bar_width for x in r1]\n",
"\n",
"for complex_type in [\"single\", \"multi\"]:\n",
Expand Down Expand Up @@ -716,7 +719,7 @@
" # add labels, titles, ticks, etc.\n",
" axis.set_xlabel(f\"{complex_type.title()}-ligand blind docking ({complex_license})\")\n",
" axis.set_ylabel(\"Percentage of predictions\")\n",
" axis.set_xlim(1, 21 + 0.1)\n",
" axis.set_xlim(1, 23 + 0.1)\n",
" axis.set_ylim(0, 100)\n",
"\n",
" axis.bar_label(casp15_rmsd_lt2_bar, fmt=\"{:,.1f}%\", label_type=\"center\")\n",
Expand All @@ -729,17 +732,18 @@
" axis.grid(axis=\"y\", color=\"#EAEFF8\")\n",
" axis.set_axisbelow(True)\n",
"\n",
" axis.set_xticks([2, 4, 6, 7, 8, 10, 12, 14, 16, 16 + 1e-3, 18, 20, 20 + 1e-3])\n",
" axis.set_xticks([2, 4, 6, 8, 8 + 1e-3, 10, 12, 14, 16, 18, 18 + 1e-3, 20, 22, 22 + 1e-3])\n",
" axis.set_xticks([1 + 0.1], minor=True)\n",
" axis.set_xticklabels(\n",
" [\n",
" \"DiffDock-L\",\n",
" \"DiffDock w/o SCT\",\n",
" \"DynamicBind\",\n",
" \"DL-based blind\",\n",
" \"NeuralPLexer\",\n",
" \"DL-based blind\",\n",
" \"NeuralPLexer w/o ILCL\",\n",
" \"RoseTTAFold-AA\",\n",
" \"Chai-1\",\n",
" \"TULIP\",\n",
" \"DiffDock-L-Vina\",\n",
" \"Conventional blind\",\n",
Expand All @@ -757,7 +761,7 @@
" axis.tick_params(axis=\"y\", which=\"major\", left=\"off\", right=\"on\", color=\"#EAEFF8\")\n",
"\n",
" # vertical alignment of xtick labels\n",
" vert_alignments = [0.0, 0.0, 0.0, -0.1, 0.0, 0.0, 0.0, 0.0, 0.0, -0.1, 0.0, 0.0, -0.1]\n",
" vert_alignments = [0.0, 0.0, 0.0, 0.0, -0.1, 0.0, 0.0, 0.0, 0.0, 0.0, -0.1, 0.0, 0.0, -0.1]\n",
" for tick, y in zip(axis.get_xticklabels(), vert_alignments):\n",
" tick.set_y(y)\n",
"\n",
Expand Down Expand Up @@ -852,7 +856,7 @@
"colors = [\"#FB8072\", \"#BEBADA\"]\n",
"\n",
"bar_width = 0.75\n",
"r1 = [item - 0.25 for item in range(2, 22, 2)]\n",
"r1 = [item - 0.25 for item in range(2, 24, 2)]\n",
"r2 = [x + bar_width for x in r1]\n",
"\n",
"for complex_type in [\"single\", \"multi\"]:\n",
Expand Down Expand Up @@ -1035,7 +1039,7 @@
" # add labels, titles, ticks, etc.\n",
" axis.set_xlabel(f\"{complex_type.title()}-ligand blind docking ({complex_license})\")\n",
" axis.set_ylabel(\"Percentage of complex predictions\")\n",
" axis.set_xlim(1, 21 + 0.1)\n",
" axis.set_xlim(1, 23 + 0.1)\n",
" axis.set_ylim(0, 100)\n",
"\n",
" axis.bar_label(casp15_pb_valid_bar, fmt=\"{:,.1f}%\", label_type=\"center\")\n",
Expand All @@ -1048,17 +1052,18 @@
" axis.grid(axis=\"y\", color=\"#EAEFF8\")\n",
" axis.set_axisbelow(True)\n",
"\n",
" axis.set_xticks([2, 4, 6, 7, 8, 10, 12, 14, 16, 16 + 1e-3, 18, 20, 20 + 1e-3])\n",
" axis.set_xticks([2, 4, 6, 8, 8 + 1e-3, 10, 12, 14, 16, 18, 18 + 1e-3, 20, 22, 22 + 1e-3])\n",
" axis.set_xticks([1 + 0.1], minor=True)\n",
" axis.set_xticklabels(\n",
" [\n",
" \"DiffDock-L\",\n",
" \"DiffDock w/o SCT\",\n",
" \"DynamicBind\",\n",
" \"DL-based blind\",\n",
" \"NeuralPLexer\",\n",
" \"DL-based blind\",\n",
" \"NeuralPLexer w/o ILCL\",\n",
" \"RoseTTAFold-AA\",\n",
" \"Chai-1\",\n",
" \"TULIP\",\n",
" \"DiffDock-L-Vina\",\n",
" \"Conventional blind\",\n",
Expand All @@ -1076,7 +1081,7 @@
" axis.tick_params(axis=\"y\", which=\"major\", left=\"off\", right=\"on\", color=\"#EAEFF8\")\n",
"\n",
" # vertical alignment of xtick labels\n",
" vert_alignments = [0.0, 0.0, 0.0, -0.1, 0.0, 0.0, 0.0, 0.0, 0.0, -0.1, 0.0, 0.0, -0.1]\n",
" vert_alignments = [0.0, 0.0, 0.0, 0.0, -0.1, 0.0, 0.0, 0.0, 0.0, 0.0, -0.1, 0.0, 0.0, -0.1]\n",
" for tick, y in zip(axis.get_xticklabels(), vert_alignments):\n",
" tick.set_y(y)\n",
"\n",
Expand Down
2 changes: 2 additions & 0 deletions notebooks/casp15_method_interaction_analysis_plotting.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
" \"neuralplexer\",\n",
" \"neuralplexer_no_ilcl\",\n",
" \"rfaa\",\n",
" \"chai-lab\",\n",
" \"tulip\",\n",
" \"vina_diffdock\",\n",
" \"vina_p2rank\",\n",
Expand Down Expand Up @@ -103,6 +104,7 @@
" \"neuralplexer\": \"NeuralPLexer\",\n",
" \"neuralplexer_no_ilcl\": \"NeuralPLexer w/o ILCL\",\n",
" \"rfaa\": \"RoseTTAFold-AA\",\n",
" \"chai-lab\": \"Chai-1\",\n",
" \"tulip\": \"TULIP\",\n",
" \"vina_diffdock\": \"DiffDock-L-Vina\",\n",
" \"vina_p2rank\": \"P2Rank-Vina\",\n",
Expand Down
121 changes: 69 additions & 52 deletions notebooks/dockgen_inference_results_plotting.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
" \"dynamicbind\",\n",
" \"neuralplexer\",\n",
" \"rfaa\",\n",
" \"chai-lab\",\n",
" \"vina_diffdock\",\n",
" \"vina_p2rank\",\n",
" \"consensus_ensemble\",\n",
Expand All @@ -83,6 +84,7 @@
")\n",
"globals()[\"neuralplexer_output_dir\"] = os.path.join(\"..\", \"forks\", \"NeuralPLexer\", \"inference\")\n",
"globals()[\"rfaa_output_dir\"] = os.path.join(\"..\", \"forks\", \"RoseTTAFold-All-Atom\", \"inference\")\n",
"globals()[\"chai-lab_output_dir\"] = os.path.join(\"..\", \"forks\", \"chai-lab\", \"inference\")\n",
"globals()[\"vina_output_dir\"] = os.path.join(\"..\", \"forks\", \"Vina\", \"inference\")\n",
"for repeat_index in range(1, max_num_repeats_per_method + 1):\n",
" # DiffDock results\n",
Expand All @@ -98,12 +100,12 @@
" )\n",
"\n",
" # DiffDock (relaxed-protein) results\n",
" globals()[f\"diffdock_relaxed_protein_dockgen_bust_results_csv_filepath_{repeat_index}\"] = (\n",
" os.path.join(\n",
" globals()[\"diffdock_output_dir\"],\n",
" f\"diffdock_dockgen_output_{repeat_index}\",\n",
" \"bust_results.csv\",\n",
" )\n",
" globals()[\n",
" f\"diffdock_relaxed_protein_dockgen_bust_results_csv_filepath_{repeat_index}\"\n",
" ] = os.path.join(\n",
" globals()[\"diffdock_output_dir\"],\n",
" f\"diffdock_dockgen_output_{repeat_index}\",\n",
" \"bust_results.csv\",\n",
" )\n",
" globals()[\n",
" f\"diffdock_relaxed_protein_dockgen_relaxed_bust_results_csv_filepath_{repeat_index}\"\n",
Expand All @@ -119,12 +121,12 @@
" f\"diffdock_dockgen_output_{repeat_index}\",\n",
" \"bust_results.csv\",\n",
" )\n",
" globals()[f\"diffdockv1_dockgen_relaxed_bust_results_csv_filepath_{repeat_index}\"] = (\n",
" os.path.join(\n",
" globals()[\"diffdockv1_output_dir\"],\n",
" f\"diffdock_dockgen_output_{repeat_index}_relaxed\",\n",
" \"bust_results.csv\",\n",
" )\n",
" globals()[\n",
" f\"diffdockv1_dockgen_relaxed_bust_results_csv_filepath_{repeat_index}\"\n",
" ] = os.path.join(\n",
" globals()[\"diffdockv1_output_dir\"],\n",
" f\"diffdock_dockgen_output_{repeat_index}_relaxed\",\n",
" \"bust_results.csv\",\n",
" )\n",
"\n",
" # FABind results\n",
Expand All @@ -145,12 +147,12 @@
" f\"dockgen_{repeat_index}\",\n",
" \"bust_results.csv\",\n",
" )\n",
" globals()[f\"dynamicbind_dockgen_relaxed_bust_results_csv_filepath_{repeat_index}\"] = (\n",
" os.path.join(\n",
" globals()[\"dynamicbind_output_dir\"],\n",
" f\"dockgen_{repeat_index}_relaxed\",\n",
" \"bust_results.csv\",\n",
" )\n",
" globals()[\n",
" f\"dynamicbind_dockgen_relaxed_bust_results_csv_filepath_{repeat_index}\"\n",
" ] = os.path.join(\n",
" globals()[\"dynamicbind_output_dir\"],\n",
" f\"dockgen_{repeat_index}_relaxed\",\n",
" \"bust_results.csv\",\n",
" )\n",
"\n",
" # NeuralPLexer results\n",
Expand All @@ -159,12 +161,12 @@
" f\"neuralplexer_dockgen_outputs_{repeat_index}\",\n",
" \"bust_results.csv\",\n",
" )\n",
" globals()[f\"neuralplexer_dockgen_relaxed_bust_results_csv_filepath_{repeat_index}\"] = (\n",
" os.path.join(\n",
" globals()[\"neuralplexer_output_dir\"],\n",
" f\"neuralplexer_dockgen_outputs_{repeat_index}_relaxed\",\n",
" \"bust_results.csv\",\n",
" )\n",
" globals()[\n",
" f\"neuralplexer_dockgen_relaxed_bust_results_csv_filepath_{repeat_index}\"\n",
" ] = os.path.join(\n",
" globals()[\"neuralplexer_output_dir\"],\n",
" f\"neuralplexer_dockgen_outputs_{repeat_index}_relaxed\",\n",
" \"bust_results.csv\",\n",
" )\n",
"\n",
" # RoseTTAFold-All-Atom results\n",
Expand All @@ -179,18 +181,30 @@
" \"bust_results.csv\",\n",
" )\n",
"\n",
" # Chai-1 results\n",
" globals()[f\"chai-lab_dockgen_bust_results_csv_filepath_{repeat_index}\"] = os.path.join(\n",
" globals()[\"chai-lab_output_dir\"],\n",
" f\"chai-lab_dockgen_outputs_{repeat_index}\",\n",
" \"bust_results.csv\",\n",
" )\n",
" globals()[f\"chai-lab_dockgen_relaxed_bust_results_csv_filepath_{repeat_index}\"] = os.path.join(\n",
" globals()[\"chai-lab_output_dir\"],\n",
" f\"chai-lab_dockgen_outputs_{repeat_index}_relaxed\",\n",
" \"bust_results.csv\",\n",
" )\n",
"\n",
" # DiffDock-L-Vina results\n",
" globals()[f\"vina_diffdock_dockgen_bust_results_csv_filepath_{repeat_index}\"] = os.path.join(\n",
" globals()[\"vina_output_dir\"],\n",
" f\"vina_diffdock_dockgen_outputs_{repeat_index}\",\n",
" \"bust_results.csv\",\n",
" )\n",
" globals()[f\"vina_diffdock_dockgen_relaxed_bust_results_csv_filepath_{repeat_index}\"] = (\n",
" os.path.join(\n",
" globals()[\"vina_output_dir\"],\n",
" f\"vina_diffdock_dockgen_outputs_{repeat_index}_relaxed\",\n",
" \"bust_results.csv\",\n",
" )\n",
" globals()[\n",
" f\"vina_diffdock_dockgen_relaxed_bust_results_csv_filepath_{repeat_index}\"\n",
" ] = os.path.join(\n",
" globals()[\"vina_output_dir\"],\n",
" f\"vina_diffdock_dockgen_outputs_{repeat_index}_relaxed\",\n",
" \"bust_results.csv\",\n",
" )\n",
"\n",
" # P2Rank-Vina results\n",
Expand All @@ -199,28 +213,28 @@
" f\"vina_p2rank_dockgen_outputs_{repeat_index}\",\n",
" \"bust_results.csv\",\n",
" )\n",
" globals()[f\"vina_p2rank_dockgen_relaxed_bust_results_csv_filepath_{repeat_index}\"] = (\n",
" os.path.join(\n",
" globals()[\"vina_output_dir\"],\n",
" f\"vina_p2rank_dockgen_outputs_{repeat_index}_relaxed\",\n",
" \"bust_results.csv\",\n",
" )\n",
" globals()[\n",
" f\"vina_p2rank_dockgen_relaxed_bust_results_csv_filepath_{repeat_index}\"\n",
" ] = os.path.join(\n",
" globals()[\"vina_output_dir\"],\n",
" f\"vina_p2rank_dockgen_outputs_{repeat_index}_relaxed\",\n",
" \"bust_results.csv\",\n",
" )\n",
"\n",
" # Consensus ensemble results\n",
" globals()[f\"consensus_ensemble_dockgen_bust_results_csv_filepath_{repeat_index}\"] = (\n",
" os.path.join(\n",
" os.path.join(\"..\", \"data\", \"test_cases\", \"dockgen\"),\n",
" f\"top_consensus_ensemble_predictions_{repeat_index}\",\n",
" \"bust_results.csv\",\n",
" )\n",
" globals()[\n",
" f\"consensus_ensemble_dockgen_bust_results_csv_filepath_{repeat_index}\"\n",
" ] = os.path.join(\n",
" os.path.join(\"..\", \"data\", \"test_cases\", \"dockgen\"),\n",
" f\"top_consensus_ensemble_predictions_{repeat_index}\",\n",
" \"bust_results.csv\",\n",
" )\n",
" globals()[f\"consensus_ensemble_dockgen_relaxed_bust_results_csv_filepath_{repeat_index}\"] = (\n",
" os.path.join(\n",
" os.path.join(\"..\", \"data\", \"test_cases\", \"dockgen\"),\n",
" f\"top_consensus_ensemble_predictions_{repeat_index}_relaxed\",\n",
" \"bust_results.csv\",\n",
" )\n",
" globals()[\n",
" f\"consensus_ensemble_dockgen_relaxed_bust_results_csv_filepath_{repeat_index}\"\n",
" ] = os.path.join(\n",
" os.path.join(\"..\", \"data\", \"test_cases\", \"dockgen\"),\n",
" f\"top_consensus_ensemble_predictions_{repeat_index}_relaxed\",\n",
" \"bust_results.csv\",\n",
" )\n",
"\n",
"# Mappings\n",
Expand All @@ -232,6 +246,7 @@
" \"dynamicbind\": \"DynamicBind\",\n",
" \"neuralplexer\": \"NeuralPLexer\",\n",
" \"rfaa\": \"RoseTTAFold-AA\",\n",
" \"chai-lab\": \"Chai-1\",\n",
" \"vina_diffdock\": \"DiffDock-L-Vina\",\n",
" \"vina_p2rank\": \"P2Rank-Vina\",\n",
" \"consensus_ensemble\": \"Ensemble (Con)\",\n",
Expand All @@ -245,6 +260,7 @@
" \"dynamicbind\": \"DL-based blind\",\n",
" \"neuralplexer\": \"DL-based blind\",\n",
" \"rfaa\": \"DL-based blind\",\n",
" \"chai-lab\": \"DL-based blind\",\n",
" \"vina_diffdock\": \"Conventional blind\",\n",
" \"vina_p2rank\": \"Conventional blind\",\n",
" \"consensus_ensemble\": \"Hybrid blind\",\n",
Expand Down Expand Up @@ -482,7 +498,7 @@
"colors = [\"#FB8072\", \"#BEBADA\"]\n",
"\n",
"bar_width = 0.5\n",
"r1 = [item - 0.25 for item in range(2, 22, 2)]\n",
"r1 = [item - 0.25 for item in range(2, 24, 2)]\n",
"r2 = [x + bar_width for x in r1]\n",
"\n",
"(\n",
Expand Down Expand Up @@ -720,7 +736,7 @@
"\n",
"# add labels, titles, ticks, etc.\n",
"axis.set_ylabel(\"Percentage of predictions\")\n",
"axis.set_xlim(1, 21 + 0.1)\n",
"axis.set_xlim(1, 23 + 0.1)\n",
"axis.set_ylim(0, 100)\n",
"\n",
"axis.bar_label(dockgen_rmsd_lt_2_bar, fmt=\"{:,.1f}%\", label_type=\"edge\")\n",
Expand All @@ -737,7 +753,7 @@
"axis.grid(axis=\"y\", color=\"#EAEFF8\")\n",
"axis.set_axisbelow(True)\n",
"\n",
"axis.set_xticks([2, 4, 6, 8, 8 + 1e-3, 10, 12, 14, 16, 17, 18, 20, 20 + 1e-3])\n",
"axis.set_xticks([2, 4, 6, 8, 9, 10, 12, 14, 16, 18, 18 + 1e-3, 20, 21, 22])\n",
"axis.set_xticks([1 + 0.1], minor=True)\n",
"axis.set_xticklabels(\n",
" [\n",
Expand All @@ -749,6 +765,7 @@
" \"DynamicBind\",\n",
" \"NeuralPLexer\",\n",
" \"RoseTTAFold-AA\",\n",
" \"Chai-1\",\n",
" \"DiffDock-L-Vina\",\n",
" \"Conventional blind\",\n",
" \"P2Rank-Vina\",\n",
Expand All @@ -765,7 +782,7 @@
"axis.tick_params(axis=\"y\", which=\"major\", left=\"off\", right=\"on\", color=\"#EAEFF8\")\n",
"\n",
"# vertical alignment of xtick labels\n",
"vert_alignments = [0.0, 0.0, 0.0, 0.0, -0.1, 0.0, 0.0, 0.0, 0.0, -0.1, 0.0, 0.0, -0.1]\n",
"vert_alignments = [0.0, 0.0, 0.0, 0.0, -0.1, 0.0, 0.0, 0.0, 0.0, 0.0, -0.1, 0.0, 0.0, -0.1]\n",
"for tick, y in zip(axis.get_xticklabels(), vert_alignments):\n",
" tick.set_y(y)\n",
"\n",
Expand Down
Loading

0 comments on commit fd39e14

Please sign in to comment.