Spaces:
Sleeping
Sleeping
Filter threshold 90%, wrap annotation description text
Browse files- Lower percmatch threshold from 95% to 90%
- Add text wrapping on annotation table (wrap=True + CSS max-width)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
app.py
CHANGED
|
@@ -675,7 +675,7 @@ def generate_and_select(
|
|
| 675 |
|
| 676 |
def _annotate(
|
| 677 |
dna: str,
|
| 678 |
-
min_percmatch: float =
|
| 679 |
) -> tuple[str | None, pd.DataFrame | None, str]:
|
| 680 |
"""Run pLannotate on a DNA sequence, filtering to high-confidence hits."""
|
| 681 |
if not dna or len(dna) < 100:
|
|
@@ -784,7 +784,7 @@ def _use_quick_example(choice: str) -> tuple[str, str]:
|
|
| 784 |
# Gradio UI
|
| 785 |
# ---------------------------------------------------------------------------
|
| 786 |
|
| 787 |
-
|
| 788 |
.preset-dropdown input {
|
| 789 |
white-space: normal !important;
|
| 790 |
overflow: visible !important;
|
|
@@ -799,9 +799,14 @@ _DROPDOWN_CSS = """
|
|
| 799 |
line-height: 1.4;
|
| 800 |
padding: 8px 12px !important;
|
| 801 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 802 |
"""
|
| 803 |
|
| 804 |
-
with gr.Blocks(title="PlasmidSpace", css=
|
| 805 |
gr.Markdown(
|
| 806 |
"# \U0001F9EC PlasmidSpace\n"
|
| 807 |
"*Design synthetic plasmids from natural language using "
|
|
@@ -865,7 +870,11 @@ with gr.Blocks(title="PlasmidSpace", css=_DROPDOWN_CSS) as demo:
|
|
| 865 |
with gr.Tab("Plasmid Map"):
|
| 866 |
plasmid_html = gr.HTML(label="Plasmid Map")
|
| 867 |
with gr.Tab("Annotations"):
|
| 868 |
-
ann_table = gr.Dataframe(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 869 |
with gr.Tab("DNA Sequence"):
|
| 870 |
dna_output = gr.Textbox(
|
| 871 |
label="Generated DNA",
|
|
|
|
| 675 |
|
| 676 |
def _annotate(
|
| 677 |
dna: str,
|
| 678 |
+
min_percmatch: float = 90.0,
|
| 679 |
) -> tuple[str | None, pd.DataFrame | None, str]:
|
| 680 |
"""Run pLannotate on a DNA sequence, filtering to high-confidence hits."""
|
| 681 |
if not dna or len(dna) < 100:
|
|
|
|
| 784 |
# Gradio UI
|
| 785 |
# ---------------------------------------------------------------------------
|
| 786 |
|
| 787 |
+
_CUSTOM_CSS = """
|
| 788 |
.preset-dropdown input {
|
| 789 |
white-space: normal !important;
|
| 790 |
overflow: visible !important;
|
|
|
|
| 799 |
line-height: 1.4;
|
| 800 |
padding: 8px 12px !important;
|
| 801 |
}
|
| 802 |
+
.ann-table td {
|
| 803 |
+
white-space: normal !important;
|
| 804 |
+
word-wrap: break-word !important;
|
| 805 |
+
max-width: 300px;
|
| 806 |
+
}
|
| 807 |
"""
|
| 808 |
|
| 809 |
+
with gr.Blocks(title="PlasmidSpace", css=_CUSTOM_CSS) as demo:
|
| 810 |
gr.Markdown(
|
| 811 |
"# \U0001F9EC PlasmidSpace\n"
|
| 812 |
"*Design synthetic plasmids from natural language using "
|
|
|
|
| 870 |
with gr.Tab("Plasmid Map"):
|
| 871 |
plasmid_html = gr.HTML(label="Plasmid Map")
|
| 872 |
with gr.Tab("Annotations"):
|
| 873 |
+
ann_table = gr.Dataframe(
|
| 874 |
+
label="Annotation Table",
|
| 875 |
+
wrap=True,
|
| 876 |
+
elem_classes=["ann-table"],
|
| 877 |
+
)
|
| 878 |
with gr.Tab("DNA Sequence"):
|
| 879 |
dna_output = gr.Textbox(
|
| 880 |
label="Generated DNA",
|