Skip to content

Commit

Permalink
capturing sambamba/markdup log for MultiQC report
Browse files Browse the repository at this point in the history
  • Loading branch information
Juan Caballero committed Sep 26, 2024
1 parent 3f43eb2 commit 13a888e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions snakePipes/shared/rules/sambamba.snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,18 @@ rule sambamba_markdup:
input:
aligner+"/{sample}.sorted.bam"
output:
aligner+"/{sample}.bam"# duplicate marked
bam=aligner+"/{sample}.bam"# duplicate marked
log="Sambamba/{sample}.sorted.markdup.txt"
threads: lambda wildcards: 10 if 10<max_thread else max_thread
benchmark: aligner + "/.benchmark/sambamba_markdup.{sample}.benchmark"
params:
tempDir = tempDir
buffer = "--sort-buffer-size=6000 --overflow-list-size 600000"
conda: CONDA_SAMBAMBA_ENV
shell: """
TMPDIR={params.tempDir}
MYTEMP=$(mktemp -d "${{TMPDIR:-/tmp}}"/snakepipes.XXXXXXXXXX)
sambamba markdup -t {threads} --sort-buffer-size=6000 --overflow-list-size 600000 --tmpdir $MYTEMP {input} {output}
sambamba markdup -t {threads} {params.buffer} --tmpdir $MYTEMP {input} {output.bam} > {output.log}
rm -rf "$MYTEMP"
"""

Expand All @@ -25,7 +27,7 @@ rule sambamba_flagstat_sorted:
input:
aligner+"/{sample}.sorted.bam"
output:
"Sambamba/{sample}.sorted.markdup.txt"
"Sambamba/{sample}.sorted.flagstat.txt"
conda: CONDA_SAMBAMBA_ENV
threads: lambda wildcards: 10 if 10<max_thread else max_thread
shell: """
Expand All @@ -36,7 +38,7 @@ rule sambamba_flagstat:
input:
aligner+"/{sample}.bam"
output:
"Sambamba/{sample}.markdup.txt"
"Sambamba/{sample}.flagstat.txt"
conda: CONDA_SAMBAMBA_ENV
threads: lambda wildcards: 10 if 10<max_thread else max_thread
shell: """
Expand Down

0 comments on commit 13a888e

Please sign in to comment.