Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module: ichorcna/run updated to v0.5.0 #2767

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/nf-core/ichorcna/createpon/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ channels:
- bioconda
- defaults
dependencies:
- bioconda::r-ichorcna=0.3.2
- bioconda::r-ichorcna=0.5.0
67 changes: 67 additions & 0 deletions modules/nf-core/ichorcna/createpon/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
// TODO nf-core: Once you have added the required tests, please run the following command to build this file:
// nf-core modules test ichorcna/createpon
nextflow_process {

name "Test Process ICHORCNA_CREATEPON"
script "../main.nf"
process "ICHORCNA_CREATEPON"

tag "modules"
tag "modules_nfcore"
tag "ichorcna"
tag "ichorcna/createpon"

test("hg19 - one file") {

when {
process {
"""
input[0] = file("https://raw.githubusercontent.com/gavinhalab/ichorCNA/master/inst/extdata/MBC_315.ctDNA.reads.wig", checkIfExists: true)
input[1] = file("https://raw.githubusercontent.com/gavinhalab/ichorCNA/master/inst/extdata/gc_hg19_1000kb.wig", checkIfExists: true)
input[2] = file("https://raw.githubusercontent.com/gavinhalab/ichorCNA/master/inst/extdata/map_hg19_1000kb.wig", checkIfExists: true)
input[3] = file("https://raw.githubusercontent.com/gavinhalab/ichorCNA/master/inst/extdata/GRCh37.p13_centromere_UCSC-gapTable.txt", checkIfExists: true)
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(file(process.out.rds.get(0)).name).match("PoN_median.rds") },
{ assert snapshot(file(process.out.txt.get(0)).name).match("PoN_median.txt") },
{ assert snapshot(process.out.versions).match() }
)
}

}


test("hg19 - two files") {

when {
process {
"""
input[0] = [ file("https://raw.githubusercontent.com/gavinhalab/ichorCNA/master/inst/extdata/MBC_315.ctDNA.reads.wig", checkIfExists: true),
file("https://raw.githubusercontent.com/gavinhalab/ichorCNA/master/inst/extdata/MBC_315_T2.ctDNA.reads.wig", checkIfExists: true)
]

input[1] = file("https://raw.githubusercontent.com/gavinhalab/ichorCNA/master/inst/extdata/gc_hg19_1000kb.wig", checkIfExists: true)
input[2] = file("https://raw.githubusercontent.com/gavinhalab/ichorCNA/master/inst/extdata/map_hg19_1000kb.wig", checkIfExists: true)
input[3] = file("https://raw.githubusercontent.com/gavinhalab/ichorCNA/master/inst/extdata/GRCh37.p13_centromere_UCSC-gapTable.txt", checkIfExists: true)
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(file(process.out.rds.get(0)).name).match("PoN_median.rds") },
{ assert snapshot(file(process.out.txt.get(0)).name).match("PoN_median.txt") },
{ assert snapshot(process.out.versions).match() }
)
}

}


}
30 changes: 30 additions & 0 deletions modules/nf-core/ichorcna/createpon/tests/main.nf.test.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions modules/nf-core/ichorcna/createpon/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ichorcna/createpon:
- "modules/nf-core/ichorcna/createpon/**"
2 changes: 1 addition & 1 deletion modules/nf-core/ichorcna/run/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ channels:
- bioconda
- defaults
dependencies:
- bioconda::r-ichorcna=0.3.2
- bioconda::r-ichorcna=0.5.0
77 changes: 49 additions & 28 deletions modules/nf-core/ichorcna/run/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -5,47 +5,68 @@ process ICHORCNA_RUN {
// WARN: Version information not provided by tool on CLI. Please update version string below when bumping container versions.
conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/r-ichorcna:0.3.2--pl5321r42hdfd78af_2' :
'biocontainers/r-ichorcna:0.3.2--pl5321r42hdfd78af_2' }"
'https://depot.galaxyproject.org/singularity/r-ichorcna:0.5.0--pl5321r42hdfd78af_0' :
'biocontainers/r-ichorcna:0.5.0--pl5321r42hdfd78af_0' }"

input:
tuple val(meta), path(wig)
path gc_wig
path map_wig
path panel_of_normals
path normal_wig
path normal_background
path centromere
path rep_time_wig
path exons

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
tuple val(meta), path("**.cna.seg") , emit: cna_seg
tuple val(meta), path("**.params.txt") , emit: ichorcna_params
tuple val(meta), path("**.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}" : ''
def VERSION = '0.3.2' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def norm = normal_wig ? "normal_wig='${normal_wig}'," : 'normal_wig=NULL,'
def pon = normal_background ? "normal_panel='${normal_background}'," : 'normal_panel=NULL,'
def map = map_wig ? "mapWig='${map_wig}'," : 'mapWig=NULL,'
def centro = centromere ? "centromere='${centromere}'," : ''
def rep = rep_time_wig ? "repTimeWig='${rep_time_wig}'," : 'repTimeWig=NULL,'
def exons = exons ? "exons.bed='${exons}'," : ''
"""
runIchorCNA.R \\
$args \\
--WIG ${wig} \\
--id ${prefix} \\
--gcWig ${gc_wig} \\
--mapWig ${map_wig} \\
${pon} \\
${centro} \\
--outDir .

cp */*genomeWide.pdf .

cat <<-END_VERSIONS > versions.yml
"${task.process}":
ichorcna: $VERSION
END_VERSIONS
#!/usr/bin/env Rscript
library("ichorCNA")
library("yaml")

run_ichorCNA(
tumor_wig='${wig}',
id='${prefix}',
cores=${task.cpus},
gcWig='${gc_wig}',
$norm
$pon
$map
$centro
$rep
$exons
$args
outDir="."
)


### Make Versions YAML for NF-Core ###
versions = list()
versions["r"] <- paste(R.Version()\$major, R.Version()\$minor, sep=".")
versions["ichorCNA"] <- paste(packageVersion("ichorCNA"), sep=".")

yaml_str <- as.yaml(
list(
"${task.process}" = versions
)
)
writeLines(yaml_str, file("versions.yml"))
"""
}
31 changes: 30 additions & 1 deletion modules/nf-core/ichorcna/run/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,49 +20,78 @@ input:
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:

- normal_wig:
type: file
description: hmmcopy/readCounter processed .wig file giving the number of reads in the normal sample, in each genomic window
pattern: "*.{wig}"

- normal_background:
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}"

- rep_time_wig:
type: file
description: Replication/timing .wig file.
pattern: "*.{wig}"

- exons:
type: file
description: BED file for exon regions to annotate CNA regions.
pattern: "*.{bed}"

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"
- "@adamrtalbot"

maintainers:
- "@sppearce"
- "@adamrtalbot"
Loading