How to use Snakemake with tools which don't have clearly defined output options for files?
1
0
Entering edit mode
5.6 years ago

Hi, I would like to use Snakemake in my variant annotation pipeline. But Annovar don't have clearly defined file output option (I can assign only output folder and annovar going to attach to filename: "multianno.hg19), I can't describe final annovar output in "rule all", since it differs from the output parameters in rule for annovar tool. Help, please solve this problem. Thank you!

next-gen Snakemake sequencing pipeline • 2.8k views
ADD COMMENT
1
Entering edit mode
5.6 years ago

You specify output files that are created, and use a params value for your shell code.

Example below for mosdepth:
I specify that mosdepth/{sample}.mosdepth.global.dist.txt will be created, but as output value for my shell command I use mosdepth/{params.prefix}, which takes the sample name.
Mosdepth will create mosdepth/{sample}.mosdepth.global.dist.txt

rule mosdepth_get:
    input:
        bam = "alignment/{sample}.bam",
        bai = "alignment/{sample}.bam.bai"
    output:
        protected("mosdepth/{sample}.mosdepth.global.dist.txt"),
        protected("mosdepth/{sample}.regions.bed.gz"),
    params:
        windowsize = 500,
        prefix = "{sample}",
    log:
        "logs/{aligner}/mosdepth/mosdepth_{sample}.log"
    shell:
        "mosdepth -n --by {params.windowsize} mosdepth/{params.prefix} {input.bam} 2> {log}"
ADD COMMENT

Login before adding your answer.

Traffic: 1675 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6