2021-07-27 07:13:48 +00:00
|
|
|
process BWA_ALN {
|
|
|
|
tag "$meta.id"
|
|
|
|
label 'process_medium'
|
|
|
|
|
|
|
|
conda (params.enable_conda ? "bioconda::bwa=0.7.17" : null)
|
2021-11-26 07:58:40 +00:00
|
|
|
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
|
|
|
'https://depot.galaxyproject.org/singularity/bwa:0.7.17--h5bf99c6_8' :
|
|
|
|
'quay.io/biocontainers/bwa:0.7.17--h5bf99c6_8' }"
|
2021-07-27 07:13:48 +00:00
|
|
|
|
|
|
|
input:
|
|
|
|
tuple val(meta), path(reads)
|
|
|
|
path index
|
|
|
|
|
|
|
|
output:
|
2021-08-17 13:55:54 +00:00
|
|
|
tuple val(meta), path("*.sai"), emit: sai
|
2021-10-01 13:04:56 +00:00
|
|
|
path "versions.yml" , emit: versions
|
2021-07-27 07:13:48 +00:00
|
|
|
|
|
|
|
script:
|
2021-11-26 07:58:40 +00:00
|
|
|
def args = task.ext.args ?: ''
|
|
|
|
def prefix = task.ext.suffix ? "${meta.id}${task.ext.suffix}" : "${meta.id}"
|
2021-07-27 07:13:48 +00:00
|
|
|
|
|
|
|
if (meta.single_end) {
|
|
|
|
"""
|
|
|
|
INDEX=`find -L ./ -name "*.amb" | sed 's/.amb//'`
|
|
|
|
|
|
|
|
bwa aln \\
|
2021-11-26 07:58:40 +00:00
|
|
|
$args \\
|
2021-07-27 07:13:48 +00:00
|
|
|
-t $task.cpus \\
|
|
|
|
-f ${prefix}.sai \\
|
|
|
|
\$INDEX \\
|
|
|
|
${reads}
|
|
|
|
|
2021-09-27 08:41:24 +00:00
|
|
|
cat <<-END_VERSIONS > versions.yml
|
2021-11-26 07:58:40 +00:00
|
|
|
"${task.process}":
|
|
|
|
bwa: \$(echo \$(bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//')
|
2021-09-27 08:41:24 +00:00
|
|
|
END_VERSIONS
|
2021-07-27 07:13:48 +00:00
|
|
|
"""
|
|
|
|
} else {
|
|
|
|
"""
|
|
|
|
INDEX=`find -L ./ -name "*.amb" | sed 's/.amb//'`
|
|
|
|
|
|
|
|
bwa aln \\
|
2021-11-26 07:58:40 +00:00
|
|
|
$args \\
|
2021-07-27 07:13:48 +00:00
|
|
|
-t $task.cpus \\
|
|
|
|
-f ${prefix}.1.sai \\
|
|
|
|
\$INDEX \\
|
|
|
|
${reads[0]}
|
|
|
|
|
|
|
|
bwa aln \\
|
2021-11-26 07:58:40 +00:00
|
|
|
$args \\
|
2021-07-27 07:13:48 +00:00
|
|
|
-t $task.cpus \\
|
|
|
|
-f ${prefix}.2.sai \\
|
|
|
|
\$INDEX \\
|
|
|
|
${reads[1]}
|
|
|
|
|
2021-09-27 08:41:24 +00:00
|
|
|
cat <<-END_VERSIONS > versions.yml
|
2021-11-26 07:58:40 +00:00
|
|
|
"${task.process}":
|
|
|
|
bwa: \$(echo \$(bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//')
|
2021-09-27 08:41:24 +00:00
|
|
|
END_VERSIONS
|
2021-07-27 07:13:48 +00:00
|
|
|
"""
|
|
|
|
}
|
|
|
|
}
|