unikei commited on
Commit
97b5303
Β·
verified Β·
1 Parent(s): 9eed585

Initial file upload

Browse files
.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 Pf View
3
- emoji: πŸ‘
4
- colorFrom: indigo
5
- colorTo: green
6
  sdk: gradio
7
- sdk_version: 5.49.1
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

  • SHA256: 1442017dc00760b980ae3db4d826b47749ad78118ecb67e48d1793c2c0bacf6b
  • Pointer size: 132 Bytes
  • Size of remote file: 1.47 MB
requirements.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ gradio==4.31.1
2
+ pandas==2.2.2
3
+ openpyxl==3.1.2