Skip to content

Commit

Permalink
add timestamps to the output files to avoid cache error
Browse files Browse the repository at this point in the history
  • Loading branch information
JeeH-K committed May 7, 2024
1 parent d27d920 commit e95cf45
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions src/Workflow.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import streamlit as st
import time
from .workflow.WorkflowManager import WorkflowManager
from pages.FileUploadTagger import handleInputFiles
from pages.FileUploadTagger import parseUploadedFiles
from pages.FileUploadTagger import initializeWorkspace, showUploadedFilesTable
from zipfile import ZipFile, ZIP_DEFLATED

from os.path import join, splitext, basename, exists, dirname
from os import makedirs
Expand Down Expand Up @@ -152,12 +152,13 @@ def pp(self) -> None:
uploaded_files = []
for in_mzML in in_mzMLs:
current_base = splitext(basename(in_mzML))[0]
current_time = time.strftime("%Y%m%d-%H%M%S")

#out_db = join(base_path, 'db-fasta', f'{current_base}_db.fasta')
out_anno = join(base_path, 'anno-mzMLs', f'{current_base}_annotated.mzML')
out_deconv = join(base_path, 'deconv-mzMLs', f'{current_base}_deconv.mzML')
out_tag = join(base_path, 'tags-tsv', f'{current_base}_tagged.tsv')
out_protein = join(base_path, 'proteins-tsv', f'{current_base}_protein.tsv')
out_anno = join(base_path, 'anno-mzMLs', f'{current_base}_{current_time}_annotated.mzML')
out_deconv = join(base_path, 'deconv-mzMLs', f'{current_base}_{current_time}_deconv.mzML')
out_tag = join(base_path, 'tags-tsv', f'{current_base}_{current_time}_tagged.tsv')
out_protein = join(base_path, 'proteins-tsv', f'{current_base}_{current_time}_protein.tsv')

if not exists(out_tag):
continue
Expand Down Expand Up @@ -218,13 +219,13 @@ def execution(self) -> None:
uploaded_files = []
for in_mzML in in_mzMLs:
current_base = splitext(basename(in_mzML))[0]
current_time = time.strftime("%Y%m%d-%H%M%S")


out_db = join(base_path, 'db-fasta', f'{current_base}_db.fasta')
out_anno = join(base_path, 'anno-mzMLs', f'{current_base}_annotated.mzML')
out_deconv = join(base_path, 'deconv-mzMLs', f'{current_base}_deconv.mzML')
out_tag = join(base_path, 'tags-tsv', f'{current_base}_tagged.tsv')
out_protein = join(base_path, 'proteins-tsv', f'{current_base}_protein.tsv')
out_db = join(base_path, 'db-fasta', f'{current_base}_{current_time}_db.fasta')
out_anno = join(base_path, 'anno-mzMLs', f'{current_base}_{current_time}_annotated.mzML')
out_deconv = join(base_path, 'deconv-mzMLs', f'{current_base}_{current_time}_deconv.mzML')
out_tag = join(base_path, 'tags-tsv', f'{current_base}_{current_time}_tagged.tsv')
out_protein = join(base_path, 'proteins-tsv', f'{current_base}_{current_time}_protein.tsv')
#decoy_db = join(temp_path, f'{current_base}_db.fasta')

# self.executor.run_topp(
Expand Down Expand Up @@ -347,7 +348,8 @@ def execution(self) -> None:
for in_mzML in in_mzMLs:
# Get folder name
file_name = splitext(basename(in_mzML))[0]
folder_path = join(base_path, 'FLASHDeconvOutput', file_name)
current_time = time.strftime("%Y%m%d-%H%M%S")
folder_path = join(base_path, 'FLASHDeconvOutput', '%s_%s'%(file_name, current_time))

if exists(folder_path):
rmtree(folder_path)
Expand Down

0 comments on commit e95cf45

Please sign in to comment.