nf-core_modules/modules/msisensor2/msi/main.nf
Adam Talbot e7845e2472
1976 msisensor2 (#1977)
* msisensor2: Add msisensor2 module

* msisensor2/scan module added

* msisensor2 tests added

Changes:
 - tests added for msisensor2 from the msisensor2 github repo. No
 available tests from NF-Core test repo.

Relates to #1976

* msisensor2 slight bump in stuff

* msisensor2: Replaced spelling of 'tumour' with 'tumor'

* msisensor2: fix linting, testing and containers

Relates to #1976

Co-authored-by: Maxime U. Garcia <max.u.garcia@gmail.com>
2022-09-05 13:00:18 +02:00

48 lines
1.7 KiB
Text

process MSISENSOR2_MSI {
tag "$meta.id"
label 'process_medium'
conda (params.enable_conda ? "bioconda::msisensor2=0.1" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/msisensor2:0.1--hd03093a_0':
'quay.io/biocontainers/msisensor2:0.1--hd03093a_0' }"
input:
tuple val(meta), path(tumor_bam), path(tumor_bam_index), path(normal_bam), path(normal_bam_index), path(intervals)
path scan
path(models, stageAs: "models/*")
output:
tuple val(meta), path("${prefix}") , emit: msi
tuple val(meta), path("${prefix}_dis") , emit: distribution
tuple val(meta), path("${prefix}_somatic"), emit: somatic
path "versions.yml" , emit: versions
when:
task.ext.when == null || task.ext.when
script:
def args = task.ext.args ?: ''
prefix = task.ext.prefix ?: "${meta.id}"
def scan_cmd = scan ? "-d $scan" : ""
def model_cmd = models ? "-M models/" : ""
def tumor_bam_cmd = tumor_bam ? "-t $tumor_bam" : ""
def normal_bam_cmd = normal_bam ? "-n $normal_bam" : ""
def interval_command = intervals ? "-e $intervals" : ""
"""
msisensor2 msi \\
-b ${task.cpus} \\
$args \\
$model_cmd \\
$scan_cmd \\
$interval_command \\
$tumor_bam_cmd \\
$normal_bam_cmd \\
-o $prefix
cat <<-END_VERSIONS > versions.yml
"${task.process}":
msisensor2: \$(echo \$(msisensor2 2> >(grep Version) | sed 's/Version: v//g'))
END_VERSIONS
"""
}