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 2 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
76 changes: 48 additions & 28 deletions modules/nf-core/ichorcna/run/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,70 @@ process ICHORCNA_RUN {
tag "$meta.id"
label 'process_low'

// WARN: Version information not provided by tool on CLI. Please update version string below when bumping container versions.
conda "bioconda::r-ichorcna=0.3.2"
conda "bioconda::r-ichorcna=0.5.0"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/r-ichorcna:0.3.2--pl5321r42hdfd78af_2' :
'quay.io/biocontainers/r-ichorcna:0.3.2--pl5321r42hdfd78af_2' }"
'https://depot.galaxyproject.org/singularity/r-ichorcna:0.5.0--pl5321r42hdfd78af_0' :
'quay.io/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_rds
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sold on normal_rds as the name of this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not great, but I'm not sure what else to call it. I need something to distinguish it from a wig file...normal_background?

path rep_time_wig
path exons
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
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 norm = normal_wig ? "normal_wig='${normal_wig}'," : 'normal_wig=NULL,'
def pon = normal_rds ? "normal_panel='${normal_rds}'," : 'normal_panel=NULL,'
def gc = gc_wig ? "gcWig='${gc_wig}'," : 'gcWig=NULL,'
adamrtalbot marked this conversation as resolved.
Show resolved Hide resolved
def map = map_wig ? "mapWig='${map_wig}'," : 'mapWig=NULL,'
def rep = rep_time_wig ? "repTimeWig='${rep_time_wig}'," : 'repTimeWig=NULL,'
def exons = exons ? "exons.bed='${exons}'," : ''
def centro = centromere ? "centromere='${centromere}'," : ''
"""
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},
$norm
$pon
$gc
$map
$rep
$centro
$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"))
"""
}
29 changes: 17 additions & 12 deletions tests/modules/nf-core/ichorcna/run/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,35 @@ include { HMMCOPY_GENERATEMAP } from '../../../../../modules/nf-core/hmmcopy/gen
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)
file("https://raw.githubusercontent.com/GavinHaLab/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)
gcwig = file("https://raw.githubusercontent.com/gavinhalab/ichorCNA/master/inst/extdata/gc_hg19_1000kb.wig", checkIfExists: true)
adamrtalbot marked this conversation as resolved.
Show resolved Hide resolved
mapwig = file("https://raw.githubusercontent.com/gavinhalab/ichorCNA/master/inst/extdata/map_hg19_1000kb.wig", checkIfExists: true)

normal_wig = []
panel_of_normals = []
centromere = []
rep_time_wig = []
exons = []
centromere = file("https://raw.githubusercontent.com/gavinhalab/ichorCNA/master/inst/extdata/GRCh37.p13_centromere_UCSC-gapTable.txt", checkIfExists: true)

ICHORCNA_RUN ( input, gcwig, mapwig, panel_of_normals, centromere)
ICHORCNA_RUN ( input, gcwig, mapwig, normal_wig, panel_of_normals, rep_time_wig, exons, 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)
file("https://raw.githubusercontent.com/GavinHaLab/ichorCNA/master/inst/extdata/MBC_315.ctDNA.reads.wig", checkIfExists: true)
SPPearce marked this conversation as resolved.
Show resolved Hide resolved
]

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)
gcwig = file("https://raw.githubusercontent.com/gavinhalab/ichorCNA/master/inst/extdata/gc_hg19_1000kb.wig", checkIfExists: true)
mapwig = file("https://raw.githubusercontent.com/gavinhalab/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)
normal_wig = []
panel_of_normals = file("https://raw.githubusercontent.com/gavinhalab/ichorCNA/master/inst/extdata/HD_ULP_PoN_1Mb_median_normAutosome_mapScoreFiltered_median.rds", checkIfExists: true)
rep_time_wig = []
exons = []
centromere = file("https://raw.githubusercontent.com/gavinhalab/ichorCNA/master/inst/extdata/GRCh37.p13_centromere_UCSC-gapTable.txt", 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)
ICHORCNA_RUN ( input, gcwig, mapwig, normal_wig, panel_of_normals, rep_time_wig, exons, centromere)
adamrtalbot marked this conversation as resolved.
Show resolved Hide resolved
}
8 changes: 7 additions & 1 deletion tests/modules/nf-core/ichorcna/run/nextflow.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
process {

publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }


// We need this parameter otherwise it bugs out
withName: 'ICHORCNA_RUN' {
ext.args = """
scStates='c(1,3)',
"""
}
}
20 changes: 12 additions & 8 deletions tests/modules/nf-core/ichorcna/run/test.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
- name: ichorcna run test_ichorcna_run_no_panel
command: nextflow run ./tests/modules/nf-core/ichorcna/run -entry test_ichorcna_run_no_panel -c ./tests/config/nextflow.config
command: nextflow run ./tests/modules/nf-core/ichorcna/run -entry test_ichorcna_run_no_panel -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/ichorcna/run/nextflow.config
tags:
- ichorcna
- ichorcna/run
files:
- path: output/ichorcna/test.cna.seg
contains: ["Corrected_Copy_Number"]
contains:
- "chr start end test.copy.number test.event test.logR test.subclone.status test.Corrected_Copy_Number test.Corrected_Call test.logR_Copy_Number"
- "1 1000001 2000000 2 NEUT NA 0 2 NEUT NA"
- "1 2000001 3000000 2 NEUT NA 0 2 NEUT NA"
- path: output/ichorcna/test.params.txt
md5sum: e39a579cdcc9576679f06dc5c22605a7
md5sum: fa11ceb071512b7dd768003cc1d90647
- path: output/ichorcna/versions.yml
md5sum: effb37e19bec3609417aaccad4b6a294

- name: ichorcna run test_ichorcna_run_inc_panel
command: nextflow run ./tests/modules/nf-core/ichorcna/run -entry test_ichorcna_run_inc_panel -c ./tests/config/nextflow.config
command: nextflow run ./tests/modules/nf-core/ichorcna/run -entry test_ichorcna_run_inc_panel -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/ichorcna/run/nextflow.config
tags:
- ichorcna
- ichorcna/run
files:
- path: output/ichorcna/test.cna.seg
contains: ["Corrected_Copy_Number"]
contains:
- "chr start end test.copy.number test.event test.logR test.subclone.status test.Corrected_Copy_Number test.Corrected_Call test.logR_Copy_Number"
- "1 1000001 2000000 1 HETD NA 1 1 HETD NA"
- "1 2000001 3000000 1 HETD NA 1 1 HETD NA"
- path: output/ichorcna/test.params.txt
md5sum: 0b97e0269cd0b571f5a85890f6ddb181
md5sum: f4a826fd128a61de6c46d78f193379e3
- path: output/ichorcna/versions.yml
md5sum: fc9d96de0a1c15cea59208305b14e535