Skip to content

Commit

Permalink
adding testing detection function fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wilkb777 committed Jul 9, 2024
1 parent 2a01bad commit c203822
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions workflow/rules/common.smk
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,23 @@ def is_testing_mode():
"checks if testing dataset is used as input for the pipeline"

query = ".test"
isTesting = False
for sample in SAMPLES_CONFIG.values():
for fpath in sample.values():
if query in PurePath(fpath).parts:
logger.info(f"// WARNING: '{query}' present in at least one of the filepaths supplied via --sample_config. So testing mode is used.")
return True
for fvalue in sample.values():
if isinstance(fvalue, str) and query in PurePath(fvalue).parts:
isTesting = True
else:
for fpath in fvalue:
if query in PurePath(fpath).parts:
isTesting = True

if isTesting:
logger.info(f"// WARNING: '{query}' present in at least one of the filepaths supplied via --sample_config. So testing mode is used.")
return True

return None



def get_priorQC_filepaths(sample, samples_dict):
"""
Returns filepaths relevant to priorQC
Expand Down

0 comments on commit c203822

Please sign in to comment.