Skip to content
Snippets Groups Projects
Commit 9d905ba1 authored by mariabernard's avatar mariabernard
Browse files

change bgzip\tabix management and temp files definition

parent 305e3911
No related branches found
No related tags found
No related merge requests found
......@@ -49,4 +49,7 @@ rule GenotypeGVCFs:
mem=config["GenotypeGVCFs"]["mem"]
shell:
"java -Xmx{params.mem} -jar {config[bin][gatk]} -T GenotypeGVCFs -R {input.ref} --variant {input.gvcf} -o {output} 2> {log}"
"""
java -Xmx{params.mem} -jar {config[bin][gatk]} -T GenotypeGVCFs -R {input.ref} --variant {input.gvcf} -o {output} 2> {log}
{config[bin][tabix]} -f -p vcf {output}
"""
......@@ -32,13 +32,23 @@ rule freebayes_gzip:
"results/freebayes/{sample}.rg.sort.md.real.recal.vcf"
output:
"results/freebayes/{sample}.rg.sort.md.real.recal.vcf.gz.tbi",
vcf="results/freebayes/{sample}.rg.sort.md.real.recal.vcf.gz"
temp("results/freebayes/{sample}.rg.sort.md.real.recal.vcf.gz")
shell:
"""
{config[bin][bgzip]} -c {input} > {output.vcf}
{config[bin][tabix]} -f -p vcf {output.vcf}
{config[bin][bgzip]} -c {input} > {output}
"""
rule freebayes_tabix:
input:
"results/freebayes/{sample}.rg.sort.md.real.recal.vcf.gz"
output:
temp("results/freebayes/{sample}.rg.sort.md.real.recal.vcf.gz.tbi")
shell:
"""
{config[bin][tabix]} -f -p vcf {input}
"""
rule vcf_merge_freebayes:
......@@ -47,7 +57,8 @@ rule vcf_merge_freebayes:
vcf=expand("results/freebayes/{sample}.rg.sort.md.real.recal.vcf.gz", sample=all_samples)
output:
protected("results/freebayes/variants_freebayes_all.vcf.gz")
protected("results/freebayes/variants_freebayes_all.vcf.gz.tbi"),
vcf=protected("results/freebayes/variants_freebayes_all.vcf.gz")
log:
"results/freebayes/logs/merge_all_samples.stderr"
......@@ -55,5 +66,5 @@ rule vcf_merge_freebayes:
shell:
"""
export PATH=`dirname {config[bin][tabix]}`:$PATH
{config[bin][vcf-merge]} {input.vcf} | {config[bin][bgzip]} -c > {output}; {config[bin][tabix]} -p vcf {output}
{config[bin][vcf-merge]} {input.vcf} | {config[bin][bgzip]} -c > {output.vcf}; {config[bin][tabix]} -p vcf {output.vcf}
"""
......@@ -16,7 +16,7 @@ rule HaplotypeCaller:
ref=config["reference_genome"]
output:
gvcf="results/gatk_haplotypecaller/{sample}.rg.sort.md.real.recal.g.vcf.gz",
gvcf=protected("results/gatk_haplotypecaller/{sample}.rg.sort.md.real.recal.g.vcf.gz"),
index="results/gatk_haplotypecaller/{sample}.rg.sort.md.real.recal.g.vcf.gz.tbi"
log:
......@@ -26,7 +26,7 @@ rule HaplotypeCaller:
params:
mem=config["HaplotypeCaller"]["mem"],
stand_call_conf="30" if config["stand_call_conf"]=="" else config["stand_call_conf"],
mmq="30" if config["min_mapping_quality"]=="" else config["min_mapping_quality"]
mmq="30" if config["min_mapping_quality"]=="" else config["min_mapping_quality"],
mbq="10" if config["min_base_quality"]=="" else config["min_base_quality"]
shell:
......
......@@ -32,13 +32,23 @@ rule mpileup_gzip:
"results/mpileup/{sample}.rg.sort.md.real.recal.vcf"
output:
vcf=protected("results/mpileup/{sample}.rg.sort.md.real.recal.vcf.gz"),
tbi=protected("results/mpileup/{sample}.rg.sort.md.real.recal.vcf.gz.tbi")
temp("results/mpileup/{sample}.rg.sort.md.real.recal.vcf.gz")
shell:
"""
{config[bin][bgzip]} -c {input} > {output.vcf}
{config[bin][tabix]} -f -p vcf {output.vcf}
{config[bin][bgzip]} -c {input} > {output}
"""
rule mpileup_tabix:
input:
"results/mpileup/{sample}.rg.sort.md.real.recal.vcf.gz"
output:
temp("results/mpileup/{sample}.rg.sort.md.real.recal.vcf.gz.tbi")
shell:
"""
{config[bin][tabix]} -f -p vcf {input}
"""
rule vcf_merge_mpileup:
......@@ -47,7 +57,8 @@ rule vcf_merge_mpileup:
vcf=expand("results/mpileup/{sample}.rg.sort.md.real.recal.vcf.gz", sample=all_samples)
output:
protected("results/mpileup/variants_mpileup_all.vcf.gz")
protected("results/mpileup/variants_mpileup_all.vcf.gz.tbi"),
vcf = protected("results/mpileup/variants_mpileup_all.vcf.gz")
log:
"results/mpileup/logs/merge_all_samples.stderr"
......@@ -55,6 +66,6 @@ rule vcf_merge_mpileup:
shell:
"""
export PATH=`dirname {config[bin][tabix]}`:$PATH
{config[bin][vcf-merge]} {input.vcf} | {config[bin][bgzip]} -c > {output} ; {config[bin][tabix]} -p vcf {output}
{config[bin][vcf-merge]} {input.vcf} | {config[bin][bgzip]} -c > {output.vcf} ; {config[bin][tabix]} -p vcf {output.vcf}
"""
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment