Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 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}.markdup.bam"# duplicate marked
bam=aligner+"/{sample}.markdup.bam"
log: "Sambamba/{sample}.markdup.txt"
threads: lambda wildcards: 10 if 10<max_thread else max_thread
benchmark: aligner + "/.benchmark/sambamba_markdup.{sample}.benchmark"
params:
tempDir = tempDir
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} > {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}.markdup.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