Eitan177 commited on
Commit
d54796c
·
1 Parent(s): 9c36843

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -15
app.py CHANGED
@@ -28,7 +28,27 @@ def show_pdf(file_path):
28
  st.markdown(pdf_display, unsafe_allow_html=True)
29
 
30
 
31
- st.write(glob.glob(os.path.join(os.path.dirname(SigProfilerMatrixGenerator.__file__),'references/*txt')))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
 
33
  if glob.glob(os.path.join(os.path.dirname(SigProfilerMatrixGenerator.__file__),'references/*txt')) == []:
34
  if st.button('get reference genome'):
@@ -66,20 +86,7 @@ if file_to_lookat !=[]:
66
  sig.sigProfilerExtractor("vcf", "output", "input", minimum_signatures=1, maximum_signatures=3)
67
 
68
  #show_pdf('output/SBS96/Suggested_Solution/COSMIC_SBS96_Decomposed_Solution/SBS96_Decomposition_Plots.pdf')
69
- with open("output/SBS96/Suggested_Solution/COSMIC_SBS96_Decomposed_Solution/SBS96_Decomposition_Plots.pdf", "rb") as pdf_file:
70
- PDFbyte1 = pdf_file.read()
71
- st.download_button(label="Download image with single base substitution profiles", key='1',
72
- data=PDFbyte1,
73
- file_name="SBS.pdf",
74
- mime='application/octet-stream')
75
-
76
-
77
- with open("output/ID83/Suggested_Solution/COSMIC_ID83_Decomposed_Solution/ID83_Decomposition_Plots.pdf", "rb") as pdf_file:
78
- PDFbyte2 = pdf_file.read()
79
- st.download_button(label="Download image with indel profiles", key='2',
80
- data=PDFbyte2,
81
- file_name="idel.pdf",
82
- mime='application/octet-stream')
83
 
84
 
85
  components.iframe("https://cancer.sanger.ac.uk/signatures/sbs/", height=3000,width=800)
 
28
  st.markdown(pdf_display, unsafe_allow_html=True)
29
 
30
 
31
+ @st.experimental_memo
32
+ def dl(file_vcf):
33
+ with open("output/SBS96/Suggested_Solution/COSMIC_SBS96_Decomposed_Solution/SBS96_Decomposition_Plots.pdf", "rb") as pdf_file:
34
+ PDFbyte1 = pdf_file.read()
35
+ st.download_button(label="Download image with single base substitution profiles", key='1',
36
+ data=PDFbyte1,
37
+ file_name="SBS.pdf",
38
+ mime='application/octet-stream')
39
+
40
+
41
+ with open("output/ID83/Suggested_Solution/COSMIC_ID83_Decomposed_Solution/ID83_Decomposition_Plots.pdf", "rb") as pdf_file:
42
+ PDFbyte2 = pdf_file.read()
43
+ st.download_button(label="Download image with indel profiles", key='2',
44
+ data=PDFbyte2,
45
+ file_name="idel.pdf",
46
+ mime='application/octet-stream')
47
+ return file_vcf
48
+
49
+
50
+
51
+ #st.write(glob.glob(os.path.join(os.path.dirname(SigProfilerMatrixGenerator.__file__),'references/*txt')))
52
 
53
  if glob.glob(os.path.join(os.path.dirname(SigProfilerMatrixGenerator.__file__),'references/*txt')) == []:
54
  if st.button('get reference genome'):
 
86
  sig.sigProfilerExtractor("vcf", "output", "input", minimum_signatures=1, maximum_signatures=3)
87
 
88
  #show_pdf('output/SBS96/Suggested_Solution/COSMIC_SBS96_Decomposed_Solution/SBS96_Decomposition_Plots.pdf')
89
+ dl(file_to_lookat)
 
 
 
 
 
 
 
 
 
 
 
 
 
90
 
91
 
92
  components.iframe("https://cancer.sanger.ac.uk/signatures/sbs/", height=3000,width=800)