mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-11-14 05:43:08 +00:00
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
This commit is contained in:
parent
f079367416
commit
9ae34a01d1
16 changed files with 291 additions and 9 deletions
|
@ -21,7 +21,7 @@ process CONTROLFREEC_ASSESSSIGNIFICANCE {
|
|||
def args = task.ext.args ?: ''
|
||||
def prefix = task.ext.prefix ?: "${meta.id}"
|
||||
"""
|
||||
cat /usr/local/bin/assess_significance.R | R --slave --args ${cnvs} ${ratio}
|
||||
cat \$(which assess_significance.R) | R --slave --args ${cnvs} ${ratio}
|
||||
|
||||
mv *.p.value.txt ${prefix}.p.value.txt
|
||||
|
||||
|
@ -30,4 +30,15 @@ process CONTROLFREEC_ASSESSSIGNIFICANCE {
|
|||
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
|
||||
"""
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ process CONTROLFREEC_FREEC {
|
|||
|
||||
output:
|
||||
tuple val(meta), path("*_ratio.BedGraph") , emit: bedgraph, optional: true
|
||||
tuple val(meta), path("*_control.cpn") , emit: control_cpn
|
||||
tuple val(meta), path("*_control.cpn") , emit: control_cpn, optional: true
|
||||
tuple val(meta), path("*_sample.cpn") , emit: sample_cpn
|
||||
tuple val(meta), path("GC_profile.*.cpn") , emit: gcprofile_cpn, optional:true
|
||||
tuple val(meta), path("*_BAF.txt") , emit: BAF
|
||||
|
@ -155,4 +155,22 @@ process CONTROLFREEC_FREEC {
|
|||
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}_ratio.BedGraph
|
||||
touch ${prefix}_sample.cpn
|
||||
touch GC_profile.${prefix}.cpn
|
||||
touch ${prefix}_BAF.txt
|
||||
touch ${prefix}_CNVs
|
||||
touch ${prefix}_info.txt
|
||||
touch ${prefix}_ratio.txt
|
||||
touch config.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
|
||||
"""
|
||||
}
|
||||
|
|
|
@ -28,4 +28,15 @@ process CONTROLFREEC_FREEC2BED {
|
|||
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}.bed
|
||||
|
||||
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
|
||||
"""
|
||||
}
|
||||
|
|
|
@ -28,4 +28,15 @@ process CONTROLFREEC_FREEC2CIRCOS {
|
|||
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}.circos.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
|
||||
"""
|
||||
}
|
||||
|
|
|
@ -25,12 +25,24 @@ process CONTROLFREEC_MAKEGRAPH {
|
|||
def prefix = task.ext.prefix ?: "${meta.id}"
|
||||
def baf = baf ?: ""
|
||||
"""
|
||||
cat /usr/local/bin/makeGraph.R | R --slave --args ${args} ${ratio} ${baf}
|
||||
cat \$(which makeGraph.R) | R --slave --args ${args} ${ratio} ${baf}
|
||||
|
||||
mv *_BAF.txt.png ${prefix}_BAF.png
|
||||
mv *_ratio.txt.log2.png ${prefix}_ratio.log2.png
|
||||
mv *_ratio.txt.png ${prefix}_ratio.png
|
||||
|
||||
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}_BAF.png
|
||||
touch ${prefix}_ratio.log2.png
|
||||
touch ${prefix}_ratio.png
|
||||
|
||||
cat <<-END_VERSIONS > versions.yml
|
||||
"${task.process}":
|
||||
|
|
|
@ -2,10 +2,10 @@ process UNTAR {
|
|||
tag "$archive"
|
||||
label 'process_low'
|
||||
|
||||
conda (params.enable_conda ? "conda-forge::tar=1.32" : null)
|
||||
conda (params.enable_conda ? "conda-forge::tar=1.34" : null)
|
||||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
||||
'https://containers.biocontainers.pro/s3/SingImgsRepo/biocontainers/v1.2.0_cv1/biocontainers_v1.2.0_cv1.img' :
|
||||
'biocontainers/biocontainers:v1.2.0_cv1' }"
|
||||
'https://containers.biocontainers.pro/s3/SingImgsRepo/biocontainers/v1.2.0_cv2/biocontainers_v1.2.0_cv2.img' :
|
||||
'biocontainers/biocontainers:v1.2.0_cv2' }"
|
||||
|
||||
input:
|
||||
tuple val(meta), path(archive)
|
||||
|
|
|
@ -40,3 +40,38 @@ workflow test_controlfreec_assesssignificance {
|
|||
sig_in = CONTROLFREEC_FREEC.out.CNV.join(CONTROLFREEC_FREEC.out.ratio)
|
||||
CONTROLFREEC_ASSESSSIGNIFICANCE ( sig_in )
|
||||
}
|
||||
|
||||
workflow test_controlfreec_assesssignificance_single {
|
||||
|
||||
input = [
|
||||
[ id:'test', single_end:false, sex:'XX' ], // meta map
|
||||
[],
|
||||
file(params.test_data['homo_sapiens']['illumina']['test2_mpileup'], checkIfExists: true),
|
||||
[],[],[],[]
|
||||
]
|
||||
|
||||
fasta = file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true)
|
||||
fai = file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true)
|
||||
|
||||
dbsnp = file(params.test_data['homo_sapiens']['genome']['dbsnp_138_hg38_21_vcf_gz'], checkIfExists: true)
|
||||
dbsnp_tbi = file(params.test_data['homo_sapiens']['genome']['dbsnp_138_hg38_21_vcf_gz_tbi'], checkIfExists: true)
|
||||
|
||||
chrfiles = [ [], file(params.test_data['homo_sapiens']['genome']['genome_21_chromosomes_dir'], checkIfExists: true) ]
|
||||
target_bed = file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true)
|
||||
|
||||
UNTAR(chrfiles)
|
||||
CONTROLFREEC_FREEC (input,
|
||||
fasta,
|
||||
fai,
|
||||
[],
|
||||
dbsnp,
|
||||
dbsnp_tbi,
|
||||
UNTAR.out.untar.map{ it[1] },
|
||||
[],
|
||||
target_bed,
|
||||
[]
|
||||
)
|
||||
|
||||
sig_in = CONTROLFREEC_FREEC.out.CNV.join(CONTROLFREEC_FREEC.out.ratio)
|
||||
CONTROLFREEC_ASSESSSIGNIFICANCE ( sig_in )
|
||||
}
|
||||
|
|
|
@ -7,4 +7,12 @@
|
|||
- path: output/controlfreec/test.p.value.txt
|
||||
md5sum: 44e23b916535fbc1a3f47b57fad292df
|
||||
- path: output/controlfreec/versions.yml
|
||||
md5sum: 0aa42fed10d61e4570fe1e0e83ffe932
|
||||
|
||||
- name: controlfreec assesssignificance test_controlfreec_assesssignificance_single
|
||||
command: nextflow run tests/modules/controlfreec/assesssignificance -entry test_controlfreec_assesssignificance_single -c tests/config/nextflow.config -stub-run
|
||||
tags:
|
||||
- controlfreec/assesssignificance
|
||||
- controlfreec
|
||||
files:
|
||||
- path: output/controlfreec/test.p.value.txt
|
||||
- path: output/controlfreec/versions.yml
|
||||
|
|
|
@ -36,3 +36,36 @@ workflow test_controlfreec_freec {
|
|||
[]
|
||||
)
|
||||
}
|
||||
|
||||
workflow test_controlfreec_freec_single {
|
||||
|
||||
input = [
|
||||
[ id:'test2', single_end:false, sex:'XX' ], // meta map
|
||||
[],
|
||||
file(params.test_data['homo_sapiens']['illumina']['test2_mpileup'], checkIfExists: true),
|
||||
[],[],[],[]
|
||||
]
|
||||
|
||||
fasta = file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true)
|
||||
fai = file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true)
|
||||
|
||||
dbsnp = file(params.test_data['homo_sapiens']['genome']['dbsnp_138_hg38_21_vcf_gz'], checkIfExists: true)
|
||||
dbsnp_tbi = file(params.test_data['homo_sapiens']['genome']['dbsnp_138_hg38_21_vcf_gz_tbi'], checkIfExists: true)
|
||||
|
||||
chrfiles = [ [], file(params.test_data['homo_sapiens']['genome']['genome_21_chromosomes_dir'], checkIfExists: true) ]
|
||||
target_bed = file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true)
|
||||
|
||||
UNTAR(chrfiles)
|
||||
CONTROLFREEC_FREEC (input,
|
||||
fasta,
|
||||
fai,
|
||||
[],
|
||||
dbsnp,
|
||||
dbsnp_tbi,
|
||||
UNTAR.out.untar.map{ it[1] },
|
||||
[],
|
||||
target_bed,
|
||||
[]
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -20,4 +20,18 @@
|
|||
- path: output/controlfreec/test2.mpileup.gz_sample.cpn
|
||||
md5sum: c80dad58a77b1d7ba6d273999f4b4b4b
|
||||
- path: output/controlfreec/versions.yml
|
||||
md5sum: 3ab250a2ab3be22628124c7c65324651
|
||||
|
||||
- name: controlfreec test_controlfreec_freec_single
|
||||
command: nextflow run tests/modules/controlfreec/freec -entry test_controlfreec_freec_single -c tests/config/nextflow.config -stub-run
|
||||
tags:
|
||||
- controlfreec
|
||||
- controlfreec/freec
|
||||
files:
|
||||
- path: output/controlfreec/config.txt
|
||||
- path: output/controlfreec/test2_BAF.txt
|
||||
- path: output/controlfreec/test2_CNVs
|
||||
- path: output/controlfreec/test2_info.txt
|
||||
- path: output/controlfreec/test2_ratio.BedGraph
|
||||
- path: output/controlfreec/test2_ratio.txt
|
||||
- path: output/controlfreec/test2_sample.cpn
|
||||
- path: output/controlfreec/versions.yml
|
||||
|
|
|
@ -8,7 +8,7 @@ include { UNTAR } from '../../../../modules/untar/main.nf'
|
|||
|
||||
workflow test_controlfreec_freec2bed {
|
||||
|
||||
input = [
|
||||
input = [
|
||||
[ id:'test', single_end:false, sex:'XX' ], // meta map
|
||||
file(params.test_data['homo_sapiens']['illumina']['test_mpileup'], checkIfExists: true),
|
||||
file(params.test_data['homo_sapiens']['illumina']['test2_mpileup'], checkIfExists: true),
|
||||
|
@ -39,3 +39,37 @@ workflow test_controlfreec_freec2bed {
|
|||
|
||||
CONTROLFREEC_FREEC2BED ( CONTROLFREEC_FREEC.out.ratio )
|
||||
}
|
||||
|
||||
workflow test_controlfreec_freec2bed_single {
|
||||
|
||||
input = [
|
||||
[ id:'test', single_end:false, sex:'XX' ], // meta map
|
||||
[],
|
||||
file(params.test_data['homo_sapiens']['illumina']['test2_mpileup'], checkIfExists: true),
|
||||
[],[],[],[]
|
||||
]
|
||||
|
||||
fasta = file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true)
|
||||
fai = file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true)
|
||||
|
||||
dbsnp = file(params.test_data['homo_sapiens']['genome']['dbsnp_138_hg38_21_vcf_gz'], checkIfExists: true)
|
||||
dbsnp_tbi = file(params.test_data['homo_sapiens']['genome']['dbsnp_138_hg38_21_vcf_gz_tbi'], checkIfExists: true)
|
||||
|
||||
chrfiles = [ [], file(params.test_data['homo_sapiens']['genome']['genome_21_chromosomes_dir'], checkIfExists: true) ]
|
||||
target_bed = file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true)
|
||||
|
||||
UNTAR(chrfiles)
|
||||
CONTROLFREEC_FREEC (input,
|
||||
fasta,
|
||||
fai,
|
||||
[],
|
||||
dbsnp,
|
||||
dbsnp_tbi,
|
||||
UNTAR.out.untar.map{ it[1] },
|
||||
[],
|
||||
target_bed,
|
||||
[]
|
||||
)
|
||||
|
||||
CONTROLFREEC_FREEC2BED ( CONTROLFREEC_FREEC.out.ratio )
|
||||
}
|
||||
|
|
|
@ -6,3 +6,11 @@
|
|||
files:
|
||||
- path: output/controlfreec/test.bed
|
||||
md5sum: abe10b7ce94ba903503e697394c17297
|
||||
|
||||
- name: controlfreec freec2bed test_controlfreec_freec2bed_single
|
||||
command: nextflow run tests/modules/controlfreec/freec2bed -entry test_controlfreec_freec2bed_single -c tests/config/nextflow.config -stub-run
|
||||
tags:
|
||||
- controlfreec/freec2bed
|
||||
- controlfreec
|
||||
files:
|
||||
- path: output/controlfreec/test.bed
|
||||
|
|
|
@ -39,3 +39,37 @@ workflow test_controlfreec_freec2circos {
|
|||
|
||||
CONTROLFREEC_FREEC2CIRCOS ( CONTROLFREEC_FREEC.out.ratio )
|
||||
}
|
||||
|
||||
workflow test_controlfreec_freec2circos_single {
|
||||
|
||||
input = [
|
||||
[ id:'test', single_end:false, sex:'XX' ], // meta map
|
||||
[],
|
||||
file(params.test_data['homo_sapiens']['illumina']['test2_mpileup'], checkIfExists: true),
|
||||
[],[],[],[]
|
||||
]
|
||||
|
||||
fasta = file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true)
|
||||
fai = file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true)
|
||||
|
||||
dbsnp = file(params.test_data['homo_sapiens']['genome']['dbsnp_138_hg38_21_vcf_gz'], checkIfExists: true)
|
||||
dbsnp_tbi = file(params.test_data['homo_sapiens']['genome']['dbsnp_138_hg38_21_vcf_gz_tbi'], checkIfExists: true)
|
||||
|
||||
chrfiles = [ [], file(params.test_data['homo_sapiens']['genome']['genome_21_chromosomes_dir'], checkIfExists: true) ]
|
||||
target_bed = file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true)
|
||||
|
||||
UNTAR(chrfiles)
|
||||
CONTROLFREEC_FREEC (input,
|
||||
fasta,
|
||||
fai,
|
||||
[],
|
||||
dbsnp,
|
||||
dbsnp_tbi,
|
||||
UNTAR.out.untar.map{ it[1] },
|
||||
[],
|
||||
target_bed,
|
||||
[]
|
||||
)
|
||||
|
||||
CONTROLFREEC_FREEC2CIRCOS ( CONTROLFREEC_FREEC.out.ratio )
|
||||
}
|
||||
|
|
|
@ -6,3 +6,11 @@
|
|||
files:
|
||||
- path: output/controlfreec/test.circos.txt
|
||||
md5sum: 19cf35f2c36b46f717dc8342b8a5a645
|
||||
|
||||
- name: controlfreec freec2circos test_controlfreec_freec2circos_single
|
||||
command: nextflow run tests/modules/controlfreec/freec2circos -entry test_controlfreec_freec2circos_single -c tests/config/nextflow.config -stub-run
|
||||
tags:
|
||||
- controlfreec
|
||||
- controlfreec/freec2circos
|
||||
files:
|
||||
- path: output/controlfreec/test.circos.txt
|
||||
|
|
|
@ -40,3 +40,38 @@ workflow test_controlfreec_makegraph {
|
|||
makegraph_in = CONTROLFREEC_FREEC.out.ratio.join(CONTROLFREEC_FREEC.out.BAF)
|
||||
CONTROLFREEC_MAKEGRAPH ( makegraph_in )
|
||||
}
|
||||
|
||||
workflow test_controlfreec_makegraph_single {
|
||||
|
||||
input = [
|
||||
[ id:'test', single_end:false, sex:'XX' ], // meta map
|
||||
[],
|
||||
file(params.test_data['homo_sapiens']['illumina']['test2_mpileup'], checkIfExists: true),
|
||||
[],[],[],[]
|
||||
]
|
||||
|
||||
fasta = file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true)
|
||||
fai = file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true)
|
||||
|
||||
dbsnp = file(params.test_data['homo_sapiens']['genome']['dbsnp_138_hg38_21_vcf_gz'], checkIfExists: true)
|
||||
dbsnp_tbi = file(params.test_data['homo_sapiens']['genome']['dbsnp_138_hg38_21_vcf_gz_tbi'], checkIfExists: true)
|
||||
|
||||
chrfiles = [ [], file(params.test_data['homo_sapiens']['genome']['genome_21_chromosomes_dir'], checkIfExists: true) ]
|
||||
target_bed = file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true)
|
||||
|
||||
UNTAR(chrfiles)
|
||||
CONTROLFREEC_FREEC (input,
|
||||
fasta,
|
||||
fai,
|
||||
[],
|
||||
dbsnp,
|
||||
dbsnp_tbi,
|
||||
UNTAR.out.untar.map{ it[1] },
|
||||
[],
|
||||
target_bed,
|
||||
[]
|
||||
)
|
||||
|
||||
makegraph_in = CONTROLFREEC_FREEC.out.ratio.join(CONTROLFREEC_FREEC.out.BAF)
|
||||
CONTROLFREEC_MAKEGRAPH ( makegraph_in )
|
||||
}
|
||||
|
|
|
@ -10,3 +10,13 @@
|
|||
md5sum: b3c7916b1b4951a0cc3da20d8e9e0262
|
||||
- path: output/controlfreec/test_ratio.png
|
||||
md5sum: 1435b29536b3b1555b4c423f8f4fb000
|
||||
|
||||
- name: controlfreec makegraph test_controlfreec_makegraph_single
|
||||
command: nextflow run tests/modules/controlfreec/makegraph -entry test_controlfreec_makegraph_single -c tests/config/nextflow.config -stub-run
|
||||
tags:
|
||||
- controlfreec
|
||||
- controlfreec/makegraph
|
||||
files:
|
||||
- path: output/controlfreec/test_BAF.png
|
||||
- path: output/controlfreec/test_ratio.log2.png
|
||||
- path: output/controlfreec/test_ratio.png
|
||||
|
|
Loading…
Reference in a new issue