Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
hub
ePeak
Commits
f5be3025
Commit
f5be3025
authored
Apr 04, 2022
by
Rachel LEGENDRE
Browse files
add stderr log to macs2 - add spp file as input instead of params
parent
9e1eddaa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Snakefile
View file @
f5be3025
...
...
@@ -667,7 +667,7 @@ if config["macs2"]["do"]:
macs2_options
+=
" --nomodel "
macs2_shift_file
=
os
.
path
.
join
(
analysis_dir
,
"05-QC/PhantomPeakQualTools/{{SAMPLE}}_{}_sort{}_spp.out"
.
format
(
ref
,
biasedRegions
))
else
:
macs2_shift_file
=
"
Empty"
macs2_shift_file
=
"
{}/{{SAMPLE}}_{}_sort{}.bam"
.
format
(
biasedRegions_dir
,
ref
,
biasedRegions
)
if
paired
:
macs2_pe_mode
=
"no"
else
:
...
...
@@ -675,7 +675,8 @@ if config["macs2"]["do"]:
macs2_input_bam
=
"{}/{{SAMPLE}}_{}_sort{}.bam"
.
format
(
biasedRegions_dir
,
ref
,
biasedRegions
)
macs2_control
=
INPUTtoIP
macs2_log
=
os
.
path
.
join
(
analysis_dir
,
"06-PeakCalling/macs2/{}/logs/{{SAMPLE}}.out"
.
format
(
model_dir
))
macs2_log_out
=
os
.
path
.
join
(
analysis_dir
,
"06-PeakCalling/macs2/{}/logs/{{SAMPLE}}.out"
.
format
(
model_dir
))
macs2_log_err
=
os
.
path
.
join
(
analysis_dir
,
"06-PeakCalling/macs2/{}/logs/{{SAMPLE}}.err"
.
format
(
model_dir
))
macs2_output
=
os
.
path
.
join
(
analysis_dir
,
"06-PeakCalling/macs2/{}/{{SAMPLE}}_peaks.{}Peak"
.
format
(
model_dir
,
model
))
macs2_output_prefix
=
os
.
path
.
join
(
analysis_dir
,
"06-PeakCalling/macs2/{}/{{SAMPLE}}"
.
format
(
model_dir
))
...
...
workflow/rules/macs2.rules
View file @
f5be3025
...
...
@@ -26,16 +26,17 @@
rule macs2:
input:
bam = macs2_input_bam,
control = macs2_control
control = macs2_control,
shift_file = macs2_shift_file
params:
gsize = config["macs2"]["genomeSize"],
options = macs2_options,
pe_mode = macs2_pe_mode,
prefix = macs2_output_prefix,
shift_file = macs2_shift_file,
read_length = 146
log:
out = macs2_log
out = macs2_log_out,
err = macs2_log_err
output:
macs2_output
singularity:
...
...
@@ -46,20 +47,20 @@ rule macs2:
#if [[ "{input.control}" == "NA" ]] ; then input="" ; else input="{input.control}" ; fi
if [[ {
params
.shift_file}
!
= "
Empty"
]] ; then
if [[ -e {
params
.shift_file} ]] ; then
shift=$(awk '{{print $3}}' {
params
.shift_file} | awk -F ',' '{{if ($1=={params.read_length}){{print $2}} else {{print $1}} }}')
if [[ {
input
.shift_file}
=
= "
*_spp.out"
]] ; then
if [[ -e {
input
.shift_file} ]] ; then
shift=$(awk '{{print $3}}' {
input
.shift_file} | awk -F ',' '{{if ($1=={params.read_length}){{print $2}} else {{print $1}} }}')
if [[ {params.pe_mode} == "yes" ]] ; then
macs2 callpeak -t {input.bam} -c {input.control} -f BAMPE -g {params.gsize} -n {params.prefix} {params.options} --extsize ${{shift}}
2
> {log.out}
macs2 callpeak -t {input.bam} -c {input.control} -f BAMPE -g {params.gsize} -n {params.prefix} {params.options} --extsize ${{shift}} > {log.out}
2> {log.err}
else
macs2 callpeak -t {input.bam} -c {input.control} -f BAM -g {params.gsize} -n {params.prefix} {params.options} --extsize ${{shift}}
2
> {log.out}
macs2 callpeak -t {input.bam} -c {input.control} -f BAM -g {params.gsize} -n {params.prefix} {params.options} --extsize ${{shift}}> {log.out}
2> {log.err}
fi
fi
else
if [[ {params.pe_mode} == "yes" ]] ; then
macs2 callpeak -t {input.bam} -c {input.control} -f BAMPE -g {params.gsize} -n {params.prefix} {params.options}
2
> {log.out}
macs2 callpeak -t {input.bam} -c {input.control} -f BAMPE -g {params.gsize} -n {params.prefix} {params.options} > {log.out}
2> {log.err}
else
macs2 callpeak -t {input.bam} -c {input.control} -f BAM -g {params.gsize} -n {params.prefix} {params.options}
2
> {log.out}
macs2 callpeak -t {input.bam} -c {input.control} -f BAM -g {params.gsize} -n {params.prefix} {params.options} > {log.out}
2> {log.err}
fi
fi
"""
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment