Grant commited on
Commit
1b8024a
·
1 Parent(s): f9d6e6b

zip data together

Browse files
Files changed (2) hide show
  1. .gitattributes +2 -0
  2. app.py +14 -14
.gitattributes CHANGED
@@ -35,3 +35,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
  ALL_hum_isoforms_ESM1b_dels.zip filter=lfs diff=lfs merge=lfs -text
37
  del_sub_data.csv.gz filter=lfs diff=lfs merge=lfs -text
 
 
 
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
  ALL_hum_isoforms_ESM1b_dels.zip filter=lfs diff=lfs merge=lfs -text
37
  del_sub_data.csv.gz filter=lfs diff=lfs merge=lfs -text
38
+ rand_samp_gw_del_sub.csv.gz filter=lfs diff=lfs merge=lfs -text
39
+ ALL_hum_isoforms_ESM1b_del_sub.zip filter=lfs diff=lfs merge=lfs -text
app.py CHANGED
@@ -4,16 +4,18 @@ import numpy as np
4
  import time
5
  import plotly.graph_objects as go
6
  from scipy.ndimage import gaussian_filter1d
 
7
 
8
  np.random.seed(2024)
9
 
10
  uids = pd.read_csv("uniprot_ids_isoforms.tsv.gz", names=["selection"], header=None, sep="\t")
11
- del_sub_merge = pd.read_csv("del_sub_data.csv.gz")
 
12
 
13
  def plot_interactive_scatter(uid: str):
14
 
15
- user_data = del_sub_merge[del_sub_merge.prot == uid]
16
-
17
  # Create scatter plot for user-specified data
18
  user_trace = go.Scatter(
19
  x=-np.log10(user_data.aPLLR),
@@ -52,11 +54,9 @@ def plot_interactive_line(uid_data: pd.DataFrame, uid: str, score: str, mutation
52
 
53
  selection = st.selectbox("", uids.selection, index=26592)
54
  selection_uid = selection.split(",")[0]
55
-
56
- show_line_plots = st.checkbox("Show Line Plots")
57
-
58
  # Base dataset
59
- base_data = del_sub_merge.sample(frac=0.001)
60
 
61
  # Create base scatter plot
62
  base_trace = go.Scatter(
@@ -72,15 +72,8 @@ base_trace = go.Scatter(
72
  ut, ud = plot_interactive_scatter(selection_uid)
73
 
74
  lt_apllr = plot_interactive_line(ud, selection_uid, "aPLLR", "Deletion")
75
- # st.plotly_chart(lt_apllr)
76
 
77
  lt_llr = plot_interactive_line(ud, selection_uid, "avg_LLR", "Substitution")
78
- # st.plotly_chart(lt_llr)
79
-
80
-
81
- if show_line_plots:
82
- st.plotly_chart(lt_apllr)
83
- st.plotly_chart(lt_llr)
84
 
85
  # Combine traces
86
  fig = go.Figure([base_trace, ut])
@@ -149,6 +142,13 @@ st.download_button(
149
  mime='text/csv'
150
  )
151
 
 
 
 
 
 
 
 
152
  st.markdown("""
153
  **README**:
154
  - Deletion scores are *visualized* on the -log10 scale.
 
4
  import time
5
  import plotly.graph_objects as go
6
  from scipy.ndimage import gaussian_filter1d
7
+ from zipfile import ZipFile
8
 
9
  np.random.seed(2024)
10
 
11
  uids = pd.read_csv("uniprot_ids_isoforms.tsv.gz", names=["selection"], header=None, sep="\t")
12
+ # del_sub_merge = pd.read_csv("del_sub_data.csv.gz")
13
+ zf = ZipFile("ALL_hum_isoforms_ESM1b_del_sub.zip")
14
 
15
  def plot_interactive_scatter(uid: str):
16
 
17
+ user_data = pd.read_csv(zf.open(f"{uid}.csv"))
18
+
19
  # Create scatter plot for user-specified data
20
  user_trace = go.Scatter(
21
  x=-np.log10(user_data.aPLLR),
 
54
 
55
  selection = st.selectbox("", uids.selection, index=26592)
56
  selection_uid = selection.split(",")[0]
57
+
 
 
58
  # Base dataset
59
+ base_data = pd.read_csv("rand_samp_gw_del_sub.csv.gz")
60
 
61
  # Create base scatter plot
62
  base_trace = go.Scatter(
 
72
  ut, ud = plot_interactive_scatter(selection_uid)
73
 
74
  lt_apllr = plot_interactive_line(ud, selection_uid, "aPLLR", "Deletion")
 
75
 
76
  lt_llr = plot_interactive_line(ud, selection_uid, "avg_LLR", "Substitution")
 
 
 
 
 
 
77
 
78
  # Combine traces
79
  fig = go.Figure([base_trace, ut])
 
142
  mime='text/csv'
143
  )
144
 
145
+ show_line_plots = st.checkbox("Show Sub and Del Effects Alone")
146
+
147
+ if show_line_plots:
148
+ st.plotly_chart(lt_apllr)
149
+ st.plotly_chart(lt_llr)
150
+
151
+
152
  st.markdown("""
153
  **README**:
154
  - Deletion scores are *visualized* on the -log10 scale.