|
|
|
@ -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
|
|
|
|
|
"""
|
|
|
|
|
}
|
|
|
|
|