mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-12-21 18:58:16 +00:00
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:
parent
39b4b45ba0
commit
4f5274c3de
3 changed files with 16 additions and 41 deletions
|
@ -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 \\
|
||||
|
|
|
@ -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 \\
|
||||
|
|
|
@ -24,44 +24,23 @@ 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 \\
|
||||
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
|
||||
"""
|
||||
} 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 -
|
||||
"""
|
||||
dragen-os \\
|
||||
-r $hashmap \\
|
||||
$args \\
|
||||
--num-threads $task.cpus \\
|
||||
$reads_command \\
|
||||
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
|
||||
"""
|
||||
}
|
||||
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
|
||||
"""
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue