nf-core_modules/modules/controlfreec/assesssignificance/main.nf
FriederikeHanssen 9ae34a01d1
Fix Controlfreec: Add stub runs to test single sample input & make conda work with R scripts (#1504)
* Fix typo

* Add stub runs for testing input without matched normals

* Add missing -stub-run

* remove empty file checksum tests and change workflow names

* test controlfreec naming

* fix output file names

* fix output file names

* fix output file names

* fix conda and container path difference for R scripts

* update tar version to work with conda

* fix version number in docker

* try to fix path to script, pretty sure it won't work

* try new ways to set path with wildcard

* try which

* add which but with escape

* remove comment
2022-04-08 11:43:40 +02:00

44 lines
1.4 KiB
Text

process CONTROLFREEC_ASSESSSIGNIFICANCE {
tag "$meta.id"
label 'process_low'
conda (params.enable_conda ? "bioconda::control-freec=11.6" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/control-freec:11.6--h1b792b2_1':
'quay.io/biocontainers/control-freec:11.6--h1b792b2_1' }"
input:
tuple val(meta), path(cnvs), path(ratio)
output:
tuple val(meta), path("*.p.value.txt"), emit: p_value_txt
path "versions.yml" , emit: versions
when:
task.ext.when == null || task.ext.when
script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
cat \$(which assess_significance.R) | R --slave --args ${cnvs} ${ratio}
mv *.p.value.txt ${prefix}.p.value.txt
cat <<-END_VERSIONS > versions.yml
"${task.process}":
controlfreec: \$(echo \$(freec -version 2>&1) | sed 's/^.*Control-FREEC //; s/:.*\$//' | sed -e "s/Control-FREEC v//g" )
END_VERSIONS
"""
stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.p.value.txt
cat <<-END_VERSIONS > versions.yml
"${task.process}":
controlfreec: \$(echo \$(freec -version 2>&1) | sed 's/^.*Control-FREEC //; s/:.*\$//' | sed -e "s/Control-FREEC v//g" )
END_VERSIONS
"""
}