Skip to content
Snippets Groups Projects
Unverified Commit ebb5cb65 authored by Laurent Modolo's avatar Laurent Modolo
Browse files

samtools: fix flagstats cmd

parent 42f56bde
Branches
Tags
No related merge requests found
...@@ -90,7 +90,6 @@ process split_bam { ...@@ -90,7 +90,6 @@ process split_bam {
container = "${container_url}" container = "${container_url}"
label "big_mem_multi_cpus" label "big_mem_multi_cpus"
tag "$file_id" tag "$file_id"
cpus = 2
input: input:
tuple val(file_id), path(bam) tuple val(file_id), path(bam)
...@@ -100,8 +99,10 @@ process split_bam { ...@@ -100,8 +99,10 @@ process split_bam {
tuple val(file_id), path("*_reverse.bam*"), emit: bam_reverse tuple val(file_id), path("*_reverse.bam*"), emit: bam_reverse
script: script:
""" """
samtools view -hb -F 0x10 ${bam} > ${file_id}_forward.bam & samtools view --@ ${Math.round(task.cpus/2)} \
samtools view -hb -f 0x10 ${bam} > ${file_id}_reverse.bam -hb -F 0x10 ${bam} > ${file_id}_forward.bam &
samtools view --@ ${Math.round(task.cpus/2)} \
-hb -f 0x10 ${bam} > ${file_id}_reverse.bam
""" """
} }
...@@ -124,9 +125,9 @@ samtools merge ${first_bam} ${second_bam} ${first_bam_id}_${second_file_id}.bam ...@@ -124,9 +125,9 @@ samtools merge ${first_bam} ${second_bam} ${first_bam_id}_${second_file_id}.bam
""" """
} }
process bam_stats { process stats_bam {
container = "${container_url}" container = "${container_url}"
label "big_mem_mono_cpus" label "big_mem_multi_cpus"
tag "$file_id" tag "$file_id"
cpus = 2 cpus = 2
...@@ -137,6 +138,6 @@ process bam_stats { ...@@ -137,6 +138,6 @@ process bam_stats {
tuple val(file_id), path("*.tsv"), emit: tsv tuple val(file_id), path("*.tsv"), emit: tsv
script: script:
""" """
samtools flagstat -O tsv ${bam} > ${file_id}.tsv samtools flagstat -@ ${task.cpus} -O tsv ${bam} > ${file_id}.tsv
""" """
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment