Eitan177 commited on
Commit
f8b568d
·
1 Parent(s): a4f93db

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -9
app.py CHANGED
@@ -104,8 +104,8 @@ def dl(valforkey):
104
  hh=pd.read_table('output/SBS96/Samples.txt')
105
  hh['nums']=hh.iloc[:,1]
106
  hh['mutation_simple']=hh['MutationType'].apply(lambda x: re.sub('].$','',re.sub('^.\[','',x)))
107
- summary_table_sbs_all=hh.groupby('mutation_simple').apply(lambda x: x.sum())[['mutation_simple','nums']]
108
- summary_table_sbs_all.to_csv('sbs_summary.txt',sep='\t',header=False,index=False)
109
  with open("sbs_summary.txt","rb") as txt_file:
110
  summary_table_sbs_all_bytes = txt_file.read()
111
  txt_file.close()
@@ -122,8 +122,8 @@ def dl(valforkey):
122
  hh2=pd.read_table('output/ID83/Samples.txt')
123
  hh2['nums']=hh2.iloc[:,1]
124
  hh2['mutation_simple']=hh2['MutationType'].apply(lambda x: re.sub('].$','',re.sub('^.\[','',x)))
125
- summary_table_id_all=hh2.groupby('mutation_simple').apply(lambda x: x.sum())[['mutation_simple','nums']]
126
- summary_table_id_all.to_csv('id_summary.txt',sep='\t',header=False,index=False)
127
  with open("id_summary.txt","rb") as txt_file:
128
  summary_table_id_all_bytes = txt_file.read()
129
  txt_file.close()
@@ -139,8 +139,8 @@ def dl(valforkey):
139
  hh3=pd.read_table('output/DBS78/Samples.txt')
140
  hh3['nums']=hh3.iloc[:,1]
141
  hh3['mutation_simple']=hh3['MutationType'].apply(lambda x: re.sub('].$','',re.sub('^.\[','',x)))
142
- summary_table_dbs_all=hh3.groupby('mutation_simple').apply(lambda x: x.sum())[['mutation_simple','nums']]
143
- summary_table_dbs_all.to_csv('dbs_summary.txt',sep='\t',header=False,index=False)
144
  with open("dbs_summary.txt","rb") as txt_file:
145
  summary_table_dbs_all_bytes = txt_file.read()
146
  txt_file.close()
@@ -246,14 +246,13 @@ if file_to_lookat !=[] and sub:
246
  tovcf.to_csv(nameuse,sep='\t',header=False, index=False)
247
  st.write('original file read as:')
248
  st.write(table_of_penn_file)
249
- #st.write(tovcf)
 
250
  #st.write(nameuse)
251
  with open(nameuse,"rb") as txt_file:
252
  bytes_data=txt_file.read()
253
  txt_file.close()
254
  with open(os.path.join("input",nameuse),"wb") as f:
255
- st.write('file after liftover:')
256
- st.write(os.path.join("input",nameuse))
257
  f.write(bytes_data)
258
  f.close()
259
  seev=glob.glob('input/*')
 
104
  hh=pd.read_table('output/SBS96/Samples.txt')
105
  hh['nums']=hh.iloc[:,1]
106
  hh['mutation_simple']=hh['MutationType'].apply(lambda x: re.sub('].$','',re.sub('^.\[','',x)))
107
+ summary_table_sbs_all=hh.groupby('mutation_simple').apply(lambda x: x.sum())[['nums']]
108
+ summary_table_sbs_all.to_csv('sbs_summary.txt',sep='\t',header=False,index=True)
109
  with open("sbs_summary.txt","rb") as txt_file:
110
  summary_table_sbs_all_bytes = txt_file.read()
111
  txt_file.close()
 
122
  hh2=pd.read_table('output/ID83/Samples.txt')
123
  hh2['nums']=hh2.iloc[:,1]
124
  hh2['mutation_simple']=hh2['MutationType'].apply(lambda x: re.sub('].$','',re.sub('^.\[','',x)))
125
+ summary_table_id_all=hh2.groupby('mutation_simple').apply(lambda x: x.sum())[['nums']]
126
+ summary_table_id_all.to_csv('id_summary.txt',sep='\t',header=False,index=True)
127
  with open("id_summary.txt","rb") as txt_file:
128
  summary_table_id_all_bytes = txt_file.read()
129
  txt_file.close()
 
139
  hh3=pd.read_table('output/DBS78/Samples.txt')
140
  hh3['nums']=hh3.iloc[:,1]
141
  hh3['mutation_simple']=hh3['MutationType'].apply(lambda x: re.sub('].$','',re.sub('^.\[','',x)))
142
+ summary_table_dbs_all=hh3.groupby('mutation_simple').apply(lambda x: x.sum())[['nums']]
143
+ summary_table_dbs_all.to_csv('dbs_summary.txt',sep='\t',header=False,index=True)
144
  with open("dbs_summary.txt","rb") as txt_file:
145
  summary_table_dbs_all_bytes = txt_file.read()
146
  txt_file.close()
 
246
  tovcf.to_csv(nameuse,sep='\t',header=False, index=False)
247
  st.write('original file read as:')
248
  st.write(table_of_penn_file)
249
+ st.write('file after liftover:')
250
+ st.write(tovcf)
251
  #st.write(nameuse)
252
  with open(nameuse,"rb") as txt_file:
253
  bytes_data=txt_file.read()
254
  txt_file.close()
255
  with open(os.path.join("input",nameuse),"wb") as f:
 
 
256
  f.write(bytes_data)
257
  f.close()
258
  seev=glob.glob('input/*')