maom commited on
Commit
f67eeb9
·
verified ·
1 Parent(s): 8f33cca

show_top_hits for gene

Browse files
Files changed (1) hide show
  1. app.py +11 -27
app.py CHANGED
@@ -1,37 +1,21 @@
 
1
  import streamlit as st
2
  import numpy as np
3
  import pandas as pd
4
  import altair as alt
5
 
6
 
7
- gene_id_1 = st.text_input(
8
- label = "Gene 1",
9
- value = "CNAG0000001",
10
- max_chars = 20,
11
- help = "CNAG Gene ID e.g. CNAG0000001")
12
-
13
- gene_id_2 = st.text_input(
14
- label = "Gene 2",
15
- value = "CNAG0000002",
16
- max_chars = 20,
17
- help = "CNAG Gene ID e.g. CNAG0000002")
18
 
 
 
 
 
 
19
 
20
- chart_data = pd.DataFrame(
21
- np.random.randn(20, 3),
22
- columns=["a", "b", "c"])
23
 
24
- chart = (
25
- alt.Chart(chart_data)
26
- .mark_circle()
27
- .encode(
28
- x="a",
29
- y="b",
30
- size="c",
31
- color="c",
32
- tooltip=["a", "b", "c"])
33
- )
34
 
35
- st.altair_chart(
36
- chart,
37
- use_container_width=True)
 
1
+ import datasets
2
  import streamlit as st
3
  import numpy as np
4
  import pandas as pd
5
  import altair as alt
6
 
7
 
8
+ top_coexp_hits = datasets.load_dataset(
9
+ path = "maomlab/CryptoCEN",
10
+ data_files = "top_coex_hits.tsv").to_pandas()
 
 
 
 
 
 
 
 
11
 
12
+ gene_id = st.text_input(
13
+ label = "Gene 1",
14
+ value = "CNAG_04365-t26_1",
15
+ max_chars = 16,
16
+ help = "CNAG Gene ID e.g. CNAG_04365-t26_1")
17
 
18
+ top_coexp_hits = top_coexp_hits[top_coexp_hits.cnag_id_1 == gene_id]
 
 
19
 
 
 
 
 
 
 
 
 
 
 
20
 
21
+ st.table(top_coexp_hits)