lighteternal commited on
Commit
e329b09
·
verified ·
1 Parent(s): 15b1532

Use HTML sections for Space layout so custom styling applies

Browse files
Files changed (2) hide show
  1. __pycache__/app.cpython-310.pyc +0 -0
  2. app.py +26 -44
__pycache__/app.cpython-310.pyc CHANGED
Binary files a/__pycache__/app.cpython-310.pyc and b/__pycache__/app.cpython-310.pyc differ
 
app.py CHANGED
@@ -705,7 +705,7 @@ def load_example(example_name: str):
705
 
706
 
707
  with gr.Blocks(title="BioAssayAlign Compatibility Explorer", analytics_enabled=False, css=CSS, theme=THEME) as demo:
708
- gr.Markdown(
709
  """
710
  <div id="hero">
711
  <div class="hero-grid">
@@ -732,7 +732,7 @@ with gr.Blocks(title="BioAssayAlign Compatibility Explorer", analytics_enabled=F
732
 
733
  with gr.Row():
734
  with gr.Column(scale=5):
735
- gr.Markdown(
736
  """
737
  <div class="panel-note">
738
  Use structured assay fields when possible. Missing fields are allowed, but species, readout, format, and target metadata usually improve ranking quality.
@@ -740,7 +740,7 @@ Use structured assay fields when possible. Missing fields are allowed, but speci
740
  """
741
  )
742
  with gr.Column(scale=4):
743
- gr.Markdown(
744
  f"""
745
  <div class="metric-strip">
746
  <div class="metric-card"><span>Default model</span><strong>{MODEL_REPO_ID}</strong></div>
@@ -750,7 +750,7 @@ Use structured assay fields when possible. Missing fields are allowed, but speci
750
  """
751
  )
752
 
753
- gr.Markdown(
754
  """
755
  <div class="guide-grid">
756
  <div class="guide-card"><strong>1. Describe the assay</strong>Use normal lab language. Add UniProt, readout, format, and organism when known.</div>
@@ -763,7 +763,7 @@ Use structured assay fields when possible. Missing fields are allowed, but speci
763
  with gr.Tab("Rank Compounds"):
764
  with gr.Row(elem_classes="workspace"):
765
  with gr.Column(scale=6, elem_classes="pane"):
766
- gr.Markdown(
767
  """
768
  <div class="pane-header">
769
  <div>
@@ -780,7 +780,7 @@ Use structured assay fields when possible. Missing fields are allowed, but speci
780
  """
781
  )
782
  example_name = gr.Dropdown(choices=list(EXAMPLES.keys()), value="JAK2 cell assay", label="Live example")
783
- gr.Markdown("<div class='examples-note'>Examples run against the live model. They are not screenshots or mocked outputs.</div>")
784
  load_example_btn = gr.Button("Load live example", variant="secondary")
785
  assay_title = gr.Textbox(label="Assay title")
786
  description = gr.Textbox(label="Description", lines=6, placeholder="Describe the assay in practical lab language.")
@@ -793,7 +793,7 @@ Use structured assay fields when possible. Missing fields are allowed, but speci
793
  target_uniprot = gr.Textbox(label="Target UniProt IDs", placeholder="Q06187, P52333")
794
 
795
  with gr.Column(scale=5, elem_classes="pane"):
796
- gr.Markdown(
797
  """
798
  <div class="pane-header">
799
  <div>
@@ -811,12 +811,12 @@ Use structured assay fields when possible. Missing fields are allowed, but speci
811
  )
812
  upload_file = gr.File(label="Upload CSV / TXT / SMI", file_count="single", file_types=[".csv", ".txt", ".smi", ".smiles"])
813
  top_k = gr.Slider(label="Top-K rows to display", minimum=5, maximum=200, step=5, value=DEFAULT_TOP_K)
814
- gr.Markdown("<div class='section-note'>Tip: prefer parent or neutralized molecules, one SMILES per row, and avoid obvious salts or malformed fragments.</div>")
815
  with gr.Row(elem_classes="action-row"):
816
  run_btn = gr.Button("Run ranking", variant="primary")
817
  clear_btn = gr.ClearButton(value="Clear inputs", components=[assay_title, description, organism, readout, assay_format, assay_type, target_uniprot, smiles_text, upload_file])
818
 
819
- gr.Markdown(
820
  """
821
  <div class="summary-shell">
822
  <div class="pane-header">
@@ -852,42 +852,24 @@ Use structured assay fields when possible. Missing fields are allowed, but speci
852
  )
853
 
854
  with gr.Tab("How To Use This"):
855
- gr.Markdown(
856
  """
857
- ### Recommended workflow
858
-
859
- 1. Describe the assay in plain scientific language.
860
- 2. Add metadata if you know it: organism, readout, format, assay type, target UniProt.
861
- 3. Paste a candidate list or upload a CSV with a `smiles` column.
862
- 4. Run ranking and inspect the top band first.
863
-
864
- ### How to read the result table
865
-
866
- - **priority** is the first thing to read:
867
- - `Screen first`
868
- - `Worth a look`
869
- - `Middle pack`
870
- - `Low priority`
871
- - **relative_score_100** rescales the submitted list so the strongest candidate is near `100` and the weakest is near `0`.
872
- - **model_score** is the raw internal ranking score. It behaves like a logit-like utility value, not a probability.
873
- - If you need a normalized shortlist view, treat the model score as a list-relative ranking signal and rescale within your submitted list.
874
- - **mol_wt / logp / tpsa** are quick chemistry context columns so you can sanity-check what the model surfaced.
875
-
876
- ### Good input habits
877
-
878
- - Prefer parent, neutralized, chemically sensible SMILES.
879
- - Keep assay descriptions concrete.
880
- - If the assay is target-defined, add the UniProt ID.
881
- - If you upload a CSV, use one SMILES per row in a column named `smiles` or `canonical_smiles`.
882
-
883
- ### What this Space is not
884
-
885
- - not a generative chemistry tool
886
- - not a medicinal chemistry oracle
887
- - not a wet-lab substitute
888
-
889
- <div class="footer-note">
890
- This interface is tuned for clarity over breadth. If you need a larger ranking workflow, use the downloadable CSV as the handoff into your own screening or modeling pipeline.
891
  </div>
892
  """
893
  )
 
705
 
706
 
707
  with gr.Blocks(title="BioAssayAlign Compatibility Explorer", analytics_enabled=False, css=CSS, theme=THEME) as demo:
708
+ gr.HTML(
709
  """
710
  <div id="hero">
711
  <div class="hero-grid">
 
732
 
733
  with gr.Row():
734
  with gr.Column(scale=5):
735
+ gr.HTML(
736
  """
737
  <div class="panel-note">
738
  Use structured assay fields when possible. Missing fields are allowed, but species, readout, format, and target metadata usually improve ranking quality.
 
740
  """
741
  )
742
  with gr.Column(scale=4):
743
+ gr.HTML(
744
  f"""
745
  <div class="metric-strip">
746
  <div class="metric-card"><span>Default model</span><strong>{MODEL_REPO_ID}</strong></div>
 
750
  """
751
  )
752
 
753
+ gr.HTML(
754
  """
755
  <div class="guide-grid">
756
  <div class="guide-card"><strong>1. Describe the assay</strong>Use normal lab language. Add UniProt, readout, format, and organism when known.</div>
 
763
  with gr.Tab("Rank Compounds"):
764
  with gr.Row(elem_classes="workspace"):
765
  with gr.Column(scale=6, elem_classes="pane"):
766
+ gr.HTML(
767
  """
768
  <div class="pane-header">
769
  <div>
 
780
  """
781
  )
782
  example_name = gr.Dropdown(choices=list(EXAMPLES.keys()), value="JAK2 cell assay", label="Live example")
783
+ gr.HTML("<div class='examples-note'>Examples run against the live model. They are not screenshots or mocked outputs.</div>")
784
  load_example_btn = gr.Button("Load live example", variant="secondary")
785
  assay_title = gr.Textbox(label="Assay title")
786
  description = gr.Textbox(label="Description", lines=6, placeholder="Describe the assay in practical lab language.")
 
793
  target_uniprot = gr.Textbox(label="Target UniProt IDs", placeholder="Q06187, P52333")
794
 
795
  with gr.Column(scale=5, elem_classes="pane"):
796
+ gr.HTML(
797
  """
798
  <div class="pane-header">
799
  <div>
 
811
  )
812
  upload_file = gr.File(label="Upload CSV / TXT / SMI", file_count="single", file_types=[".csv", ".txt", ".smi", ".smiles"])
813
  top_k = gr.Slider(label="Top-K rows to display", minimum=5, maximum=200, step=5, value=DEFAULT_TOP_K)
814
+ gr.HTML("<div class='section-note'>Tip: prefer parent or neutralized molecules, one SMILES per row, and avoid obvious salts or malformed fragments.</div>")
815
  with gr.Row(elem_classes="action-row"):
816
  run_btn = gr.Button("Run ranking", variant="primary")
817
  clear_btn = gr.ClearButton(value="Clear inputs", components=[assay_title, description, organism, readout, assay_format, assay_type, target_uniprot, smiles_text, upload_file])
818
 
819
+ gr.HTML(
820
  """
821
  <div class="summary-shell">
822
  <div class="pane-header">
 
852
  )
853
 
854
  with gr.Tab("How To Use This"):
855
+ gr.HTML(
856
  """
857
+ <div class="summary-shell">
858
+ <div class="pane-header">
859
+ <div>
860
+ <div class="pane-kicker">Practical guidance</div>
861
+ <div class="pane-title">How to use this interface well</div>
862
+ </div>
863
+ </div>
864
+ <div class="explain-grid">
865
+ <div class="explain-card"><strong>Write the assay like a scientist</strong>Use concrete descriptions, not keywords alone. If the assay is target-defined, add UniProt.</div>
866
+ <div class="explain-card"><strong>Use clean candidate input</strong>Prefer parent or neutralized molecules. Upload a CSV with a <code>smiles</code> column if you have a larger list.</div>
867
+ <div class="explain-card"><strong>Interpret results as triage</strong>Use priority and relative score first. Treat the raw model score as an internal ranking value, not a probability.</div>
868
+ </div>
869
+ <div class="footer-note" style="margin-top: 1rem;">
870
+ This Space is tuned for shortlist ranking. It is not a generative chemistry tool, not a medicinal chemistry oracle, and not a wet-lab substitute.
871
+ If you need a larger workflow, export the CSV and pass the ranked list into your own screening pipeline.
872
+ </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
873
  </div>
874
  """
875
  )