MidAtBest commited on
Commit
8dd6c47
·
1 Parent(s): 2cd0864

fix: fix naming

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +50 -18
src/streamlit_app.py CHANGED
@@ -58,31 +58,36 @@ COLORS = {
58
 
59
 
60
  ASSAY_TYPE_MAPPING = {
61
- 'ATAC-seq': 'Chromatin Accessibility',
62
- 'DNase-seq': 'Chromatin Accessibility',
63
- 'Histone ChIP-seq': 'Histone modifications',
64
- 'TF ChIP-seq': 'Chromatin Accessibility',
65
- 'PRO-cap': 'Transcription initiation',
66
  'eCLIP': 'RNA binding sites',
67
- 'RNA-seq': 'Gene Expression',
68
  'ribo-seq': 'mRNA translation',
69
- 'Annotation': 'Genome Annotation',
 
 
 
 
 
70
  }
71
 
72
  ASSAY_COLORS = {
73
- 'Chromatin Accessibility': '#004697',
74
- 'Histone modifications': '#cc0000',
75
- 'Transcription initiation': '#ff9900',
76
  'RNA binding sites': '#9933cc',
77
- 'Gene Expression': '#009900',
78
  'mRNA translation': '#ff6699',
79
- 'Genome Annotation': '#ffcc00',
80
  "intron": '#004697',
81
  "exon": '#cc0000',
82
  "splice acceptor": '#ff9900',
83
  "start codon": '#9933cc',
84
  }
85
- ASSAY_COLORS["Other"] = "#808080"
86
 
87
  MODEL_COLORS = {
88
  "NTv3 650M (pos)": COLORS['blue_0'],
@@ -618,7 +623,7 @@ def build_convergence_df(
618
  # -------------------------
619
  # X axis selection
620
  # -------------------------
621
- if x_mode == "Steps":
622
  if "best_step" not in df.columns:
623
  return pd.DataFrame(columns=["Model", "X", "Performance"])
624
 
@@ -760,6 +765,33 @@ def main():
760
  if sidebar_toggle(model, value=True, key=f"model_{model}"):
761
  selected_models.append(model)
762
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
763
  # --- Main content ---
764
  leaderboard_df = build_leaderboard(
765
  benchmark_name, selected_species, selected_assays, selected_models, selected_datasets
@@ -926,7 +958,7 @@ def main():
926
 
927
  fig_scatter.update_layout(
928
  legend=dict(
929
- title="Assay type",
930
  x=0.98,
931
  y=0.1,
932
  xanchor="right",
@@ -944,7 +976,7 @@ def main():
944
 
945
  x_mode = st.selectbox(
946
  "X-axis",
947
- options=["GPU hours", "Steps"],
948
  index=0,
949
  key=f"conv_x_mode_{benchmark_name}",
950
  )
@@ -973,7 +1005,7 @@ def main():
973
  )
974
  fig_conv.update_layout(
975
  height=550,
976
- xaxis_title=("GPU hours" if x_mode == "GPU hours" else x_mode),
977
  yaxis_title=cfg["metric_label"],
978
  plot_bgcolor="rgba(0,0,0,0)",
979
  paper_bgcolor="rgba(0,0,0,0)",
@@ -985,7 +1017,7 @@ def main():
985
  )
986
 
987
  # Log scale only makes sense for hours (and sometimes best_step)
988
- if x_mode in ["GPU hours"]:
989
  fig_conv.update_xaxes(
990
  type="log",
991
  dtick=1,
 
58
 
59
 
60
  ASSAY_TYPE_MAPPING = {
61
+ 'ATAC-seq': 'chromatin accessibility',
62
+ 'DNase-seq': 'chromatin accessibility',
63
+ 'Histone ChIP-seq': 'histone modifications',
64
+ 'TF ChIP-seq': 'chromatin accessibility',
65
+ 'PRO-cap': 'transcription initiation',
66
  'eCLIP': 'RNA binding sites',
67
+ 'RNA-seq': 'gene expression',
68
  'ribo-seq': 'mRNA translation',
69
+ 'Annotation': 'genome annotation',
70
+ "Exon": "exon",
71
+ "Intron": "intron",
72
+ "Splice acceptor": "splice acceptor",
73
+ "Start codon": "start codon",
74
+
75
  }
76
 
77
  ASSAY_COLORS = {
78
+ 'chromatin accessibility': '#004697',
79
+ 'histone modifications': '#cc0000',
80
+ 'transcription initiation': '#ff9900',
81
  'RNA binding sites': '#9933cc',
82
+ 'gene expression': '#009900',
83
  'mRNA translation': '#ff6699',
84
+ 'genome annotation': '#ffcc00',
85
  "intron": '#004697',
86
  "exon": '#cc0000',
87
  "splice acceptor": '#ff9900',
88
  "start codon": '#9933cc',
89
  }
90
+ ASSAY_COLORS["other"] = "#808080"
91
 
92
  MODEL_COLORS = {
93
  "NTv3 650M (pos)": COLORS['blue_0'],
 
623
  # -------------------------
624
  # X axis selection
625
  # -------------------------
626
+ if x_mode == "Steps (billions)":
627
  if "best_step" not in df.columns:
628
  return pd.DataFrame(columns=["Model", "X", "Performance"])
629
 
 
765
  if sidebar_toggle(model, value=True, key=f"model_{model}"):
766
  selected_models.append(model)
767
 
768
+ # -------------------------
769
+ # ✅ Validation: require ≥1 selection per relevant category
770
+ # -------------------------
771
+ missing = []
772
+
773
+ # Always required
774
+ if not selected_species:
775
+ missing.append("Species")
776
+ if not selected_models:
777
+ missing.append("Models")
778
+
779
+ # Required depending on benchmark
780
+ if cfg.get("has_assay_type", False) and not selected_assays:
781
+ missing.append("Assay types")
782
+
783
+ if benchmark_name == "Genome Annotation" and not selected_datasets:
784
+ missing.append("Genome annotations")
785
+
786
+ if missing:
787
+ # Show a single message and prevent *any* further display
788
+ st.error(
789
+ "Please select at least one item in each category. Currently missing: "
790
+ + ", ".join(missing)
791
+ + "."
792
+ )
793
+ st.stop()
794
+
795
  # --- Main content ---
796
  leaderboard_df = build_leaderboard(
797
  benchmark_name, selected_species, selected_assays, selected_models, selected_datasets
 
958
 
959
  fig_scatter.update_layout(
960
  legend=dict(
961
+ title="Assay type" if benchmark_name == "Functional Tracks" else "Genome Annotation",
962
  x=0.98,
963
  y=0.1,
964
  xanchor="right",
 
976
 
977
  x_mode = st.selectbox(
978
  "X-axis",
979
+ options=["GPU (hours)", "Steps (billions)"],
980
  index=0,
981
  key=f"conv_x_mode_{benchmark_name}",
982
  )
 
1005
  )
1006
  fig_conv.update_layout(
1007
  height=550,
1008
+ xaxis_title=("GPU (hours)" if x_mode == "GPU (hours)" else x_mode),
1009
  yaxis_title=cfg["metric_label"],
1010
  plot_bgcolor="rgba(0,0,0,0)",
1011
  paper_bgcolor="rgba(0,0,0,0)",
 
1017
  )
1018
 
1019
  # Log scale only makes sense for hours (and sometimes best_step)
1020
+ if x_mode in ["GPU (hours)"]:
1021
  fig_conv.update_xaxes(
1022
  type="log",
1023
  dtick=1,