Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move checking age of runfolder earlier to fix bug #553

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions wscleaner/wscleaner.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,11 @@ def get_runfolders_to_process(self) -> list:
)
rf_obj = RunfolderObject(folder_name, RunfolderCleanupConfig.TIMESTAMP)
rf_age = rf_obj.age()
if os.path.exists(os.path.join(self.samplesheets_dir, f"{folder_name}_SampleSheet.csv")):
rf_samples_obj = RunfolderSamples(rf_obj, script_logger)
if rf_samples_obj:
if os.path.exists(rf_obj.rtacompletefile_path):
if (rf_age >= self.min_age):
if (rf_age >= self.min_age):
if os.path.exists(os.path.join(self.samplesheets_dir, f"{folder_name}_SampleSheet.csv")):
rf_samples_obj = RunfolderSamples(rf_obj, script_logger)
if rf_samples_obj:
if os.path.exists(rf_obj.rtacompletefile_path):
# Catch TSO500 runfolders here (do not contain fastqs)
if rf_samples_obj.pipeline == "dev":
script_logger.info(
Expand Down Expand Up @@ -183,16 +183,16 @@ def get_runfolders_to_process(self) -> list:
)
else:
script_logger.info(
f"{rf_obj.runfolder_name} is < {self.min_age} days old"
f"{rf_obj.runfolder_name} is not a runfolder, or sequencing has not yet finished"
)
else:
script_logger.info(
f"{rf_obj.runfolder_name} is not a runfolder, or sequencing has not yet finished"
)
else:
script_logger.info(
f"Corresponding SampleSheet for {rf_obj.runfolder_name} could not be located. This is required for analysing for deletion"
)
else:
script_logger.info(
f"Corresponding SampleSheet for {rf_obj.runfolder_name} could not be located. This is required for analysing for deletion"
)
f"{rf_obj.runfolder_name} is < {self.min_age} days old"
)
to_assess = [rf_obj.runfolder_name for runfolder_object in runfolder_objects]
all_folders = [folder.split("/")[-1].strip() for folder in folders]
to_skip = [folder for folder in all_folders if folder not in to_assess]
Expand Down
Loading