Candy lab analysis workflow

public public 1yr ago 0 bookmarks

Automation of the workflow originally developped by Irene Lobon

  1. Mutect2 variant calling

  2. Quality filtering

  3. Multi sample merging and rescuing

  4. .. TO BE ADDED: annotation

Code Snippets

51
52
53
54
55
56
57
58
59
60
61
62
shell:
    "java -jar $EBROOTGATK/gatk-package-4.1.8.1-local.jar Mutect2 \
    --native-pair-hmm-threads {threads} \
    -R {input.ref} \
    -L {input.intv} \
    -I {input.tb} \
    -I {input.nb} \
    -normal {params.nn} \
    -germline-resource {input.gr} \
    -pon {input.pon} \
    --f1r2-tar-gz {output.n} \
    -O {output.v}"
81
82
83
84
shell:
    "java -jar $EBROOTGATK/gatk-package-4.1.8.1-local.jar LearnReadOrientationModel \
    -I {input} \
    -O {output}"
108
109
110
111
112
113
114
115
shell:
    """
    java -jar $EBROOTGATK/gatk-package-4.1.8.1-local.jar FilterMutectCalls \
    -R {input.r} \
    -V {input.v} \
    --ob-priors {input.priors} \
    -O {output.v}
    """
134
135
shell:
    "tabix -p vcf {input}"
157
158
159
160
161
162
shell:
    """
    #echo "##INFO=<ID=AS_FilterStatus,Number=A" | sed "s/##INFO=<ID=AS_FilterStatus,Number=A/##INFO=<ID=AS_FilterStatus,Number=1/" && touch {output.v} && touch {output.i}
    /nemo/lab/turajlics/home/users/fidanr/bcftools/bin/bcftools norm -m -any {input.v} | sed "s/##INFO=<ID=AS_FilterStatus,Number=A/##INFO=<ID=AS_FilterStatus,Number=1/" | bgzip > {output.v}
    /nemo/lab/turajlics/home/users/fidanr/bcftools/bin/bcftools tabix {output.v}
    """
188
189
190
191
192
193
shell:
    """
    /nemo/lab/turajlics/home/users/fidanr/bcftools/bin/bcftools view \
    -i '(ROQ>{params.ROQ} & AD[1:1]>{params.AD}) & (FILTER="PASS" | FILTER="clustered_events" )' -Oz -o {output.v} {input.v}
    /nemo/lab/turajlics/home/users/fidanr/bcftools/bin/bcftools tabix {output.v}
    """
211
212
213
214
215
shell:
    """
    cp {input.v} {output.v}
    cp {input.i} {output.i}
    """
235
236
237
238
shell:
    """
    zcat {input.v} | grep -v "^#" | cut -f1-5 | sort -V | uniq > {output}
    """
261
262
263
264
265
266
267
268
269
270
shell:
    """
    zcat {input.v} | grep "^#" | bgzip >{output.v}
    for x in $(seq 1 1000 $(wc -l {input.pos} | awk '{{print $1}}'))
    do
    y=$((x+999))
    zcat {input.v} | grep -v "^#" | grep --line-buffered -f <(sed -n "${{x}},${{y}}p" {input.pos}) - | bgzip >> {output.v}
    done
    /nemo/lab/turajlics/home/users/fidanr/bcftools/bin/bcftools tabix {output.v}
    """
292
293
294
295
296
shell:
    """
    /nemo/lab/turajlics/home/users/fidanr/bcftools/bin/bcftools merge -0 -Oz -o {output.v} --force-samples {input.v}
    /nemo/lab/turajlics/home/users/fidanr/bcftools/bin/bcftools tabix {output.v}
    """
321
322
323
324
325
326
327
328
shell:
    """
    echo {params.GL} > {output.s}
    /nemo/lab/turajlics/home/users/fidanr/bcftools/bin/bcftools query -l {input.v} | grep -v {params.GL} >> {output.s}
    /nemo/lab/turajlics/home/users/fidanr/bcftools/bin/bcftools view -S {output.s} {input.v} -Oz -o {output.v1} 
    /nemo/lab/turajlics/home/users/fidanr/bcftools/bin/bcftools sort {output.v1} -Oz -o {output.v2}
    tabix -p vcf {output.v2}
    """
348
349
350
351
shell:
    """
    /nemo/lab/turajlics/home/users/fidanr/bcftools/bin/bcftools norm -m -any {input.v} | bgzip > {output}
    """
377
378
379
380
381
382
383
384
385
386
shell:
    """
    # Make a list of bams in VCF order
    echo {input.nb} > {output.bamlist}
    for i in {input.tb}; do echo $i >> {output.bamlist}; done
    /nemo/lab/turajlics/home/users/fidanr/bcftools/bin/bcftools query -l {input.v} >> {output.s}
    while read i; do grep $i {output.bamlist} >> {output.obamlist}; done< {output.s}
    #Genotype (SNVs, MNVs and indels)
    python3.6 {params.res} {input.v} {output.obamlist} {output.v}
    """
ShowHide 11 more snippets with no or duplicated tags.

Login to post a comment if you would like to share your experience with this workflow.

Do you know this workflow well? If so, you can request seller status , and start supporting this workflow.

Free

Created: 1yr ago
Updated: 1yr ago
Maitainers: public
URL: https://github.com/rabiafidan/candy
Name: candy
Version: 1
Badge:
workflow icon

Insert copied code into your website to add a link to this workflow.

Downloaded: 0
Copyright: Public Domain
License: None
  • Future updates

Related Workflows

cellranger-snakemake-gke
snakemake workflow to run cellranger on a given bucket using gke.
A Snakemake workflow for running cellranger on a given bucket using Google Kubernetes Engine. The usage of this workflow ...