Initial file upload
Browse files- .gitattributes +2 -0
- README.md +5 -6
- app.py +31 -0
- data/protein_clusters.xlsx +3 -0
- data/protein_dendrogram.png +3 -0
- requirements.txt +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
data/protein_clusters.xlsx filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
data/protein_dendrogram.png filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -1,14 +1,13 @@
|
|
| 1 |
---
|
| 2 |
-
title: Proteins From Bert Point
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: gradio
|
| 7 |
-
sdk_version:
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: bigscience-openrail-m
|
| 11 |
-
short_description: Protein clustering using unikei/bert-base-proteins
|
| 12 |
---
|
| 13 |
|
| 14 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Proteins From Bert Point Of View
|
| 3 |
+
emoji: π
|
| 4 |
+
colorFrom: red
|
| 5 |
+
colorTo: indigo
|
| 6 |
sdk: gradio
|
| 7 |
+
sdk_version: 4.31.1
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: bigscience-openrail-m
|
|
|
|
| 11 |
---
|
| 12 |
|
| 13 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
app.py
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import pandas as pd
|
| 3 |
+
|
| 4 |
+
image_path = "data/protein_dendrogram.png"
|
| 5 |
+
|
| 6 |
+
protein_clusters = pd.read_excel('data/protein_clusters.xlsx')
|
| 7 |
+
max_length = 500
|
| 8 |
+
protein_clusters['proteins'] = protein_clusters['proteins'].apply(lambda x: x[:max_length] + ('...' if len(x) > max_length else ''))
|
| 9 |
+
protein_clusters['protein groups'] = protein_clusters['protein groups'].apply(lambda x: x[:max_length] + ('...' if len(x) > max_length else ''))
|
| 10 |
+
protein_clusters['protein features'] = protein_clusters['protein features'].apply(lambda x: x[:max_length] + ('...' if len(x) > max_length else ''))
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
with gr.Blocks() as demo:
|
| 14 |
+
gr.Markdown("# Protein similarity from BERT point of view")
|
| 15 |
+
gr.Markdown("This app displays protein similarity captured in the model [unikei/bert-base-proteins]("
|
| 16 |
+
"https://huggingface.co/unikei/bert-base-proteins).")
|
| 17 |
+
|
| 18 |
+
gr.Image(image_path,
|
| 19 |
+
label="Right click to zoom in new tab.",
|
| 20 |
+
container=True
|
| 21 |
+
)
|
| 22 |
+
|
| 23 |
+
gr.Markdown("\n")
|
| 24 |
+
gr.Markdown("Click on the [link](https://huggingface.co/spaces/unikei/proteins-from-bert-point-of-view/blob/main/data/protein_clusters.xlsx) to download the spreadsheet.")
|
| 25 |
+
gr.DataFrame(protein_clusters,
|
| 26 |
+
interactive=False,
|
| 27 |
+
wrap=True,
|
| 28 |
+
column_widths=[5, 5, 30, 30, 30])
|
| 29 |
+
#
|
| 30 |
+
|
| 31 |
+
demo.launch()
|
data/protein_clusters.xlsx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:880a52865cea129e1b6099db85f5fd5a6fc6b2f0f047991f2900744b20473ec8
|
| 3 |
+
size 211288
|
data/protein_dendrogram.png
ADDED
|
Git LFS Details
|
requirements.txt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
gradio==4.31.1
|
| 2 |
+
pandas==2.2.2
|
| 3 |
+
openpyxl==3.1.2
|