controlfreec significance (#1451)

* controlfreec significance

* move freec files to own subfolder

* Fix meta.yml naming

* Fix meta.yml naming

* Fix linting

* Forgot to refactor

* forgot more refactoring

* Too much refactoring on output paths

* Too little refactoring here

* update checksum
This commit is contained in:
FriederikeHanssen 2022-03-25 18:22:17 +01:00 committed by GitHub
parent 27936729f2
commit 4efa8da5c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 187 additions and 23 deletions

View file

@ -0,0 +1,30 @@
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: bam
path "versions.yml" , emit: versions
when:
task.ext.when == null || task.ext.when
script:
def args = task.ext.args ?: ''
"""
cat /usr/local/bin/assess_significance.R | R --slave --args ${cnvs} ${ratio}
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
"""
}

View file

@ -0,0 +1,50 @@
name: controlfreec_assesssignificance
description: Add both Wilcoxon test and Kolmogorov-Smirnov test p-values to each CNV output of FREEC
keywords:
- cna
- cnv
- somatic
- single
- tumor-only
tools:
- controlfreec/assesssignificance:
description: Copy number and genotype annotation from whole genome and whole exome sequencing data.
homepage: http://boevalab.inf.ethz.ch/FREEC
documentation: http://boevalab.inf.ethz.ch/FREEC/tutorial.html
tool_dev_url: https://github.com/BoevaLab/FREEC/
doi: "10.1093/bioinformatics/btq635"
licence: ["GPL >=2"]
input:
# Only when we have meta
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- cnvs:
type: file
description: _CNVs file generated by FREEC
pattern: "*._CNVs"
- ratio:
type: file
description: ratio file generated by FREEC
pattern: "*.ratio.txt"
output:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
- p_value_txt:
type: file
description: CNV file containing p_values for each call
pattern: "*.p.value.txt"
authors:
- "@FriederikeHanssen"

View file

@ -1,4 +1,4 @@
process CONTROLFREEC { process CONTROLFREEC_FREEC {
tag "$meta.id" tag "$meta.id"
label 'process_low' label 'process_low'

View file

@ -1,4 +1,4 @@
name: controlfreec name: controlfreec_freec
description: Copy number and genotype annotation from whole genome and whole exome sequencing data description: Copy number and genotype annotation from whole genome and whole exome sequencing data
keywords: keywords:
- cna - cna
@ -7,7 +7,7 @@ keywords:
- single - single
- tumor-only - tumor-only
tools: tools:
- controlfreec: - controlfreec/freec:
description: Copy number and genotype annotation from whole genome and whole exome sequencing data. description: Copy number and genotype annotation from whole genome and whole exome sequencing data.
homepage: http://boevalab.inf.ethz.ch/FREEC homepage: http://boevalab.inf.ethz.ch/FREEC
documentation: http://boevalab.inf.ethz.ch/FREEC/tutorial.html documentation: http://boevalab.inf.ethz.ch/FREEC/tutorial.html

View file

@ -419,9 +419,13 @@ cnvkit/batch:
- modules/cnvkit/batch/** - modules/cnvkit/batch/**
- tests/modules/cnvkit/batch/** - tests/modules/cnvkit/batch/**
controlfreec: controlfreec/assesssignificance:
- modules/controlfreec/** - modules/controlfreec/assesssignificance/**
- tests/modules/controlfreec/** - tests/modules/controlfreec/assesssignificance/**
controlfreec/freec:
- modules/controlfreec/freec/**
- tests/modules/controlfreec/freec/**
cooler/cload: cooler/cload:
- modules/cooler/cload/** - modules/cooler/cload/**

View file

@ -0,0 +1,42 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { CONTROLFREEC_ASSESSSIGNIFICANCE } from '../../../../modules/controlfreec/assesssignificance/main.nf'
include { CONTROLFREEC_FREEC } from '../../../../modules/controlfreec/freec/main.nf'
include { UNTAR } from '../../../../modules/untar/main.nf'
workflow test_controlfreec_assesssignificance {
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),
[],[],[],[]
]
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 )
}

View file

@ -2,7 +2,7 @@ process {
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
withName:CONTROLFREEC{ withName:CONTROLFREEC_FREEC{
ext.args = { [ ext.args = { [
"sample":[ "sample":[
inputformat: 'pileup', inputformat: 'pileup',

View file

@ -0,0 +1,10 @@
- name: controlfreec assesssignificance test_controlfreec_assesssignificance
command: nextflow run tests/modules/controlfreec/assesssignificance -entry test_controlfreec_assesssignificance -c tests/config/nextflow.config
tags:
- controlfreec/assesssignificance
- controlfreec
files:
- path: output/controlfreec/test2.mpileup.gz_CNVs.p.value.txt
md5sum: 44e23b916535fbc1a3f47b57fad292df
- path: output/controlfreec/versions.yml
md5sum: 0aa42fed10d61e4570fe1e0e83ffe932

View file

@ -2,9 +2,10 @@
nextflow.enable.dsl = 2 nextflow.enable.dsl = 2
include { CONTROLFREEC } from '../../../modules/controlfreec/main.nf' include { CONTROLFREEC_FREEC } from '../../../../modules/controlfreec/freec/main.nf'
include { UNTAR } from '../../../modules/untar/main.nf' include { UNTAR } from '../../../../modules/untar/main.nf'
workflow test_controlfreec {
workflow test_controlfreec_freec {
input = [ input = [
[ id:'test', single_end:false, sex:'XX' ], // meta map [ id:'test', single_end:false, sex:'XX' ], // meta map
@ -23,15 +24,15 @@ workflow test_controlfreec {
target_bed = file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) target_bed = file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true)
UNTAR(chrfiles) UNTAR(chrfiles)
CONTROLFREEC ( input, CONTROLFREEC_FREEC (input,
fasta, fasta,
fai, fai,
[], [],
dbsnp, dbsnp,
dbsnp_tbi, dbsnp_tbi,
UNTAR.out.untar.map{ it[1] }, UNTAR.out.untar.map{ it[1] },
[], [],
target_bed, target_bed,
[] []
) )
} }

View file

@ -0,0 +1,26 @@
process {
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
withName:CONTROLFREEC_FREEC{
ext.args = { [
"sample":[
inputformat: 'pileup',
mateorientation: 'FR'
],
"general" :[
bedgraphoutput: "TRUE",
noisydata: "TRUE",
minexpectedgc: "0",
readcountthreshold: "1",
sex: meta.sex,
window: "10",
],
"control":[
inputformat: "pileup",
mateorientation: "FR"
]
]
}
}
}

View file

@ -1,7 +1,8 @@
- name: controlfreec test_controlfreec - name: controlfreec test_controlfreec_freec
command: nextflow run tests/modules/controlfreec -entry test_controlfreec -c tests/config/nextflow.config command: nextflow run tests/modules/controlfreec/freec -entry test_controlfreec_freec -c tests/config/nextflow.config
tags: tags:
- controlfreec - controlfreec
- controlfreec/freec
files: files:
- path: output/controlfreec/config.txt - path: output/controlfreec/config.txt
- path: output/controlfreec/test.mpileup.gz_control.cpn - path: output/controlfreec/test.mpileup.gz_control.cpn
@ -19,4 +20,4 @@
- path: output/controlfreec/test2.mpileup.gz_sample.cpn - path: output/controlfreec/test2.mpileup.gz_sample.cpn
md5sum: c80dad58a77b1d7ba6d273999f4b4b4b md5sum: c80dad58a77b1d7ba6d273999f4b4b4b
- path: output/controlfreec/versions.yml - path: output/controlfreec/versions.yml
md5sum: ff93f6466d4686aab708425782c6c848 md5sum: 3ab250a2ab3be22628124c7c65324651