Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -203,12 +203,28 @@ if file_to_lookat !=[] and sub:
|
|
203 |
|
204 |
if not os.path.exists('input/input'):
|
205 |
os.mkdir('input/input')
|
206 |
-
remove_old_vcf()
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
212 |
#for i in seev:
|
213 |
# st.write(i)
|
214 |
#vcfuse=glob.glob('file_to_lookat[0].name')[0]
|
|
|
203 |
|
204 |
if not os.path.exists('input/input'):
|
205 |
os.mkdir('input/input')
|
206 |
+
remove_old_vcf()
|
207 |
+
if re.findall('vcf$',file_to_lookat[j].name) != []:
|
208 |
+
bytes_data=file_to_lookat[j].read()
|
209 |
+
with open(os.path.join("input",file_to_lookat[j].name),"wb") as f:
|
210 |
+
f.write(bytes_data)
|
211 |
+
f.close()
|
212 |
+
seev=glob.glob('input/*')
|
213 |
+
else:
|
214 |
+
table_of_penn_file=pd.read_excel(file_to_lookat[j])
|
215 |
+
tovcf=pd.DataFrame()
|
216 |
+
tovcf['Chrom']=table_of_penn_file['Chrom']
|
217 |
+
tovcf['Pos']=table_of_penn_file['Pos']
|
218 |
+
tovcf['db']='.'
|
219 |
+
tovcf['ref']=table_of_penn_file['Ref']
|
220 |
+
tovcf['alt']=table_of_penn_file['Alt']
|
221 |
+
nameuse=re.sub('xlsx$','vcf',file_to_lookat[j].name)
|
222 |
+
tovcf.to_csv(nameuse,sep='\t',header=False, index=False)
|
223 |
+
bytes_data=nameuse.read()
|
224 |
+
with open(os.path.join("input",nameuse),"wb") as f:
|
225 |
+
f.write(bytes_data)
|
226 |
+
f.close()
|
227 |
+
seev=glob.glob('input/*')
|
228 |
#for i in seev:
|
229 |
# st.write(i)
|
230 |
#vcfuse=glob.glob('file_to_lookat[0].name')[0]
|