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 args = task.ext.args ?: ''
|
||||||
def args2 = task.ext.args2 ?: ''
|
def args2 = task.ext.args2 ?: ''
|
||||||
def prefix = task.ext.prefix ?: "${meta.id}"
|
def prefix = task.ext.prefix ?: "${meta.id}"
|
||||||
def read_group = meta.read_group ? "-R ${meta.read_group}" : ""
|
|
||||||
def samtools_command = sort_bam ? 'sort' : 'view'
|
def samtools_command = sort_bam ? 'sort' : 'view'
|
||||||
"""
|
"""
|
||||||
INDEX=`find -L ./ -name "*.amb" | sed 's/.amb//'`
|
INDEX=`find -L ./ -name "*.amb" | sed 's/.amb//'`
|
||||||
|
|
||||||
bwa mem \\
|
bwa mem \\
|
||||||
$args \\
|
$args \\
|
||||||
$read_group \\
|
|
||||||
-t $task.cpus \\
|
-t $task.cpus \\
|
||||||
\$INDEX \\
|
\$INDEX \\
|
||||||
$reads \\
|
$reads \\
|
||||||
|
|
|
@ -23,7 +23,6 @@ process BWAMEM2_MEM {
|
||||||
def args = task.ext.args ?: ''
|
def args = task.ext.args ?: ''
|
||||||
def args2 = task.ext.args2 ?: ''
|
def args2 = task.ext.args2 ?: ''
|
||||||
def prefix = task.ext.prefix ?: "${meta.id}"
|
def prefix = task.ext.prefix ?: "${meta.id}"
|
||||||
def read_group = meta.read_group ? "-R ${meta.read_group}" : ""
|
|
||||||
def samtools_command = sort_bam ? 'sort' : 'view'
|
def samtools_command = sort_bam ? 'sort' : 'view'
|
||||||
"""
|
"""
|
||||||
INDEX=`find -L ./ -name "*.amb" | sed 's/.amb//'`
|
INDEX=`find -L ./ -name "*.amb" | sed 's/.amb//'`
|
||||||
|
@ -31,7 +30,6 @@ process BWAMEM2_MEM {
|
||||||
bwa-mem2 \\
|
bwa-mem2 \\
|
||||||
mem \\
|
mem \\
|
||||||
$args \\
|
$args \\
|
||||||
$read_group \\
|
|
||||||
-t $task.cpus \\
|
-t $task.cpus \\
|
||||||
\$INDEX \\
|
\$INDEX \\
|
||||||
$reads \\
|
$reads \\
|
||||||
|
|
|
@ -24,44 +24,23 @@ process DRAGMAP_ALIGN {
|
||||||
def args = task.ext.args ?: ''
|
def args = task.ext.args ?: ''
|
||||||
def args2 = task.ext.args2 ?: ''
|
def args2 = task.ext.args2 ?: ''
|
||||||
def prefix = task.ext.prefix ?: "${meta.id}"
|
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'
|
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}":
|
dragen-os \\
|
||||||
dragmap: \$(echo \$(dragen-os --version 2>&1))
|
-r $hashmap \\
|
||||||
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
|
$args \\
|
||||||
pigz: \$( pigz --version 2>&1 | sed 's/pigz //g' )
|
--num-threads $task.cpus \\
|
||||||
END_VERSIONS
|
$reads_command \\
|
||||||
"""
|
2> ${prefix}.dragmap.log \\
|
||||||
} else {
|
| samtools $samtools_command $args2 --threads $task.cpus -o ${prefix}.bam -
|
||||||
"""
|
|
||||||
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
|
cat <<-END_VERSIONS > versions.yml
|
||||||
"${task.process}":
|
"${task.process}":
|
||||||
dragmap: \$(echo \$(dragen-os --version 2>&1))
|
dragmap: \$(echo \$(dragen-os --version 2>&1))
|
||||||
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
|
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
|
||||||
pigz: \$( pigz --version 2>&1 | sed 's/pigz //g' )
|
pigz: \$( pigz --version 2>&1 | sed 's/pigz //g' )
|
||||||
END_VERSIONS
|
END_VERSIONS
|
||||||
"""
|
"""
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue