Skip to content

Commit

Permalink
style: Run lsp format on a parabricks module
Browse files Browse the repository at this point in the history
For science
  • Loading branch information
edmundmiller committed Nov 18, 2024
1 parent 9863eba commit d134e78
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions modules/nf-core/parabricks/applybqsr/main.nf
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
process PARABRICKS_APPLYBQSR {
tag "$meta.id"
tag "${meta.id}"
label 'process_high'
label 'process_gpu'

container "nvcr.io/nvidia/clara/clara-parabricks:4.3.2-1"

input:
Expand All @@ -15,36 +14,36 @@ process PARABRICKS_APPLYBQSR {
output:
tuple val(meta), path("*.bam"), emit: bam
tuple val(meta), path("*.bai"), emit: bai
path "versions.yml" , emit: versions
path "versions.yml", emit: versions

when:
task.ext.when == null || task.ext.when

script:
// Exit if running this module with -profile conda / -profile mamba
if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) {
error "Parabricks module does not support Conda. Please use Docker / Singularity / Podman instead."
error("Parabricks module does not support Conda. Please use Docker / Singularity / Podman instead.")
}
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def interval_command = intervals ? intervals.collect{"--interval-file $it"}.join(' ') : ""
def copy_index_command = bam_index ? "cp -L $bam_index `readlink -f $bam`.bai" : ""
def num_gpus = task.accelerator ? "--num-gpus $task.accelerator.request" : ''
def interval_command = intervals ? intervals.collect { "--interval-file ${it}" }.join(' ') : ""
def copy_index_command = bam_index ? "cp -L ${bam_index} `readlink -f ${bam}`.bai" : ""
def num_gpus = task.accelerator ? "--num-gpus ${task.accelerator.request}" : ''
"""
# parabricks complains when index is not a regular file in the same directory as the bam
# copy the index to this path.
$copy_index_command
${copy_index_command}
pbrun \\
applybqsr \\
--ref $fasta \\
--in-bam $bam \\
--in-recal-file $bqsr_table \\
$interval_command \\
--ref ${fasta} \\
--in-bam ${bam} \\
--in-recal-file ${bqsr_table} \\
${interval_command} \\
--out-bam ${prefix}.bam \\
--num-threads $task.cpus \\
$num_gpus \\
$args
--num-threads ${task.cpus} \\
${num_gpus} \\
${args}
cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand All @@ -55,7 +54,7 @@ process PARABRICKS_APPLYBQSR {
stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def interval_command = intervals ? intervals.collect{"--interval-file $it"}.join(' ') : ""
def interval_command = intervals ? intervals.collect { "--interval-file ${it}" }.join(' ') : ""
"""
touch ${prefix}.bam
touch ${prefix}.bam.bai
Expand Down

0 comments on commit d134e78

Please sign in to comment.