feat: remove read_group which should be set up with task.ext.args (#1521)

* feat: remove reat_group which should be set up with ext.args

* fix: simplify dragmap command
This commit is contained in:
Maxime U. Garcia 2022-04-13 14:30:34 +02:00 committed by GitHub
parent 39b4b45ba0
commit 4f5274c3de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 41 deletions

View file

@ -23,14 +23,12 @@ process BWA_MEM {
def args = task.ext.args ?: ''
def args2 = task.ext.args2 ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def read_group = meta.read_group ? "-R ${meta.read_group}" : ""
def samtools_command = sort_bam ? 'sort' : 'view'
"""
INDEX=`find -L ./ -name "*.amb" | sed 's/.amb//'`
bwa mem \\
$args \\
$read_group \\
-t $task.cpus \\
\$INDEX \\
$reads \\

View file

@ -23,7 +23,6 @@ process BWAMEM2_MEM {
def args = task.ext.args ?: ''
def args2 = task.ext.args2 ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def read_group = meta.read_group ? "-R ${meta.read_group}" : ""
def samtools_command = sort_bam ? 'sort' : 'view'
"""
INDEX=`find -L ./ -name "*.amb" | sed 's/.amb//'`
@ -31,7 +30,6 @@ process BWAMEM2_MEM {
bwa-mem2 \\
mem \\
$args \\
$read_group \\
-t $task.cpus \\
\$INDEX \\
$reads \\

View file

@ -24,16 +24,15 @@ process DRAGMAP_ALIGN {
def args = task.ext.args ?: ''
def args2 = task.ext.args2 ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def read_group = meta.read_group ? "--RGSM ${meta.read_group}" : ""
def reads_command = meta.single_end ? "-1 $reads" : "-1 ${reads[0]} -2 ${reads[1]}"
def samtools_command = sort_bam ? 'sort' : 'view'
if (meta.single_end) {
"""
dragen-os \\
-r $hashmap \\
$args \\
$read_group \\
--num-threads $task.cpus \\
-1 $reads \\
$reads_command \\
2> ${prefix}.dragmap.log \\
| samtools $samtools_command $args2 --threads $task.cpus -o ${prefix}.bam -
@ -44,24 +43,4 @@ process DRAGMAP_ALIGN {
pigz: \$( pigz --version 2>&1 | sed 's/pigz //g' )
END_VERSIONS
"""
} else {
"""
dragen-os \\
-r $hashmap \\
$args \\
$read_group \\
--num-threads $task.cpus \\
-1 ${reads[0]} \\
-2 ${reads[1]} \\
2> ${prefix}.dragmap.log \\
| samtools $samtools_command $args2 --threads $task.cpus -o ${prefix}.bam -
cat <<-END_VERSIONS > versions.yml
"${task.process}":
dragmap: \$(echo \$(dragen-os --version 2>&1))
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
pigz: \$( pigz --version 2>&1 | sed 's/pigz //g' )
END_VERSIONS
"""
}
}