VARLOCIRAPTOR PREPROCESS VARIANTS

https://img.shields.io/github/issues-pr/snakemake/snakemake-wrappers/bio/varlociraptor/preprocess-variants?label=version%20update%20pull%20requests

Preprocess candidate variants for variant calling with Varlociraptor

URL: https://varlociraptor.github.io/docs/calling/#preprocessing-per-sample-observations

Example

This wrapper can be used in the following way:

rule varlociraptor_preprocess:
    input:
        ref="resources/genome.fasta",
        alignment_properties="results/alignment-properties/{sample}.json",
        alignments="results/alignments/{sample}.bam",
        candidate_variants="results/candidate-variants/{sample}.vcf",  # vcf or bcf supported
    output:
        "results/observations/{sample}.bcf",
    log:
        "logs/varlociraptor/preprocess/{sample}.log",
    params:
        extra="",  # optional additional parameters
    wrapper:
        "v5.5.2-17-g33d5b76/bio/varlociraptor/preprocess-variants"

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:

  • reference genome

  • read alignments

  • varlociraptor alignment properties

  • candidate variants

Output:

  • preprocessed variants

Authors

  • Johannes Köster

Code

import subprocess as sp

log = snakemake.log_fmt_shell(stdout=False, stderr=True)

sp.run(
    "varlociraptor preprocess variants "
    f"{snakemake.params.get('extra', '')} {snakemake.input.ref} "
    f"--alignment-properties {snakemake.input.alignment_properties} "
    f"--candidates {snakemake.input.candidate_variants} "
    f"--bam {snakemake.input.alignments} "
    f"--output {snakemake.output[0]} {log}",
    check=True,
    shell=True,
)