Question: How to use Snakemake with tools which don't have clearly defined output options for files?
0
gravatar for Artem Kiselev
7 months ago by
Russian Federation
Artem Kiselev20 wrote:

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!

ADD COMMENTlink modified 7 months ago by WouterDeCoster38k • written 7 months ago by Artem Kiselev20
1
gravatar for WouterDeCoster
7 months ago by
Belgium
WouterDeCoster38k wrote:

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 COMMENTlink written 7 months ago by WouterDeCoster38k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1513 users visited in the last hour