jfataphd commited on
Commit
f658f80
1 Parent(s): 8715634

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -5
app.py CHANGED
@@ -55,7 +55,7 @@ if query:
55
  print("Similarity to " + str(query))
56
  pd.set_option('display.max_rows', None)
57
  print(table.head(50))
58
- table.head(10).to_csv("clotting_sim1.csv", index=True)
59
  # short_table = table.head(50)
60
  # print(table)
61
  st.subheader(f"Similar Words to {query}")
@@ -79,6 +79,13 @@ if query:
79
  st.pyplot(fig)
80
  plt.clf()
81
 
 
 
 
 
 
 
 
82
  # st.write(short_table)
83
  #
84
 
@@ -92,13 +99,13 @@ if query:
92
  df1["Human Gene"] = df1["Human Gene"].str.upper()
93
  print(df1.head(50))
94
  print()
95
- df1.head(50).to_csv("clotting_sim2.csv", index=True, header=False)
96
  # time.sleep(2)
97
  st.subheader(f"Similar Genes to {query}")
98
 
99
- df1 = df1.head(10)
100
- df1.index = 1/df1.index
101
- sizes = df1.index.tolist()
102
 
103
  cmap2 = plt.cm.Blues(np.linspace(0.05, .5, len(sizes)))
104
  color2 = [cmap2[i] for i in range(len(sizes))]
@@ -116,6 +123,13 @@ if query:
116
  # # display the treemap in Streamlit
117
  st.pyplot(fig2)
118
 
 
 
 
 
 
 
 
119
 
120
 
121
 
 
55
  print("Similarity to " + str(query))
56
  pd.set_option('display.max_rows', None)
57
  print(table.head(50))
58
+ # table.head(10).to_csv("clotting_sim1.csv", index=True)
59
  # short_table = table.head(50)
60
  # print(table)
61
  st.subheader(f"Similar Words to {query}")
 
79
  st.pyplot(fig)
80
  plt.clf()
81
 
82
+ csv = table.head(100)
83
+ st.download_button(
84
+ label="download top 100 words (csv)",
85
+ data=csv,
86
+ file_name='clotting_words.csv',
87
+ mime='text/csv')
88
+
89
  # st.write(short_table)
90
  #
91
 
 
99
  df1["Human Gene"] = df1["Human Gene"].str.upper()
100
  print(df1.head(50))
101
  print()
102
+ # df1.head(50).to_csv("clotting_sim2.csv", index=True, header=False)
103
  # time.sleep(2)
104
  st.subheader(f"Similar Genes to {query}")
105
 
106
+ df10 = df1.head(10)
107
+ df10.index = 1/df10.index
108
+ sizes = df10.index.tolist()
109
 
110
  cmap2 = plt.cm.Blues(np.linspace(0.05, .5, len(sizes)))
111
  color2 = [cmap2[i] for i in range(len(sizes))]
 
123
  # # display the treemap in Streamlit
124
  st.pyplot(fig2)
125
 
126
+ csv = df1.head(100)
127
+ st.download_button(
128
+ label="download top 100 genes (csv)",
129
+ data=csv,
130
+ file_name='clotting_genes.csv',
131
+ mime='text/csv')
132
+
133
 
134
 
135