FILTLONG
Quality filtering tool for long reads.
Example
This wrapper can be used in the following way:
rule filtlong:
input:
reads = "{sample}.fastq"
output:
"{sample}.filtered.fastq"
params:
extra=" --mean_q_weight 5.0",
target_bases = 10
log:
"logs/filtlong/test/{sample}.log"
wrapper:
"v5.5.2-17-g33d5b76/bio/filtlong"
Note that input, output and log file paths can be chosen freely.
When running with
snakemake --use-conda
the software dependencies will be automatically deployed into an isolated environment before execution.
Software dependencies
filtlong=0.2.1
Code
"""Snakemake wrapper for filtlong."""
__author__ = "Michael Hall"
__copyright__ = "Copyright 2019, Michael Hall"
__email__ = "michael@mbh.sh"
__license__ = "MIT"
from snakemake.shell import shell
# Placeholder for optional parameters
extra = snakemake.params.get("extra", "")
target_bases = int(snakemake.params.get("target_bases", 0))
if target_bases > 0:
extra += " --target_bases {}".format(target_bases)
# Formats the log redrection string
log = snakemake.log_fmt_shell(stdout=False, stderr=True)
# Executed shell command
shell("filtlong {extra}" " {snakemake.input.reads} > {snakemake.output} {log}")