VARLOCIRAPTOR CONTROL FDR
Control false discovery rate of Varlociraptor calls
URL: https://varlociraptor.github.io/docs/filtering/
Example
This wrapper can be used in the following way:
rule varlociraptor_control_fdr:
input:
"results/variant-calls/{sample_group}.bcf",
output:
"results/variant-calls/{sample_group}.fdr-controlled.bcf",
log:
"logs/varlociraptor/control-fdr/{sample_group}.log",
params:
fdr=0.05,
mode="local-smart",
events=["present"], # list of event names that occur in BCF (case-insensitive)
wrapper:
"v5.5.2-17-g33d5b76/bio/varlociraptor/control-fdr"
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
varlociraptor=8.6.0
Input/Output
Input:
BCF/VCF file with Varlociraptor calls
Output:
filtered BCF/VCF file with Varlociraptor calls such that given FDR is not exceeded
Code
import subprocess as sp
log = snakemake.log_fmt_shell(stdout=False, stderr=True)
sp.run(
"varlociraptor filter-calls control-fdr "
f"{snakemake.input[0]} "
f"--mode {snakemake.params.mode} "
f"--fdr {snakemake.params.fdr} "
f"--events {' '.join(snakemake.params.events)} "
f"> {snakemake.output[0]} {log}",
check=True,
shell=True,
)