Skip to content

Commit

Permalink
fix: revert include/exclude direction, rename filter & fixed wrapper …
Browse files Browse the repository at this point in the history
…description
  • Loading branch information
ericblanc20 committed Apr 25, 2024
1 parent 0bbc889 commit 12f33cb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions snappy_wrappers/wrappers/bcftools/regions/wrapper.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
"""Wrapper for running bcftools mpileup
"""Wrapper for running bcftools filter over regions defined by a bed file
"""

from snakemake.shell import shell
Expand All @@ -18,9 +18,9 @@
keyword = list(keywords)[0]
path = config["filter_list"][filter_nb]["regions"][keyword]
if keyword == "include":
bed = path
elif keyword == "exclude" or "path_bed":
bed = f"^{path}"
elif keyword == "exclude" or "path_bed":
bed = path
else:
bed = ""
else:
Expand All @@ -32,7 +32,7 @@
elif "bcftools" in config and "filter_name" in config["bcftools"]:
filter_name = config["bcftools"].get("filter_name", "")
elif "filter_nb" in snakemake.wildcards.keys():
filter_name = "bcftools_{}".format(int(snakemake.wildcards["filter_nb"]))
filter_name = "regions_{}".format(int(snakemake.wildcards["filter_nb"]))
else:
filter_name = "+"

Expand All @@ -52,7 +52,7 @@
conda info > {snakemake.log.conda_info}
bcftools filter --soft-filter {filter_name} --mode + \
--mask-file "^{bed}" \
--mask-file "{bed}" \
-O z -o {snakemake.output.vcf} \
{snakemake.input.vcf}
tabix {snakemake.output.vcf}
Expand Down

0 comments on commit 12f33cb

Please sign in to comment.