From 877e3e9c3bed322ff446089fd308b9f09b09bad0 Mon Sep 17 00:00:00 2001 From: Andrey Prjibelski Date: Wed, 25 Oct 2023 19:16:51 +0200 Subject: [PATCH] handle weird corner case when sample prefix equals to the reference name --- src/dataset_processor.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/dataset_processor.py b/src/dataset_processor.py index e525d060..d5d9f594 100644 --- a/src/dataset_processor.py +++ b/src/dataset_processor.py @@ -333,6 +333,10 @@ def __init__(self, args): fai_file_name = self.args.reference + ".fai" if not os.path.exists(fai_file_name): symlink_name = os.path.join(args.output, ref_file_name) + if os.path.exists(symlink_name) and os.path.isdir(symlink_name): + # highly unlikely event of one of samples having exactly the same name as reference genome + ref_file_name = "reference_" + ref_file_name + symlink_name = os.path.join(args.output, ref_file_name) if os.path.exists(symlink_name) and not self.args.resume: os.remove(symlink_name) if not os.path.exists(symlink_name):