mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-12-22 11:08:17 +00:00
New module: ichorCNA (#1182)
* hmmcopy/mapCounter * update test * Remove bam tag * Remove /tmp/ path from test.yml * Update modules/hmmcopy/mapcounter/meta.yml Incorporate formatting changes Co-authored-by: James A. Fellows Yates <jfy133@gmail.com> * Update modules/hmmcopy/mapcounter/meta.yml Co-authored-by: James A. Fellows Yates <jfy133@gmail.com> * Update tests/modules/hmmcopy/mapcounter/main.nf Co-authored-by: James A. Fellows Yates <jfy133@gmail.com> * ichorCNA run * Add panel of normals code * Try and fix tests * Edit string detection in tests * Fix linting issues * Just failing END_VERSIONS * Fixed versions.yml * Added DOI * Optional name for file * Add when command * Updated when * Update modules/ichorcna/createpon/main.nf Co-authored-by: Simon Pearce <simon.pearce@cruk.manchester.ac.uk> Co-authored-by: James A. Fellows Yates <jfy133@gmail.com> Co-authored-by: FriederikeHanssen <Friederike.hanssen@qbic.uni-tuebingen.de>
This commit is contained in:
parent
fafae11068
commit
78e2e76b24
11 changed files with 361 additions and 0 deletions
48
modules/ichorcna/createpon/main.nf
Normal file
48
modules/ichorcna/createpon/main.nf
Normal file
|
@ -0,0 +1,48 @@
|
|||
def VERSION = '0.3.2' // Version information not provided by tool on CLI
|
||||
|
||||
process ICHORCNA_CREATEPON {
|
||||
label 'process_low'
|
||||
|
||||
conda (params.enable_conda ? "bioconda::r-ichorcna=0.3.2" : null)
|
||||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
||||
'https://depot.galaxyproject.org/singularity/r-ichorcna:0.3.2--r41hdfd78af_0' :
|
||||
'quay.io/biocontainers/r-ichorcna:0.3.2--r41hdfd78af_0' }"
|
||||
|
||||
input:
|
||||
path wigs
|
||||
path gc_wig
|
||||
path map_wig
|
||||
path centromere
|
||||
|
||||
output:
|
||||
path "*.rds" , emit: rds
|
||||
path "*.txt" , emit: txt
|
||||
path "versions.yml" , emit: versions
|
||||
|
||||
when:
|
||||
task.ext.when == null || task.ext.when
|
||||
|
||||
script:
|
||||
def args = task.ext.args ?: ''
|
||||
def centro = centromere ? "--centromere ${centromere}" : ''
|
||||
def prefix = task.ext.prefix ?: "PoN"
|
||||
|
||||
"""
|
||||
echo ${wigs} | tr " " "\\n" > wig_files.txt
|
||||
|
||||
createPanelOfNormals.R \\
|
||||
--filelist wig_files.txt \\
|
||||
--gcWig ${gc_wig} \\
|
||||
--mapWig ${map_wig} \\
|
||||
${centro} \\
|
||||
${args} \\
|
||||
--outfile ${prefix}
|
||||
|
||||
rm wig_files.txt
|
||||
|
||||
cat <<-END_VERSIONS > versions.yml
|
||||
"${task.process}":
|
||||
ichorcna: $VERSION
|
||||
END_VERSIONS
|
||||
"""
|
||||
}
|
57
modules/ichorcna/createpon/meta.yml
Normal file
57
modules/ichorcna/createpon/meta.yml
Normal file
|
@ -0,0 +1,57 @@
|
|||
name: ichorcna_createpon
|
||||
description: ichorCNA is an R package for calculating copy number alteration from (low-pass) whole genome sequencing, particularly for use in cell-free DNA. This module generates a panel of normals
|
||||
keywords:
|
||||
- ichorcna
|
||||
- cnv
|
||||
- cna
|
||||
- cfDNA
|
||||
- wgs
|
||||
- panel_of_normals
|
||||
tools:
|
||||
- ichorcna:
|
||||
description: Estimating tumor fraction in cell-free DNA from ultra-low-pass whole genome sequencing.
|
||||
homepage: https://github.com/broadinstitute/ichorCNA
|
||||
documentation: https://github.com/broadinstitute/ichorCNA/wiki
|
||||
tool_dev_url: https://github.com/broadinstitute/ichorCNA
|
||||
doi: "10.1038/s41467-017-00965-y"
|
||||
licence: ['GPL v3']
|
||||
|
||||
input:
|
||||
- wigs:
|
||||
type: file
|
||||
description: Any number of hmmcopy/readCounter processed .wig files giving the number of reads in the sample, in each genomic window. These will be averaged over to generate the panel of normals.
|
||||
pattern: "*.{wig}"
|
||||
|
||||
- gc_wig:
|
||||
type: file
|
||||
description: hmmcopy/gcCounter processed .wig file giving the gc content in the reference fasta, in each genomic window
|
||||
pattern: "*.{wig}"
|
||||
|
||||
- map_wig:
|
||||
type: file
|
||||
description: hmmcopy/mapCounter processed .wig file giving the mapability in the reference fasta, in each genomic window
|
||||
pattern: "*.{wig}"
|
||||
|
||||
- centromere:
|
||||
type: file
|
||||
description: Text file giving centromere locations of each genome, to exclude these windows
|
||||
pattern: "*.{txt}"
|
||||
|
||||
output:
|
||||
- versions:
|
||||
type: file
|
||||
description: File containing software versions
|
||||
pattern: "versions.yml"
|
||||
|
||||
- rds:
|
||||
type: file
|
||||
description: R data file (.rds) containing panel of normals data, medians of each bin.
|
||||
pattern: "*.rds"
|
||||
|
||||
- txt:
|
||||
type: file
|
||||
description: Text file containing panel of normals data, medians of each bin.
|
||||
pattern: "*.txt"
|
||||
|
||||
authors:
|
||||
- "@sppearce"
|
50
modules/ichorcna/run/main.nf
Normal file
50
modules/ichorcna/run/main.nf
Normal file
|
@ -0,0 +1,50 @@
|
|||
def VERSION = '0.3.2' // Version information not provided by tool on CLI
|
||||
|
||||
process ICHORCNA_RUN {
|
||||
tag "$meta.id"
|
||||
label 'process_low'
|
||||
|
||||
conda (params.enable_conda ? "bioconda::r-ichorcna=0.3.2" : null)
|
||||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
||||
'https://depot.galaxyproject.org/singularity/r-ichorcna:0.3.2--r41hdfd78af_0' :
|
||||
'quay.io/biocontainers/r-ichorcna:0.3.2--r41hdfd78af_0' }"
|
||||
|
||||
input:
|
||||
tuple val(meta), path(wig)
|
||||
path gc_wig
|
||||
path map_wig
|
||||
path panel_of_normals
|
||||
path centromere
|
||||
|
||||
output:
|
||||
tuple val(meta), path("*.cna.seg") , emit: cna_seg
|
||||
tuple val(meta), path("*.params.txt") , emit: ichorcna_params
|
||||
path "**/*genomeWide.pdf" , emit: genome_plot
|
||||
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}"
|
||||
def pon = panel_of_normals ? "--normalPanel ${panel_of_normals}" : ''
|
||||
def centro = centromere ? "--centromere ${centromere}" : ''
|
||||
|
||||
"""
|
||||
runIchorCNA.R --id ${prefix} \\
|
||||
$args \\
|
||||
--WIG ${wig} \\
|
||||
--id ${meta.id} \\
|
||||
--gcWig ${gc_wig} \\
|
||||
--mapWig ${map_wig} \\
|
||||
${pon} \\
|
||||
${centro} \\
|
||||
--outDir .
|
||||
|
||||
cat <<-END_VERSIONS > versions.yml
|
||||
"${task.process}":
|
||||
ichorcna: $VERSION
|
||||
END_VERSIONS
|
||||
"""
|
||||
}
|
72
modules/ichorcna/run/meta.yml
Normal file
72
modules/ichorcna/run/meta.yml
Normal file
|
@ -0,0 +1,72 @@
|
|||
name: ichorcna_run
|
||||
description: ichorCNA is an R package for calculating copy number alteration from (low-pass) whole genome sequencing, particularly for use in cell-free DNA
|
||||
keywords:
|
||||
- ichorcna
|
||||
- cnv
|
||||
- cna
|
||||
- cfDNA
|
||||
- wgs
|
||||
tools:
|
||||
- ichorcna:
|
||||
description: Estimating tumor fraction in cell-free DNA from ultra-low-pass whole genome sequencing.
|
||||
homepage: https://github.com/broadinstitute/ichorCNA
|
||||
documentation: https://github.com/broadinstitute/ichorCNA/wiki
|
||||
tool_dev_url: https://github.com/broadinstitute/ichorCNA
|
||||
doi: "10.1038/s41467-017-00965-y"
|
||||
licence: ['GPL v3']
|
||||
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
description: |
|
||||
Groovy Map containing sample information
|
||||
e.g. [ id:'test']
|
||||
- wig:
|
||||
type: file
|
||||
description: hmmcopy/readCounter processed .wig file giving the number of reads in the sample, in each genomic window
|
||||
pattern: "*.{wig}"
|
||||
|
||||
- gc_wig:
|
||||
type: file
|
||||
description: hmmcopy/gcCounter processed .wig file giving the gc content in the reference fasta, in each genomic window
|
||||
pattern: "*.{wig}"
|
||||
|
||||
- map_wig:
|
||||
type: file
|
||||
description: hmmcopy/mapCounter processed .wig file giving the mapability in the reference fasta, in each genomic window
|
||||
pattern: "*.{wig}"
|
||||
|
||||
- panel_of_normals:
|
||||
type: file
|
||||
description: Panel of normals data, generated by calling ichorCNA on a set of normal samples with the same window size etc.
|
||||
pattern: "*.{rds}"
|
||||
|
||||
- centromere:
|
||||
type: file
|
||||
description: Text file giving centromere locations of each genome, to exclude these windows
|
||||
pattern: "*.{txt}"
|
||||
|
||||
output:
|
||||
- meta:
|
||||
type: map
|
||||
description: |
|
||||
Groovy Map containing sample information
|
||||
e.g. [ id:'test']
|
||||
- versions:
|
||||
type: file
|
||||
description: File containing software versions
|
||||
pattern: "versions.yml"
|
||||
- cna_seg:
|
||||
type: file
|
||||
description: Predicted copy number variation per segment
|
||||
pattern: "*.{cng.seg}"
|
||||
- ichorcna_params:
|
||||
type: file
|
||||
description: A text file showing the values that ichorCNA has estimated for tumour fraction, ploidy etc
|
||||
pattern: "*.{params.txt}"
|
||||
- genome_plot:
|
||||
type: file
|
||||
description: A plot with the best-fit genome-wide CNV data
|
||||
pattern: "*.{genomeWide.pdf}"
|
||||
authors:
|
||||
- "@sppearce"
|
|
@ -755,6 +755,14 @@ homer/makeucscfile:
|
|||
- modules/homer/makeucscfile/**
|
||||
- tests/modules/homer/makeucscfile/**
|
||||
|
||||
ichorcna/createpon:
|
||||
- modules/ichorcna/createpon/**
|
||||
- tests/modules/ichorcna/createpon/**
|
||||
|
||||
ichorcna/run:
|
||||
- modules/ichorcna/run/**
|
||||
- tests/modules/ichorcna/run/**
|
||||
|
||||
idr:
|
||||
- modules/idr/**
|
||||
- tests/modules/idr/**
|
||||
|
|
30
tests/modules/ichorcna/createpon/main.nf
Normal file
30
tests/modules/ichorcna/createpon/main.nf
Normal file
|
@ -0,0 +1,30 @@
|
|||
#!/usr/bin/env nextflow
|
||||
|
||||
nextflow.enable.dsl = 2
|
||||
|
||||
include { ICHORCNA_CREATEPON } from '../../../../modules/ichorcna/createpon/main.nf'
|
||||
|
||||
workflow test_ichorcna_createpon {
|
||||
|
||||
input = file("https://raw.githubusercontent.com/broadinstitute/ichorCNA/master/inst/extdata/MBC_315.ctDNA.reads.wig", checkIfExists: true)
|
||||
|
||||
gcwig = file("https://raw.githubusercontent.com/broadinstitute/ichorCNA/master/inst/extdata/gc_hg19_1000kb.wig", checkIfExists: true)
|
||||
mapwig = file("https://raw.githubusercontent.com/broadinstitute/ichorCNA/master/inst/extdata/map_hg19_1000kb.wig", checkIfExists: true)
|
||||
|
||||
centromere = file("https://raw.githubusercontent.com/broadinstitute/ichorCNA/master/inst/extdata/GRCh37.p13_centromere_UCSC-gapTable.txt", checkIfExists: true)
|
||||
|
||||
ICHORCNA_CREATEPON ( input, gcwig, mapwig, centromere )
|
||||
}
|
||||
|
||||
workflow test_ichorcna_createpon2 {
|
||||
|
||||
input = [file("https://raw.githubusercontent.com/broadinstitute/ichorCNA/master/inst/extdata/MBC_315.ctDNA.reads.wig", checkIfExists: true),
|
||||
file("https://raw.githubusercontent.com/broadinstitute/ichorCNA/master/inst/extdata/MBC_315_T2.ctDNA.reads.wig", checkIfExists: true)]
|
||||
|
||||
gcwig = file("https://raw.githubusercontent.com/broadinstitute/ichorCNA/master/inst/extdata/gc_hg19_1000kb.wig", checkIfExists: true)
|
||||
mapwig = file("https://raw.githubusercontent.com/broadinstitute/ichorCNA/master/inst/extdata/map_hg19_1000kb.wig", checkIfExists: true)
|
||||
|
||||
centromere = file("https://raw.githubusercontent.com/broadinstitute/ichorCNA/master/inst/extdata/GRCh37.p13_centromere_UCSC-gapTable.txt", checkIfExists: true)
|
||||
|
||||
ICHORCNA_CREATEPON ( input, gcwig, mapwig, centromere )
|
||||
}
|
5
tests/modules/ichorcna/createpon/nextflow.config
Normal file
5
tests/modules/ichorcna/createpon/nextflow.config
Normal file
|
@ -0,0 +1,5 @@
|
|||
process {
|
||||
|
||||
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
|
||||
|
||||
}
|
21
tests/modules/ichorcna/createpon/test.yml
Normal file
21
tests/modules/ichorcna/createpon/test.yml
Normal file
|
@ -0,0 +1,21 @@
|
|||
- name: ichorcna createpon test_ichorcna_createpon
|
||||
command: nextflow run tests/modules/ichorcna/createpon -entry test_ichorcna_createpon -c tests/config/nextflow.config
|
||||
tags:
|
||||
- ichorcna/createpon
|
||||
- ichorcna
|
||||
files:
|
||||
- path: output/ichorcna/PoN_median.txt
|
||||
contains: ['seqnames']
|
||||
- path: output/ichorcna/versions.yml
|
||||
md5sum: 59a2121301113cc013bfae65935e07f1
|
||||
|
||||
- name: ichorcna createpon test_ichorcna_createpon2
|
||||
command: nextflow run tests/modules/ichorcna/createpon -entry test_ichorcna_createpon2 -c tests/config/nextflow.config
|
||||
tags:
|
||||
- ichorcna/createpon
|
||||
- ichorcna
|
||||
files:
|
||||
- path: output/ichorcna/PoN_median.txt
|
||||
contains: ['seqnames']
|
||||
- path: output/ichorcna/versions.yml
|
||||
md5sum: 31a5fcc0075dbe747f7736efbdb99644
|
40
tests/modules/ichorcna/run/main.nf
Normal file
40
tests/modules/ichorcna/run/main.nf
Normal file
|
@ -0,0 +1,40 @@
|
|||
#!/usr/bin/env nextflow
|
||||
|
||||
nextflow.enable.dsl = 2
|
||||
|
||||
include { ICHORCNA_RUN } from '../../../../modules/ichorcna/run/main.nf'
|
||||
include { HMMCOPY_READCOUNTER } from '../../../../modules/hmmcopy/readcounter/main.nf'
|
||||
include { HMMCOPY_GCCOUNTER } from '../../../../modules/hmmcopy/gccounter/main.nf'
|
||||
include { HMMCOPY_MAPCOUNTER } from '../../../../modules/hmmcopy/mapcounter/main.nf'
|
||||
include { HMMCOPY_GENERATEMAP } from '../../../../modules/hmmcopy/generatemap/main.nf'
|
||||
|
||||
workflow test_ichorcna_run_no_panel {
|
||||
|
||||
input = [ [ id:'test'], // meta map
|
||||
file("https://raw.githubusercontent.com/broadinstitute/ichorCNA/master/inst/extdata/MBC_315.ctDNA.reads.wig", checkIfExists: true)
|
||||
]
|
||||
|
||||
gcwig = file("https://raw.githubusercontent.com/broadinstitute/ichorCNA/master/inst/extdata/gc_hg19_1000kb.wig", checkIfExists: true)
|
||||
mapwig = file("https://raw.githubusercontent.com/broadinstitute/ichorCNA/master/inst/extdata/map_hg19_1000kb.wig", checkIfExists: true)
|
||||
|
||||
panel_of_normals = []
|
||||
centromere = []
|
||||
|
||||
ICHORCNA_RUN ( input, gcwig, mapwig, panel_of_normals, centromere)
|
||||
}
|
||||
|
||||
workflow test_ichorcna_run_inc_panel {
|
||||
|
||||
input = [ [ id:'test'], // meta map
|
||||
file("https://raw.githubusercontent.com/broadinstitute/ichorCNA/master/inst/extdata/MBC_315.ctDNA.reads.wig", checkIfExists: true)
|
||||
]
|
||||
|
||||
gcwig = file("https://raw.githubusercontent.com/broadinstitute/ichorCNA/master/inst/extdata/gc_hg19_1000kb.wig", checkIfExists: true)
|
||||
mapwig = file("https://raw.githubusercontent.com/broadinstitute/ichorCNA/master/inst/extdata/map_hg19_1000kb.wig", checkIfExists: true)
|
||||
|
||||
panel_of_normals = file("https://raw.githubusercontent.com/broadinstitute/ichorCNA/master/inst/extdata/HD_ULP_PoN_1Mb_median_normAutosome_mapScoreFiltered_median.rds", checkIfExists: true)
|
||||
|
||||
centromere = file("https://raw.githubusercontent.com/broadinstitute/ichorCNA/master/inst/extdata/GRCh37.p13_centromere_UCSC-gapTable.txt", checkIfExists: true)
|
||||
|
||||
ICHORCNA_RUN ( input, gcwig, mapwig, panel_of_normals, centromere)
|
||||
}
|
5
tests/modules/ichorcna/run/nextflow.config
Normal file
5
tests/modules/ichorcna/run/nextflow.config
Normal file
|
@ -0,0 +1,5 @@
|
|||
process {
|
||||
|
||||
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
|
||||
|
||||
}
|
25
tests/modules/ichorcna/run/test.yml
Normal file
25
tests/modules/ichorcna/run/test.yml
Normal file
|
@ -0,0 +1,25 @@
|
|||
- name: ichorcna run test_ichorcna_run_no_panel
|
||||
command: nextflow run tests/modules/ichorcna/run -entry test_ichorcna_run_no_panel -c tests/config/nextflow.config
|
||||
tags:
|
||||
- ichorcna
|
||||
- ichorcna/run
|
||||
files:
|
||||
- path: output/ichorcna/test.cna.seg
|
||||
contains: ['Corrected_Copy_Number']
|
||||
- path: output/ichorcna/test.params.txt
|
||||
md5sum: e39a579cdcc9576679f06dc5c22605a7
|
||||
- path: output/ichorcna/versions.yml
|
||||
md5sum: effb37e19bec3609417aaccad4b6a294
|
||||
|
||||
- name: ichorcna run test_ichorcna_run_inc_panel
|
||||
command: nextflow run tests/modules/ichorcna/run -entry test_ichorcna_run_inc_panel -c tests/config/nextflow.config
|
||||
tags:
|
||||
- ichorcna
|
||||
- ichorcna/run
|
||||
files:
|
||||
- path: output/ichorcna/test.cna.seg
|
||||
contains: ['Corrected_Copy_Number']
|
||||
- path: output/ichorcna/test.params.txt
|
||||
md5sum: 0b97e0269cd0b571f5a85890f6ddb181
|
||||
- path: output/ichorcna/versions.yml
|
||||
md5sum: fc9d96de0a1c15cea59208305b14e535
|
Loading…
Reference in a new issue