diff --git a/notebooks/dockgen_inference_results_plotting.ipynb b/notebooks/dockgen_inference_results_plotting.ipynb index b226fa1..c491eb3 100644 --- a/notebooks/dockgen_inference_results_plotting.ipynb +++ b/notebooks/dockgen_inference_results_plotting.ipynb @@ -61,83 +61,51 @@ "source": [ "# General variables\n", "baseline_methods = [\n", + " \"vina_p2rank\",\n", " \"diffdock\",\n", - " \"diffdock_relaxed_protein\",\n", - " \"diffdockv1\",\n", - " \"fabind\",\n", " \"dynamicbind\",\n", " \"neuralplexer\",\n", " \"rfaa\",\n", " \"chai-lab\",\n", - " \"vina_diffdock\",\n", - " \"vina_p2rank\",\n", - " \"consensus_ensemble\",\n", "]\n", "max_num_repeats_per_method = 3\n", "\n", "# Filepaths for each baseline method\n", + "globals()[\"vina_output_dir\"] = os.path.join(\"..\", \"forks\", \"Vina\", \"inference\")\n", "globals()[\"diffdock_output_dir\"] = os.path.join(\"..\", \"forks\", \"DiffDock\", \"inference\")\n", - "globals()[\"diffdockv1_output_dir\"] = os.path.join(\"..\", \"forks\", \"DiffDockv1\", \"inference\")\n", - "globals()[\"fabind_output_dir\"] = os.path.join(\"..\", \"forks\", \"FABind\", \"inference\")\n", "globals()[\"dynamicbind_output_dir\"] = os.path.join(\n", " \"..\", \"forks\", \"DynamicBind\", \"inference\", \"outputs\", \"results\"\n", ")\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", - " globals()[f\"diffdock_dockgen_bust_results_csv_filepath_{repeat_index}\"] = os.path.join(\n", - " globals()[\"diffdock_output_dir\"],\n", - " f\"diffdock_dockgen_output_{repeat_index}\",\n", - " \"bust_results.csv\",\n", - " )\n", - " globals()[f\"diffdock_dockgen_relaxed_bust_results_csv_filepath_{repeat_index}\"] = os.path.join(\n", - " globals()[\"diffdock_output_dir\"],\n", - " f\"diffdock_dockgen_output_{repeat_index}_relaxed\",\n", - " \"bust_results.csv\",\n", - " )\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", - " )\n", - " globals()[\n", - " f\"diffdock_relaxed_protein_dockgen_relaxed_bust_results_csv_filepath_{repeat_index}\"\n", - " ] = os.path.join(\n", - " globals()[\"diffdock_output_dir\"],\n", - " f\"diffdock_dockgen_output_{repeat_index}_relaxed\",\n", - " \"bust_results_protein_relaxed.csv\",\n", - " )\n", + " # PLIF metrics\n", + " globals()[f\"dockgen_plif_metrics_csv_filepath_{repeat_index}\"] = \"dockgen_plif_metrics.csv\"\n", "\n", - " # DiffDock w/o structural cluster training (SCT) results\n", - " globals()[f\"diffdockv1_dockgen_bust_results_csv_filepath_{repeat_index}\"] = os.path.join(\n", - " globals()[\"diffdockv1_output_dir\"],\n", - " f\"diffdock_dockgen_output_{repeat_index}\",\n", + " # P2Rank-Vina results\n", + " globals()[f\"vina_p2rank_dockgen_bust_results_csv_filepath_{repeat_index}\"] = os.path.join(\n", + " globals()[\"vina_output_dir\"],\n", + " f\"vina_p2rank_dockgen_outputs_{repeat_index}\",\n", " \"bust_results.csv\",\n", " )\n", - " globals()[f\"diffdockv1_dockgen_relaxed_bust_results_csv_filepath_{repeat_index}\"] = (\n", + " globals()[f\"vina_p2rank_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", + " globals()[\"vina_output_dir\"],\n", + " f\"vina_p2rank_dockgen_outputs_{repeat_index}_relaxed\",\n", " \"bust_results.csv\",\n", " )\n", " )\n", "\n", - " # FABind results\n", - " globals()[f\"fabind_dockgen_bust_results_csv_filepath_{repeat_index}\"] = os.path.join(\n", - " globals()[\"fabind_output_dir\"],\n", - " f\"fabind_dockgen_output_{repeat_index}\",\n", + " # DiffDock results\n", + " globals()[f\"diffdock_dockgen_bust_results_csv_filepath_{repeat_index}\"] = os.path.join(\n", + " globals()[\"diffdock_output_dir\"],\n", + " f\"diffdock_dockgen_output_{repeat_index}\",\n", " \"bust_results.csv\",\n", " )\n", - " globals()[f\"fabind_dockgen_relaxed_bust_results_csv_filepath_{repeat_index}\"] = os.path.join(\n", - " globals()[\"fabind_output_dir\"],\n", - " f\"fabind_dockgen_output_{repeat_index}_relaxed\",\n", + " globals()[f\"diffdock_dockgen_relaxed_bust_results_csv_filepath_{repeat_index}\"] = os.path.join(\n", + " globals()[\"diffdock_output_dir\"],\n", + " f\"diffdock_dockgen_output_{repeat_index}_relaxed\",\n", " \"bust_results.csv\",\n", " )\n", "\n", @@ -193,77 +161,23 @@ " \"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", - " )\n", - "\n", - " # P2Rank-Vina results\n", - " globals()[f\"vina_p2rank_dockgen_bust_results_csv_filepath_{repeat_index}\"] = os.path.join(\n", - " globals()[\"vina_output_dir\"],\n", - " 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", - " )\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", - " )\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", - " )\n", - "\n", "# Mappings\n", "method_mapping = {\n", + " \"vina_p2rank\": \"P2Rank-Vina\",\n", " \"diffdock\": \"DiffDock-L\",\n", - " \"diffdock_relaxed_protein\": \"-> w/ Relax-Prot\",\n", - " \"diffdockv1\": \"-> w/o SCT\",\n", - " \"fabind\": \"FABind\",\n", " \"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", "}\n", "\n", "method_category_mapping = {\n", + " \"vina_p2rank\": \"Conventional blind\",\n", " \"diffdock\": \"DL-based blind\",\n", - " \"diffdock_relaxed_protein\": \"DL-based blind\",\n", - " \"diffdockv1\": \"DL-based blind\",\n", - " \"fabind\": \"DL-based blind\",\n", " \"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", "}" ] }, @@ -357,6 +271,16 @@ " return list(method_mapping.keys()).index(method)\n", "\n", "\n", + "def assign_category_index(category: str) -> str:\n", + " \"\"\"\n", + " Assign category index for plotting.\n", + "\n", + " :param category: Category name.\n", + " :return: Category index.\n", + " \"\"\"\n", + " return list(method_mapping.values()).index(category)\n", + "\n", + "\n", "def categorize_method(method: str) -> str:\n", " \"\"\"\n", " Categorize method for plotting.\n", @@ -382,6 +306,10 @@ "source": [ "# load and organize the DockGen results CSVs\n", "for repeat_index in range(1, max_num_repeats_per_method + 1):\n", + " globals()[f\"dockgen_plif_metrics_table_{repeat_index}\"] = pd.read_csv(\n", + " globals()[f\"dockgen_plif_metrics_csv_filepath_{repeat_index}\"]\n", + " )\n", + "\n", " globals()[f\"results_table_{repeat_index}\"] = pd.concat(\n", " [\n", " globals()[f\"{method}{config}_bust_results_table_{repeat_index}\"]\n", @@ -396,6 +324,11 @@ " globals()[f\"results_table_{repeat_index}\"].loc[:, \"method_assignment_index\"] = globals()[\n", " f\"results_table_{repeat_index}\"\n", " ][\"method\"].apply(assign_method_index)\n", + " globals()[f\"dockgen_plif_metrics_table_{repeat_index}\"].loc[\n", + " :, \"category_assignment_index\"\n", + " ] = globals()[f\"dockgen_plif_metrics_table_{repeat_index}\"][\"Category\"].apply(\n", + " assign_category_index\n", + " )\n", " globals()[f\"results_table_{repeat_index}\"].loc[:, \"rmsd_within_threshold\"] = (\n", " globals()[f\"results_table_{repeat_index}\"].loc[:, \"rmsd_≤_2å\"].fillna(False)\n", " )\n", @@ -467,7 +400,7 @@ " x=\"method\",\n", " y=\"rmsd\",\n", " hue=\"post-processing\",\n", - " data=combined_relaxed_data,\n", + " data=combined_relaxed_data[combined_relaxed_data[\"rmsd\"] <= 20],\n", " split=True,\n", " inner=\"quartile\",\n", " palette=colors,\n", @@ -475,7 +408,7 @@ ")\n", "\n", "# set labels and title\n", - "plt.xlabel(\"Single-ligand docking\")\n", + "plt.xlabel(\"Primary-ligand docking\")\n", "plt.ylabel(\"RMSD\")\n", "\n", "# rotate x-axis labels for better readability\n", @@ -486,7 +419,7 @@ "\n", "# display the plots\n", "plt.tight_layout()\n", - "plt.savefig(\"dockgen_single_ligand_relaxed_rmsd_violin_plot.png\", dpi=300)\n", + "plt.savefig(\"dockgen_primary_ligand_relaxed_rmsd_violin_plot.png\", dpi=300)\n", "plt.show()" ] }, @@ -499,18 +432,20 @@ "# RMSD ≤ 2 Å Bar Chart of DockGen Set Results (Relaxed vs. Unrelaxed) #\n", "\n", "# prepare data for the bar charts to plot\n", - "colors = [\"#FB8072\", \"#BEBADA\"]\n", + "colors = [\"#FB8072\", \"#BEBADA\", \"#FCCDE5\"]\n", "\n", "bar_width = 0.5\n", - "r1 = [item - 0.25 for item in range(2, 24, 2)]\n", + "r1 = [item - 0.5 for item in range(2, 14, 2)]\n", "r2 = [x + bar_width for x in r1]\n", + "r3 = [x + bar_width for x in r2]\n", "\n", "(\n", " dockgen_rmsd_lt_2_data_list,\n", " dockgen_relaxed_rmsd_lt_2_data_list,\n", " dockgen_rmsd_lt_2_and_pb_valid_data_list,\n", " dockgen_relaxed_rmsd_lt_2_and_pb_valid_data_list,\n", - ") = ([], [], [], [])\n", + " dockgen_plif_wm_data_list,\n", + ") = ([], [], [], [], [])\n", "for repeat_index in range(1, max_num_repeats_per_method + 1):\n", " dockgen_results_table = globals()[f\"results_table_{repeat_index}\"][\n", " (globals()[f\"results_table_{repeat_index}\"][\"dataset\"] == \"DockGen set\")\n", @@ -589,6 +524,15 @@ " dockgen_relaxed_rmsd_lt_2_and_pb_valid_data.sort_values(\"method_assignment_index\")\n", " )\n", "\n", + " # DockGen PLIF-WM results\n", + " dockgen_plif_wm_data = (\n", + " globals()[f\"dockgen_plif_metrics_table_{repeat_index}\"]\n", + " .groupby(\"Category\")\n", + " .agg({\"WM\": \"mean\", \"category_assignment_index\": \"first\"})\n", + " )\n", + " dockgen_plif_wm_data = dockgen_plif_wm_data.sort_values(\"category_assignment_index\")\n", + " dockgen_plif_wm_data_list.append(dockgen_plif_wm_data)\n", + "\n", "# calculate means and standard deviations\n", "dockgen_rmsd_lt_2_data_mean = (\n", " pd.concat([df for df in dockgen_rmsd_lt_2_data_list])\n", @@ -682,10 +626,37 @@ " .sort_values([\"method_assignment_index\"])[\"RMSD ≤ 2 Å & PB-Valid\"]\n", ")\n", "\n", + "# convert PLIF-WM scores to percentages\n", + "dockgen_plif_wm_data_mean = (\n", + " pd.concat([df for df in dockgen_plif_wm_data_list])\n", + " .groupby(\n", + " [\n", + " \"Category\",\n", + " \"category_assignment_index\",\n", + " ]\n", + " )\n", + " .mean()\n", + " .sort_values([\"category_assignment_index\"])[\"WM\"]\n", + " * 100.0\n", + ")\n", + "dockgen_plif_wm_data_std = (\n", + " pd.concat([df for df in dockgen_plif_wm_data_list])\n", + " .groupby(\n", + " [\n", + " \"Category\",\n", + " \"category_assignment_index\",\n", + " ]\n", + " )\n", + " .std()\n", + " .sort_values([\"category_assignment_index\"])[\"WM\"]\n", + " * 100.0\n", + ")\n", + "\n", "dockgen_rmsd_lt_2_data_std.fillna(0, inplace=True)\n", "dockgen_relaxed_rmsd_lt_2_data_std.fillna(0, inplace=True)\n", "dockgen_rmsd_lt_2_and_pb_valid_data_std.fillna(0, inplace=True)\n", "dockgen_relaxed_rmsd_lt_2_and_pb_valid_data_std.fillna(0, inplace=True)\n", + "dockgen_plif_wm_data_std.fillna(0, inplace=True)\n", "\n", "# define font properties\n", "plt.rcParams[\"font.size\"] = 22\n", @@ -738,10 +709,21 @@ " width=bar_width,\n", ")\n", "\n", + "# plot PLIF-WM data for the DockGen set\n", + "dockgen_plif_wm_bar = axis.bar(\n", + " r3,\n", + " dockgen_plif_wm_data_mean,\n", + " yerr=dockgen_plif_wm_data_std,\n", + " label=\"PLIF-WM\",\n", + " color=colors[2],\n", + " hatch=\"\\\\\\\\\\\\\",\n", + " width=bar_width,\n", + ")\n", + "\n", "# add labels, titles, ticks, etc.\n", "axis.set_ylabel(\"Percentage of predictions\")\n", - "axis.set_xlim(1, 23 + 0.1)\n", - "axis.set_ylim(0, 100)\n", + "axis.set_xlim(1, 13 + 0.1)\n", + "axis.set_ylim(0, 125)\n", "\n", "axis.bar_label(dockgen_rmsd_lt_2_bar, fmt=\"{:,.1f}%\", label_type=\"edge\")\n", "axis.bar_label(dockgen_rmsd_lt_2_and_pb_valid_bar, fmt=\"{:,.1f}%\", label_type=\"center\", padding=5)\n", @@ -749,6 +731,7 @@ "axis.bar_label(\n", " dockgen_relaxed_rmsd_lt_2_and_pb_valid_bar, fmt=\"{:,.1f}%\", label_type=\"center\", padding=5\n", ")\n", + "axis.bar_label(dockgen_plif_wm_bar, fmt=\"{:,.1f}%\", label_type=\"edge\")\n", "\n", "axis.yaxis.set_major_formatter(mtick.PercentFormatter())\n", "\n", @@ -757,24 +740,18 @@ "axis.grid(axis=\"y\", color=\"#EAEFF8\")\n", "axis.set_axisbelow(True)\n", "\n", - "axis.set_xticks([2, 4, 6, 8, 9, 10, 12, 14, 16, 18, 19, 20, 22, 22 + 1e-3])\n", + "axis.set_xticks([2, 2 + 1e-3, 4, 6, 8, 8 + 1e-3, 10, 12])\n", "axis.set_xticks([1 + 0.1], minor=True)\n", "axis.set_xticklabels(\n", " [\n", + " \"Conventional blind\",\n", + " \"P2Rank-Vina\",\n", " \"DiffDock-L\",\n", - " \"-> w/ Relax-Prot\",\n", - " \"-> w/o SCT\",\n", - " \"FABind\",\n", - " \"DL-based blind\",\n", " \"DynamicBind\",\n", " \"NeuralPLexer\",\n", + " \"DL-based blind\",\n", " \"RoseTTAFold-AA\",\n", " \"Chai-1\",\n", - " \"DiffDock-L-Vina\",\n", - " \"Conventional blind\",\n", - " \"P2Rank-Vina\",\n", - " \"Ensemble (Con)\",\n", - " \"Hybrid blind\",\n", " ]\n", ")\n", "\n", @@ -786,7 +763,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.0, -0.1, 0.0, 0.0, -0.1]\n", + "vert_alignments = [0.0, -0.1, 0.0, 0.0, 0.0, -0.1, 0.0, 0.0]\n", "for tick, y in zip(axis.get_xticklabels(), vert_alignments):\n", " tick.set_y(y)\n", "\n", @@ -796,21 +773,29 @@ " [\"RMSD ≤ 2Å\", \"RMSD ≤ 2Å & PB-Valid\"],\n", " loc=\"upper right\",\n", " title=\"No post-processing\",\n", - " bbox_to_anchor=(1, 1, -0.20, -0.05),\n", + " bbox_to_anchor=(1, 1, -0.40, -0.05),\n", ")\n", "legend_1 = fig.legend(\n", " [dockgen_relaxed_rmsd_lt_2_bar, dockgen_relaxed_rmsd_lt_2_and_pb_valid_bar],\n", " [\"RMSD ≤ 2Å\", \"RMSD ≤ 2Å & PB-Valid\"],\n", " loc=\"upper right\",\n", " title=\"With relaxation\",\n", + " bbox_to_anchor=(1, 1, -0.20, -0.05),\n", + ")\n", + "legend_2 = fig.legend(\n", + " [dockgen_plif_wm_bar],\n", + " [\"PLIF-WM\"],\n", + " loc=\"upper right\",\n", + " title=\"Protein-ligand interactions\\n (no post-processing)\",\n", " bbox_to_anchor=(1, 1, -0.01, -0.05),\n", ")\n", "legend_0.get_frame().set_alpha(0)\n", "legend_1.get_frame().set_alpha(0)\n", + "legend_2.get_frame().set_alpha(0)\n", "\n", "# display the plots\n", "plt.tight_layout()\n", - "plt.savefig(\"dockgen_single_ligand_relaxed_bar_chart.png\", dpi=300)\n", + "plt.savefig(\"dockgen_primary_ligand_relaxed_bar_chart.png\", dpi=300)\n", "plt.show()" ] } diff --git a/notebooks/dockgen_method_interaction_analysis_plotting.ipynb b/notebooks/dockgen_method_interaction_analysis_plotting.ipynb index c28f6fc..4efb5e1 100644 --- a/notebooks/dockgen_method_interaction_analysis_plotting.ipynb +++ b/notebooks/dockgen_method_interaction_analysis_plotting.ipynb @@ -77,12 +77,12 @@ "source": [ "# General variables\n", "baseline_methods = [\n", + " \"vina_p2rank\",\n", " \"diffdock\",\n", " \"dynamicbind\",\n", " \"neuralplexer\",\n", " \"rfaa\",\n", " \"chai-lab\",\n", - " # \"vina_p2rank\",\n", "]\n", "max_num_repeats_per_method = (\n", " 1 # NOTE: Here, to simplify the analysis, we only consider the first run of each method\n", @@ -99,12 +99,12 @@ "\n", "# Mappings\n", "method_mapping = {\n", + " \"vina_p2rank\": \"P2Rank-Vina\",\n", " \"diffdock\": \"DiffDock-L\",\n", " \"dynamicbind\": \"DynamicBind\",\n", " \"neuralplexer\": \"NeuralPLexer\",\n", " \"rfaa\": \"RoseTTAFold-AA\",\n", " \"chai-lab\": \"Chai-1\",\n", - " \"vina_p2rank\": \"P2Rank-Vina\",\n", "}\n", "\n", "MAX_DOCKGEN_ANALYSIS_PROTEIN_SEQUENCE_LENGTH = (\n", diff --git a/notebooks/dockgen_method_interaction_analysis_plotting.py b/notebooks/dockgen_method_interaction_analysis_plotting.py index 859da61..aed5e62 100644 --- a/notebooks/dockgen_method_interaction_analysis_plotting.py +++ b/notebooks/dockgen_method_interaction_analysis_plotting.py @@ -42,12 +42,12 @@ # %% # General variables baseline_methods = [ + "vina_p2rank", "diffdock", "dynamicbind", "neuralplexer", "rfaa", "chai-lab", - # "vina_p2rank", ] max_num_repeats_per_method = ( 1 # NOTE: Here, to simplify the analysis, we only consider the first run of each method @@ -64,12 +64,12 @@ # Mappings method_mapping = { + "vina_p2rank": "P2Rank-Vina", "diffdock": "DiffDock-L", "dynamicbind": "DynamicBind", "neuralplexer": "NeuralPLexer", "rfaa": "RoseTTAFold-AA", "chai-lab": "Chai-1", - "vina_p2rank": "P2Rank-Vina", } MAX_DOCKGEN_ANALYSIS_PROTEIN_SEQUENCE_LENGTH = ( diff --git a/notebooks/posebusters_benchmark_inference_results_plotting.ipynb b/notebooks/posebusters_benchmark_inference_results_plotting.ipynb index 3e92aa8..dbfee57 100644 --- a/notebooks/posebusters_benchmark_inference_results_plotting.ipynb +++ b/notebooks/posebusters_benchmark_inference_results_plotting.ipynb @@ -61,16 +61,17 @@ "source": [ "# General variables\n", "baseline_methods = [\n", + " # \"vina_p2rank\",\n", " \"diffdock\",\n", " \"dynamicbind\",\n", " \"neuralplexer\",\n", " # \"rfaa\",\n", " \"chai-lab\",\n", - " # \"vina_p2rank\",\n", "]\n", "max_num_repeats_per_method = 3\n", "\n", "# Filepaths for each baseline method\n", + "globals()[\"vina_output_dir\"] = os.path.join(\"..\", \"forks\", \"Vina\", \"inference\")\n", "globals()[\"diffdock_output_dir\"] = os.path.join(\"..\", \"forks\", \"DiffDock\", \"inference\")\n", "globals()[\"dynamicbind_output_dir\"] = os.path.join(\n", " \"..\", \"forks\", \"DynamicBind\", \"inference\", \"outputs\", \"results\"\n", @@ -78,8 +79,21 @@ "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", + " # P2Rank-Vina results\n", + " globals()[f\"vina_p2rank_posebusters_bust_results_csv_filepath_{repeat_index}\"] = os.path.join(\n", + " globals()[\"vina_output_dir\"],\n", + " f\"vina_p2rank_posebusters_benchmark_outputs_{repeat_index}\",\n", + " \"bust_results.csv\",\n", + " )\n", + " globals()[f\"vina_p2rank_posebusters_relaxed_bust_results_csv_filepath_{repeat_index}\"] = (\n", + " os.path.join(\n", + " globals()[\"vina_output_dir\"],\n", + " f\"vina_p2rank_posebusters_benchmark_outputs_{repeat_index}_relaxed\",\n", + " \"bust_results.csv\",\n", + " )\n", + " )\n", + "\n", " # PLIF metrics\n", " globals()[\n", " f\"posebusters_plif_metrics_csv_filepath_{repeat_index}\"\n", @@ -153,37 +167,23 @@ " )\n", " )\n", "\n", - " # P2Rank-Vina results\n", - " globals()[f\"vina_p2rank_posebusters_bust_results_csv_filepath_{repeat_index}\"] = os.path.join(\n", - " globals()[\"vina_output_dir\"],\n", - " f\"vina_p2rank_posebusters_benchmark_outputs_{repeat_index}\",\n", - " \"bust_results.csv\",\n", - " )\n", - " globals()[f\"vina_p2rank_posebusters_relaxed_bust_results_csv_filepath_{repeat_index}\"] = (\n", - " os.path.join(\n", - " globals()[\"vina_output_dir\"],\n", - " f\"vina_p2rank_posebusters_benchmark_outputs_{repeat_index}_relaxed\",\n", - " \"bust_results.csv\",\n", - " )\n", - " )\n", - "\n", "# Mappings\n", "method_mapping = {\n", + " \"vina_p2rank\": \"P2Rank-Vina\",\n", " \"diffdock\": \"DiffDock-L\",\n", " \"dynamicbind\": \"DynamicBind\",\n", " \"neuralplexer\": \"NeuralPLexer\",\n", " \"rfaa\": \"RoseTTAFold-AA\",\n", " \"chai-lab\": \"Chai-1\",\n", - " \"vina_p2rank\": \"P2Rank-Vina\",\n", "}\n", "\n", "method_category_mapping = {\n", + " \"vina_p2rank\": \"Conventional blind\",\n", " \"diffdock\": \"DL-based blind\",\n", " \"dynamicbind\": \"DL-based blind\",\n", " \"neuralplexer\": \"DL-based blind\",\n", " \"rfaa\": \"DL-based blind\",\n", " \"chai-lab\": \"DL-based blind\",\n", - " \"vina_p2rank\": \"Conventional blind\",\n", "}" ] },