Commit 78d2e55e authored by Rachel  LEGENDRE's avatar Rachel LEGENDRE
Browse files

fix errors

parent 8dde433c
......@@ -513,6 +513,8 @@ if config["bamCoverage"]["do"]:
bamCoverage_options = config['bamCoverage']['options']
if config["bamCoverage"]["spike-in"] and config["design"]["spike"]:
bamCoverage_scaleFactor = compute_scaling_factor_output
else:
bamCoverage_scaleFactor = "{}/{{SAMPLE}}_{{REF}}_sort{}.bam".format(biasedRegions_dir, biasedRegions)
final_output.extend(expand(bamCoverage_output, SAMPLE=samples, REF=ref, allow_missing=True))
include: os.path.join(RULES, "bamCoverage.rules")
......
......@@ -287,7 +287,7 @@ differential_analysis:
bamCoverage:
do: yes
options: "--binSize 10 --effectiveGenomeSize 2913022398 --normalizeUsing RPGC"
spike-in: yes
spike-in: no
threads: 4
#############################################################################
......
......@@ -24,7 +24,8 @@
rule bamCoverage:
input:
bamCoverage_input
bam = bamCoverage_input,
scaleFactor = bamCoverage_scaleFactor
log:
out = bamCoverage_logs
output:
......@@ -32,20 +33,19 @@ rule bamCoverage:
singularity:
"epeak.img"
params:
options = bamCoverage_options,
scaleFactor = bamCoverage_scaleFactor
options = bamCoverage_options
envmodules:
"deepTools"
threads:
config['bamCoverage']['threads']
shell:
"""
if [[ -s {params.scaleFactor} && {params.scaleFactor} == *"_scaleFactor.txt"* ]]
if [[ -s {input.scaleFactor} && {input.scaleFactor} == *"_scaleFactor.txt"* ]]
then
S=$(cat {params.scaleFactor})
bamCoverage --bam {input} --outFileName {output} {params.options} --scaleFactor $S --numberOfProcessors {threads} 2> {log.out}
S=$(cat {input.scaleFactor})
bamCoverage --bam {input.bam} --outFileName {output} {params.options} --scaleFactor $S --numberOfProcessors {threads} 2> {log.out}
else
bamCoverage --bam {input} --outFileName {output} {params.options} --numberOfProcessors {threads} 2> {log.out}
bamCoverage --bam {input.bam} --outFileName {output} {params.options} --numberOfProcessors {threads} 2> {log.out}
fi
"""
......@@ -44,7 +44,6 @@ rule bedgraph:
if [[ -s {input.scaleFactor} && {input.scaleFactor} == *"_scaleFactor.txt"* ]]
then
S=$(cat {input.scaleFactor})
echo $S
bedtools genomecov -bg -i $temp_file -g {params.genome} -scale $S > {output} 2> {log.out}
else
bedtools genomecov -bg -i $temp_file -g {params.genome} > {output} 2> {log.out}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment