Skip to content

Commit

Permalink
🎨 assign same colors as in njab
Browse files Browse the repository at this point in the history
- indicate with colors core of comparison
   (100%, no imputation is ground truth)
  • Loading branch information
Henry committed Mar 26, 2024
1 parent d6d13f6 commit 26ee826
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
12 changes: 10 additions & 2 deletions project/10_7_ald_reduced_dataset_plots.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
"COLORS_TO_USE_MAPPTING = vaep.plotting.defaults.color_model_mapping\n",
"COLORS_TO_USE_MAPPTING[NONE_COL_NAME] = COLORS_TO_USE_MAPPTING['None']\n",
"\n",
"COLORS_CONTIGENCY_TABLE = {\n",
" k: f'C{i}' for i, k in enumerate(['FP', 'TN', 'TP', 'FN'])\n",
"}\n",
"\n",
"\n",
"def plot_qvalues(df, x: str, y: list, ax=None, cutoff=0.05,\n",
" alpha=1.0, style='.', markersize=3):\n",
Expand Down Expand Up @@ -242,7 +246,9 @@
").droplevel(-1, axis=1)\n",
")\n",
"da_target_sel_counts = njab.pandas.combine_value_counts(da_target_sel_counts)\n",
"ax = da_target_sel_counts.T.plot.bar(ylabel='count')\n",
"ax = da_target_sel_counts.T.plot.bar(ylabel='count',\n",
" color=[COLORS_CONTIGENCY_TABLE['FN'],\n",
" COLORS_CONTIGENCY_TABLE['TP']])\n",
"ax.locator_params(axis='y', integer=True)\n",
"fname = out_folder / 'lost_signal_da_counts.pdf'\n",
"files_out[fname.name] = fname.as_posix()\n",
Expand Down Expand Up @@ -313,7 +319,9 @@
").droplevel(-1, axis=1)\n",
")\n",
"da_target_sel_counts = njab.pandas.combine_value_counts(da_target_sel_counts)\n",
"ax = da_target_sel_counts.T.plot.bar(ylabel='count')\n",
"ax = da_target_sel_counts.T.plot.bar(ylabel='count',\n",
" color=[COLORS_CONTIGENCY_TABLE['TN'],\n",
" COLORS_CONTIGENCY_TABLE['FP']])\n",
"ax.locator_params(axis='y', integer=True)\n",
"fname = out_folder / 'gained_signal_da_counts.pdf'\n",
"files_out[fname.name] = fname.as_posix()\n",
Expand Down
12 changes: 10 additions & 2 deletions project/10_7_ald_reduced_dataset_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
COLORS_TO_USE_MAPPTING = vaep.plotting.defaults.color_model_mapping
COLORS_TO_USE_MAPPTING[NONE_COL_NAME] = COLORS_TO_USE_MAPPTING['None']

COLORS_CONTIGENCY_TABLE = {
k: f'C{i}' for i, k in enumerate(['FP', 'TN', 'TP', 'FN'])
}


def plot_qvalues(df, x: str, y: list, ax=None, cutoff=0.05,
alpha=1.0, style='.', markersize=3):
Expand Down Expand Up @@ -127,7 +131,9 @@ def plot_qvalues(df, x: str, y: list, ax=None, cutoff=0.05,
).droplevel(-1, axis=1)
)
da_target_sel_counts = njab.pandas.combine_value_counts(da_target_sel_counts)
ax = da_target_sel_counts.T.plot.bar(ylabel='count')
ax = da_target_sel_counts.T.plot.bar(ylabel='count',
color=[COLORS_CONTIGENCY_TABLE['FN'],
COLORS_CONTIGENCY_TABLE['TP']])
ax.locator_params(axis='y', integer=True)
fname = out_folder / 'lost_signal_da_counts.pdf'
files_out[fname.name] = fname.as_posix()
Expand Down Expand Up @@ -171,7 +177,9 @@ def plot_qvalues(df, x: str, y: list, ax=None, cutoff=0.05,
).droplevel(-1, axis=1)
)
da_target_sel_counts = njab.pandas.combine_value_counts(da_target_sel_counts)
ax = da_target_sel_counts.T.plot.bar(ylabel='count')
ax = da_target_sel_counts.T.plot.bar(ylabel='count',
color=[COLORS_CONTIGENCY_TABLE['TN'],
COLORS_CONTIGENCY_TABLE['FP']])
ax.locator_params(axis='y', integer=True)
fname = out_folder / 'gained_signal_da_counts.pdf'
files_out[fname.name] = fname.as_posix()
Expand Down

0 comments on commit 26ee826

Please sign in to comment.