From dbc85c026817f7125c0ff389eeabc21bb636c7eb Mon Sep 17 00:00:00 2001 From: Niklaus Johner Date: Wed, 2 Oct 2024 12:54:56 +0200 Subject: [PATCH 1/2] Add support for single-end samples to run_phanta.py script. --- run_phanta.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/run_phanta.py b/run_phanta.py index d4ed392..df6ba7e 100644 --- a/run_phanta.py +++ b/run_phanta.py @@ -70,9 +70,12 @@ def make_mapping(input_dir, output_file, for_tag, rev_tag): found = 0 with open(output_file, "w") as fh: for basename, paths in files.items(): - if "forward" in paths and "reverse" in paths: + if "forward" in paths: found += 1 - print(basename, paths["forward"], paths["reverse"], sep="\t", file=fh) + if "reverse" in paths: + print(basename, paths["forward"], paths["reverse"], sep="\t", file=fh) + else: + print(basename, paths["forward"], sep="\t", file=fh) logger.debug("Adding sample: %s" % basename) logger.info("Found %d samples" % found) From 30d6f7b5a5134026da564067eb2229541f6f79a3 Mon Sep 17 00:00:00 2001 From: Niklaus Johner Date: Tue, 22 Oct 2024 11:20:49 +0200 Subject: [PATCH 2/2] Update runner readme with how to use it for single-end data. --- RUNNER.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/RUNNER.md b/RUNNER.md index 45b4a3b..cbd216b 100644 --- a/RUNNER.md +++ b/RUNNER.md @@ -65,6 +65,8 @@ you can specify the suffixes with `--fwd` and `--rev`: * `--fwd`: forward read suffix [default: `_R1`] * `--rev`: reverse read suffix [default: `_R2`] +Samples will be treated as single-end if a file is found for the forward reads but not for the reverse reads. + ## Environment variables To avoid having to pass the database path as an argument, you can set: