Commit d563632b authored by van den Berg's avatar van den Berg
Browse files

Use samtools to sort bamfile

parent 9255d5f5
......@@ -94,21 +94,26 @@ rule align:
output:
"{sample}/bams/{sample}-{read_group}.sorted.bam"
params:
bwa_threads = 8,
samtools_threads = 3,
compression_level = 1,
rg = "@RG\\tID:{sample}-library-{read_group}\\tSM:{sample}\\tLB:library\\tPL:ILLUMINA"
log:
bwa = "log/{sample}/align.{read_group}.bwa.log",
picard = "log/{sample}/align.{read_group}.picard.log"
samtools = "log/{sample}/align.{read_group}.samtools.log"
container:
containers["bwa-0.7.17-picard-2.22.8"]
containers["bwa-0.7.17-samtools-1.10"]
threads:
8
11
shell:
"bwa mem -t {threads} -R '{params.rg}' {input.ref} "
"set -eo pipefail;"
"bwa mem -t {params.bwa_threads} -R '{params.rg}' {input.ref} "
"{input.r1} {input.r2} 2> {log.bwa} | "
"picard -Xmx4G -Djava.io.tmpdir={input.tmp} SortSam "
"CREATE_INDEX=TRUE TMP_DIR={input.tmp} "
"INPUT=/dev/stdin OUTPUT={output} "
"SORT_ORDER=coordinate 2> {log.picard}"
"samtools sort -@ {params.samtools_threads} "
"-l {params.compression_level} "
"- -o {output} 2> {log.samtools};"
"samtools index {output}"
rule markdup:
"""Mark duplicates in BAM file"""
......
......@@ -8,6 +8,7 @@ containers = {
'bedtools-2.26-python-2.7': 'docker://quay.io/biocontainers/mulled-v2-3251e6c49d800268f0bc575f28045ab4e69475a6:4ce073b219b6dabb79d154762a9b67728c357edb-0',
'biopet-scatterregions': 'docker://quay.io/biocontainers/biopet-scatterregions:0.2--0',
'bwa-0.7.17-picard-2.22.8': 'docker://quay.io/biocontainers/mulled-v2-002f51ea92721407ef440b921fb5940f424be842:76d16eabff506ac13338d7f14644a0ad301b9d7e-0',
'bwa-0.7.17-samtools-1.10': 'docker://quay.io/biocontainers/mulled-v2-ad317f19f5881324e963f6a6d464d696a2825ab6:c59b7a73c87a9fe81737d5d628e10a3b5807f453-0',
'cutadapt': 'docker://quay.io/biocontainers/cutadapt:2.9--py37h516909a_0',
'debian': 'docker://debian:buster-slim',
'fastqc': 'docker://quay.io/biocontainers/fastqc:0.11.7--4',
......
Markdown is supported
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