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

Add support for single-end samples in python runner. #47

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions RUNNER.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 5 additions & 2 deletions run_phanta.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down