Skip to content

Commit

Permalink
move to annovar because of to many snpEff bugs...
Browse files Browse the repository at this point in the history
  • Loading branch information
tbersez committed Apr 16, 2019
1 parent b4f7fcf commit a16323d
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 10 deletions.
9 changes: 3 additions & 6 deletions Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,14 @@ include : cwd + "modules/" + config["FASTP"]
include : cwd + "modules/" + config["INDEXER"]
include : cwd + "modules/" + config["ALLIGNER"]
include : cwd + "modules/bam_with_bed_parse.py"
include : cwd + "modules/vcf_to_avinput.py"
include : cwd + "modules/varscan.py"
include : cwd + "modules/snpEff.py"
include : cwd + "modules/snpsift_non_synonymous.py"
include : cwd + "modules/annovar.py"
include : cwd + "modules/make_report.py"
include : cwd + "modules/bam_index.py"
include : cwd + "modules/whatshap.py"
include : cwd + "modules/vcf_merge.py"

# target files...
rule all:
input:
'Non_synonymous_variants_summary.tab',
expand(config["VAR"] + "{samples}/{samples}_varscan_phased.vcf", samples = config["samples"]),
config["VAR"] + "Non_synonymous_SNP.vcf"
expand(config["VAR"] + "{samples}/{samples}_varscan.avinput.variant_function", samples = config["samples"])
34 changes: 34 additions & 0 deletions modules/annovar.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Annovar SNPs annotation
#
# This module annotate SNPs from Varscan
# on a gene model basis
#
# Input:
# - sample_varscan.avinput
#
# Output:
# - sample_varscan_anno.avoutput
#
# Parameters:
# None...

rule annovar :
input:
inav = config["VAR"] + "{samples}/{samples}_varscan.avinput"
output:
all_vars = config["VAR"] + "{samples}/{samples}_varscan.avinput.variant_function",
exonic_vars = config["VAR"] + "{samples}/{samples}_varscan.avinput.exonic_variant_function"
params:
bind = config["BIND"],
cont = config["CONT"]
message: "Annotating {input.inav} with Annovar \n"
shell:
"""
singularity exec -B {params.bind} {params.cont} \
/opt/annovar/annotate_variation.pl \
-geneanno \
-dbtype refGene \
-buildver AV \
{input.inav} \
avdb/ \
"""
32 changes: 32 additions & 0 deletions modules/vcf_to_avinput.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Annovar format converter
#
# This module convert vcf4 format files from Varscan
# to annovar input format
#
# Input:
# - sample(vcf4)_varscan.vcf
#
# Output:
# - sample_varscan.avinput
#
# Parameters:
# None...

rule vcf4_to_avinput:
input:
vcf = config["VAR"] + "{samples}/{samples}_varscan.vcf"
output:
annovar = config["VAR"] + "{samples}/{samples}_varscan.avinput"
params:
bind = config["BIND"],
cont = config["CONT"]
message: "Converting {input.vcf} to avinput format \n"
shell:
"""
singularity exec -B {params.bind} {params.cont} \
/opt/annovar/convert2annovar.pl \
-format vcf4 \
-includeinfo \
-outfile {output.annovar} \
{input.vcf}
"""
20 changes: 16 additions & 4 deletions slurm_config.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
{
"__default__" : {
"name" : "AllMine {rule} [{wildcards}]",
"partition" : "express",
"time" : "48:00:00",
"partition" : "lm.q",
"time" : "72:00:00",
"ntasks" : 1,
"cpus-per-task" : 1,
"mem-per-cpu-mb" : 2000,
"output" : "~/logs/{rule}.{wildcards}.stout",
"error" : "~/logs/{rule}.{wildcards}.sterr"
"errorStrategy" : "retry",
"maxRetries" : 2,
"cache" : "deep",
"maxErrors" : 10
},

"fastp_paired" : {
Expand Down Expand Up @@ -111,5 +113,15 @@
"bam_index" : {
"cpus-per-task" : 1,
"mem-per-cpu-mb" : 2000
},

"annovar" : {
"cpus-per-task" : 1,
"mem-per-cpu-mb" : 6000
},

"vcf4_to_avinput" : {
"cpus-per-task" : 1,
"mem-per-cpu-mb" : 4000
}
}

0 comments on commit a16323d

Please sign in to comment.