loodvanniekerkginkgo commited on
Commit
de75bee
·
1 Parent(s): f80e240

Added new metrics (here and to dataset), and loaded results once

Browse files
Files changed (2) hide show
  1. app.py +19 -19
  2. data/metrics_all.csv +26 -21
app.py CHANGED
@@ -57,7 +57,7 @@ def make_submission(
57
  return "✅ Your submission has been received! Sit tight and your scores will appear on the leaderboard shortly."
58
 
59
 
60
- def get_leaderboard_table(assay: str | None = None):
61
  # ds = load_dataset(results_repo, split='train', download_mode="force_redownload")
62
  # full_df = pd.DataFrame(ds)
63
  # full_df['full results'] = full_df['result_filename'].apply(lambda x: make_boundary_clickable(x)).astype(str)
@@ -69,18 +69,15 @@ def get_leaderboard_table(assay: str | None = None):
69
  # to_show['user'] = to_show['user'].apply(lambda x: make_user_clickable(x)).astype(str)
70
 
71
  # Previously hosted on HF hub, local for now (Can also pull directly from github backend)
72
- column_order = ["model", "property", "spearman", "spearman_abs"] # "assay",
73
- ds = load_dataset(results_repo, split='no_low_spearman', download_mode="force_redownload")
74
- df = pd.DataFrame(ds).drop_duplicates(subset=["model", "assay"])
75
- df["property"] = df["assay"].map(ASSAY_RENAME)
76
- df = df.query("assay.isin(@ASSAY_RENAME.keys())")
77
  if assay is not None:
78
  df = df[df['assay'] == assay]
79
  df = df[column_order]
80
  return df.sort_values(by="spearman_abs", ascending=False)
81
 
82
- def get_leaderboard_object(assay: str | None = None):
83
- df = get_leaderboard_table(assay=assay)
84
  filter_columns = ["model"]
85
  if assay is None:
86
  filter_columns.append("property")
@@ -98,28 +95,31 @@ def get_leaderboard_object(assay: str | None = None):
98
  def show_output_box(message):
99
  return gr.update(value=message, visible=True)
100
 
101
- #
102
- # def gradio_interface() -> gr.Blocks:
 
 
 
 
103
  with gr.Blocks() as demo:
104
  gr.Markdown("""
105
  ## Welcome to the Ginkgo Antibody Developability Benchmark Leaderboard!
106
 
107
  Participants can submit their model to the leaderboard by
108
  """)
 
109
  with gr.Tabs(elem_classes="tab-buttons"):
110
- with gr.TabItem("🚀 Leaderboard", elem_id="abdev-benchmark-tab-table"):
111
- gr.Markdown("# Antibody Developability Benchmark Leaderboard")
112
-
113
- get_leaderboard_object()
114
- # TODO: this is not going to update well, need to fix
115
-
116
- # gr.Markdown("Extra info here")
117
-
118
  # Procedurally make these 5 tabs
119
  for assay in ASSAY_LIST:
120
  with gr.TabItem(f"{ASSAY_EMOJIS[assay]} {ASSAY_RENAME[assay]}", elem_id=f"abdev-benchmark-tab-table"):
121
  gr.Markdown(f"# {ASSAY_RENAME[assay]} (measured by {assay})")
122
- get_leaderboard_object(assay=assay)
 
 
 
 
 
 
123
 
124
  with gr.TabItem("❔About", elem_id="abdev-benchmark-tab-table"):
125
  gr.Markdown(
 
57
  return "✅ Your submission has been received! Sit tight and your scores will appear on the leaderboard shortly."
58
 
59
 
60
+ def get_leaderboard_table(df_results: pd.DataFrame, assay: str | None = None):
61
  # ds = load_dataset(results_repo, split='train', download_mode="force_redownload")
62
  # full_df = pd.DataFrame(ds)
63
  # full_df['full results'] = full_df['result_filename'].apply(lambda x: make_boundary_clickable(x)).astype(str)
 
69
  # to_show['user'] = to_show['user'].apply(lambda x: make_user_clickable(x)).astype(str)
70
 
71
  # Previously hosted on HF hub, local for now (Can also pull directly from github backend)
72
+ column_order = ["model", "property", "spearman", "spearman_abs"]
73
+ df = df_results.query("assay.isin(@ASSAY_RENAME.keys())").copy()
 
 
 
74
  if assay is not None:
75
  df = df[df['assay'] == assay]
76
  df = df[column_order]
77
  return df.sort_values(by="spearman_abs", ascending=False)
78
 
79
+ def get_leaderboard_object(df_results: pd.DataFrame, assay: str | None = None):
80
+ df = get_leaderboard_table(df_results=df_results, assay=assay)
81
  filter_columns = ["model"]
82
  if assay is None:
83
  filter_columns.append("property")
 
95
  def show_output_box(message):
96
  return gr.update(value=message, visible=True)
97
 
98
+ def fetch_hf_results():
99
+ ds = load_dataset(results_repo, split='no_low_spearman', download_mode="force_redownload")
100
+ df = pd.DataFrame(ds).drop_duplicates(subset=["model", "assay"])
101
+ df["property"] = df["assay"].map(ASSAY_RENAME)
102
+ return df
103
+
104
  with gr.Blocks() as demo:
105
  gr.Markdown("""
106
  ## Welcome to the Ginkgo Antibody Developability Benchmark Leaderboard!
107
 
108
  Participants can submit their model to the leaderboard by
109
  """)
110
+ df = fetch_hf_results()
111
  with gr.Tabs(elem_classes="tab-buttons"):
 
 
 
 
 
 
 
 
112
  # Procedurally make these 5 tabs
113
  for assay in ASSAY_LIST:
114
  with gr.TabItem(f"{ASSAY_EMOJIS[assay]} {ASSAY_RENAME[assay]}", elem_id=f"abdev-benchmark-tab-table"):
115
  gr.Markdown(f"# {ASSAY_RENAME[assay]} (measured by {assay})")
116
+ get_leaderboard_object(df_results=df, assay=assay)
117
+
118
+ with gr.TabItem("🚀 Overall", elem_id="abdev-benchmark-tab-table"):
119
+ gr.Markdown("# Antibody Developability Benchmark Leaderboard over all properties")
120
+
121
+ get_leaderboard_object(df_results=df)
122
+ # TODO: this is not going to update well, need to fix
123
 
124
  with gr.TabItem("❔About", elem_id="abdev-benchmark-tab-table"):
125
  gr.Markdown(
data/metrics_all.csv CHANGED
@@ -1,21 +1,26 @@
1
- spearman,assay,model,spearman_abs
2
- 0.422834774225429,HIC,Aggrescan3D - aggrescan_average_score,0.422834774225429
3
- 0.358762795727933,AC-SINS_pH7.4,TAP - PNC,0.358762795727933
4
- 0.3585224061081473,HIC,Aggrescan3D - aggrescan_90_score,0.3585224061081473
5
- 0.3365516014806938,PR_CHO,Saprot_VH - solubility_probability,0.3365516014806938
6
- 0.3203773185543964,AC-SINS_pH7.4,TAP - SFvCSP,0.3203773185543964
7
- 0.3044160918625593,HIC,Aggrescan3D - aggrescan_max_score,0.3044160918625593
8
- 0.2450651623577951,HIC,TAP - SFvCSP,0.2450651623577951
9
- 0.2381972244142228,PR_CHO,TAP - SFvCSP,0.2381972244142228
10
- 0.1924791603648384,Tm2,Saprot_VH - stability_score,0.1924791603648384
11
- 0.1923458958277369,HIC,TAP - CDR Length,0.1923458958277369
12
- 0.1878766623808878,Titer,AntiFold,0.1878766623808878
13
- 0.18059398754127,HIC,DeepViscosity,0.18059398754127
14
- 0.1691412287169806,AC-SINS_pH7.4,TAP - PPC,0.1691412287169806
15
- 0.151234196032203,PR_CHO,TAP - PNC,0.151234196032203
16
- 0.1501689804134715,AC-SINS_pH7.4,TAP - CDR Length,0.1501689804134715
17
- 0.1423756688786398,Titer,TAP - PPC,0.1423756688786398
18
- 0.1406309504998865,PR_CHO,Aggrescan3D - aggrescan_max_score,0.1406309504998865
19
- 0.1218057192943458,Tm2,AntiFold,0.1218057192943458
20
- 0.1144051722170351,HIC,hic_model_name,0.1144051722170351
21
- 0.0747719620306879,HIC,Aggrescan3D - aggrescan_cdrh3_average_score,0.0747719620306879
 
 
 
 
 
 
1
+ assay,model,spearman,spearman_cross_val,top_10_recall,top_10_recall_cross_val
2
+ HIC,Aggrescan3D - aggrescan_average_score,0.422834774225429,,0.3333333333333333,
3
+ AC-SINS_pH7.4,TAP - linear regression,0.4019194824087021,0.3401456689218918,0.375,0.2799999999999999
4
+ HIC,TAP - linear regression,0.3622075317102941,0.2222991438172065,0.4166666666666667,0.43
5
+ AC-SINS_pH7.4,TAP - PNC,0.358762795727933,,0.2916666666666667,
6
+ HIC,Aggrescan3D - aggrescan_90_score,0.3585224061081473,,0.2083333333333333,
7
+ PR_CHO,Saprot_VH - solubility_probability,0.3365516014806938,,0.0833333333333333,
8
+ AC-SINS_pH7.4,TAP - SFvCSP,0.3203773185543964,,0.2083333333333333,
9
+ HIC,Aggrescan3D - aggrescan_max_score,0.3044160918625593,,0.2083333333333333,
10
+ PR_CHO,TAP - linear regression,0.260631929274264,0.1560705020744792,0.8333333333333334,0.47
11
+ HIC,TAP - SFvCSP,0.2450651623577951,,0.2083333333333333,
12
+ PR_CHO,TAP - SFvCSP,0.2381972244142228,,0.0,
13
+ Tm2,Saprot_VH - stability_score,0.1924791603648384,,0.1666666666666666,
14
+ HIC,TAP - CDR Length,0.1923458958277369,,0.0833333333333333,
15
+ Titer,AntiFold,0.1878766623808878,,0.0833333333333333,
16
+ HIC,DeepViscosity,0.18059398754127,,0.0416666666666666,
17
+ AC-SINS_pH7.4,TAP - PPC,0.1691412287169806,,0.0833333333333333,
18
+ Titer,TAP - linear regression,0.1682403605307924,0.1129210260701206,0.3333333333333333,0.38
19
+ PR_CHO,TAP - PNC,0.151234196032203,,0.0416666666666666,
20
+ AC-SINS_pH7.4,TAP - CDR Length,0.1501689804134715,,0.0,
21
+ Titer,TAP - PPC,0.1423756688786398,,0.0833333333333333,
22
+ PR_CHO,Aggrescan3D - aggrescan_max_score,0.1406309504998865,,0.0833333333333333,
23
+ Tm2,AntiFold,0.1218057192943458,,0.125,
24
+ HIC,hic_model_name,0.1144051722170351,0.1511895582680471,0.1666666666666666,0.05
25
+ Tm2,TAP - linear regression,0.0844935706523633,-0.1153965363405958,0.6666666666666666,0.64
26
+ HIC,Aggrescan3D - aggrescan_cdrh3_average_score,0.0747719620306879,,0.25,