From 51c85636246f55803e353c7487e7c00a0d0fc2f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alan=20M=C3=B6bbs?= Date: Tue, 26 Nov 2024 13:35:29 +0000 Subject: [PATCH 01/17] Create module --- .gitignore | 1 + .../nf-core/nacho/normalise/environment.yml | 12 +++ modules/nf-core/nacho/normalise/main.nf | 72 +++++++++++++++ modules/nf-core/nacho/normalise/meta.yml | 58 ++++++++++++ .../normalise/resources/usr/bin/nacho_norm.R | 89 +++++++++++++++++++ .../nacho/normalise/tests/main.nf.test | 43 +++++++++ .../nacho/normalise/tests/main.nf.test.snap | 31 +++++++ .../nacho/normalise/tests/nextflow.config | 5 ++ 8 files changed, 311 insertions(+) create mode 100644 modules/nf-core/nacho/normalise/environment.yml create mode 100644 modules/nf-core/nacho/normalise/main.nf create mode 100644 modules/nf-core/nacho/normalise/meta.yml create mode 100755 modules/nf-core/nacho/normalise/resources/usr/bin/nacho_norm.R create mode 100644 modules/nf-core/nacho/normalise/tests/main.nf.test create mode 100644 modules/nf-core/nacho/normalise/tests/main.nf.test.snap create mode 100644 modules/nf-core/nacho/normalise/tests/nextflow.config diff --git a/.gitignore b/.gitignore index 34cd784c6ee..5063679f104 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ test_output/ tests/data/ work/ .github/CODEOWNERS-tmp +install_r.sh diff --git a/modules/nf-core/nacho/normalise/environment.yml b/modules/nf-core/nacho/normalise/environment.yml new file mode 100644 index 00000000000..f7cc5f665f7 --- /dev/null +++ b/modules/nf-core/nacho/normalise/environment.yml @@ -0,0 +1,12 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json +channels: + - conda-forge +dependencies: + - conda-forge::r-dplyr=1.1.4 + - conda-forge::r-fs=1.6.4 + - conda-forge::r-ggplot2=3.4.4 + - conda-forge::r-nacho=2.0.6 + - conda-forge::r-readr=2.1.5 + - conda-forge::r-tidyr=1.3.0 + - conda-forge::r-optparse=1.6.0 diff --git a/modules/nf-core/nacho/normalise/main.nf b/modules/nf-core/nacho/normalise/main.nf new file mode 100644 index 00000000000..11fd6eeb106 --- /dev/null +++ b/modules/nf-core/nacho/normalise/main.nf @@ -0,0 +1,72 @@ +// TODO nf-core: If in doubt look at other nf-core/modules to see how we are doing things! :) +// https://github.com/nf-core/modules/tree/master/modules/nf-core/ +// You can also ask for help via your pull request or on the #modules channel on the nf-core Slack workspace: +// https://nf-co.re/join +// TODO nf-core: A module file SHOULD only define input and output files as command-line parameters. +// All other parameters MUST be provided using the "task.ext" directive, see here: +// https://www.nextflow.io/docs/latest/process.html#ext +// where "task.ext" is a string. +// Any parameters that need to be evaluated in the context of a particular sample +// e.g. single-end/paired-end data MUST also be defined and evaluated appropriately. +// TODO nf-core: Software that can be piped together SHOULD be added to separate module files +// unless there is a run-time, storage advantage in implementing in this way +// e.g. it's ok to have a single module for bwa to output BAM instead of SAM: +// bwa mem | samtools view -B -T ref.fasta +// TODO nf-core: Optional inputs are not currently supported by Nextflow. However, using an empty +// list (`[]`) instead of a file can be used to work around this issue. +nextflow.enable.moduleBinaries = true + +process NACHO_NORMALISE { + tag "$sample_sheet" + label 'process_single' + + conda "${moduleDir}/environment.yml" + container "community.wave.seqera.io/library/r-dplyr_r-fs_r-ggplot2_r-nacho_pruned:9bb487ee68105a77" + + input: + path rcc_files, stageAs: "input/*" + path sample_sheet + + output: + path "*normalized_counts.tsv" , emit: normalized_counts + path "*normalized_counts_wo_HKnorm.tsv", emit: normalized_counts_wo_HK + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + """ + nacho_norm.R --input_rcc_path input --input_samplesheet ${sample_sheet} $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + r-base: \$(echo \$(R --version 2>&1) | sed 's/^.*R version //; s/ .*\$//') + r-nacho: \$(Rscript -e "library(NACHO); cat(as.character(packageVersion('NACHO')))") + r-dplyr: \$(Rscript -e "library(dplyr); cat(as.character(packageVersion('dplyr')))") + r-ggplot2: \$(Rscript -e "library(ggplot2); cat(as.character(packageVersion('ggplot2')))") + r-tidyr: \$(Rscript -e "library(tidyr); cat(as.character(packageVersion('tidyr')))") + r-readr: \$(Rscript -e "library(readr); cat(as.character(packageVersion('readr')))") + r-fs: \$(Rscript -e "library(fs); cat(as.character(packageVersion('fs')))") + END_VERSIONS + """ + + stub: + def args = task.ext.args ?: '' + """ + touch normalized_counts.tsv + touch normalized_counts_wo_HKnorm.tsv + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + r-base: \$(echo \$(R --version 2>&1) | sed 's/^.*R version //; s/ .*\$//') + r-nacho: \$(Rscript -e "library(NACHO); cat(as.character(packageVersion('NACHO')))") + r-dplyr: \$(Rscript -e "library(dplyr); cat(as.character(packageVersion('dplyr')))") + r-ggplot2: \$(Rscript -e "library(ggplot2); cat(as.character(packageVersion('ggplot2')))") + r-tidyr: \$(Rscript -e "library(tidyr); cat(as.character(packageVersion('tidyr')))") + r-readr: \$(Rscript -e "library(readr); cat(as.character(packageVersion('readr')))") + r-fs: \$(Rscript -e "library(fs); cat(as.character(packageVersion('fs')))") + END_VERSIONS + """ +} diff --git a/modules/nf-core/nacho/normalise/meta.yml b/modules/nf-core/nacho/normalise/meta.yml new file mode 100644 index 00000000000..cc4af100e61 --- /dev/null +++ b/modules/nf-core/nacho/normalise/meta.yml @@ -0,0 +1,58 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json +name: "nacho_normalise" +## TODO nf-core: Add a description of the module and list keywords +description: write your description here +keywords: + - sort + - example + - genomics +tools: + - "nacho": + ## TODO nf-core: Add a description and other details for the software below + description: "" + homepage: "" + documentation: "" + tool_dev_url: "" + doi: "" + licence: + identifier: biotools:NACHO + +## TODO nf-core: Add a description of all of the variables used as input +input: + # + ## TODO nf-core: Delete / customise this example input + - bam: + type: file + description: Sorted BAM/CRAM/SAM file + pattern: "*.{bam,cram,sam}" + ontologies: + - edam: "http://edamontology.org/format_25722" + - edam: "http://edamontology.org/format_2573" + - edam: "http://edamontology.org/format_3462" + + +## TODO nf-core: Add a description of all of the variables used as output +output: + - bam: + # + ## TODO nf-core: Delete / customise this example output + - "*.bam": + type: file + description: Sorted BAM/CRAM/SAM file + pattern: "*.{bam,cram,sam}" + ontologies: + - edam: "http://edamontology.org/format_25722" + - edam: "http://edamontology.org/format_2573" + - edam: "http://edamontology.org/format_3462" + + - versions: + - "versions.yml": + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@alanmmobbs93" +maintainers: + - "@alanmmobbs93" diff --git a/modules/nf-core/nacho/normalise/resources/usr/bin/nacho_norm.R b/modules/nf-core/nacho/normalise/resources/usr/bin/nacho_norm.R new file mode 100755 index 00000000000..a35de5b7768 --- /dev/null +++ b/modules/nf-core/nacho/normalise/resources/usr/bin/nacho_norm.R @@ -0,0 +1,89 @@ +#!/usr/bin/env Rscript +library(optparse) +library(dplyr) +library(ggplot2) +library(fs) +library(NACHO) +library(readr) +library(tidyr) + +# Parse Arguments +norm_methods <- c("GLM", "GEO") +option_list <- list( + make_option( + c("--input_rcc_path"), + type = "character", + default = "./" , + help = "Path to the folder that contains the RCC input file(s)", + metavar = "character"), + make_option( + c("--input_samplesheet"), + type = "character", + default = NULL , + help = "Path to the sample sheet file", + metavar = "character"), + make_option( + c("--norm_method"), + type = "character", + default = "GLM", + help = paste0("Normalization method. One of ", paste(norm_methods, collapse = " "), paste = " "), + metavar = "character") +) + +# Parse the command-line arguments +opt <- parse_args(OptionParser(option_list = option_list)) + +# Validate mandatory arguments +if (is.null(opt$input_rcc_path)) { + stop("Error: The --input_rcc_path parameter is mandatory and must be specified.") +} + +if (is.null(opt$input_samplesheet)) { + stop("Error: The --input_samplesheet parameter is mandatory and must be specified.") +} + +# Validate that --norm_method is one of the allowed values +if (!(opt$norm_method %in% norm_methods <- c("GLM", "GEO"))) { + stop(paste("Error: The --norm_method parameter must be one of:", paste(norm_methods, collapse = " "))) +} + +input_rcc_path <- opt$input_rcc_path +input_samplesheet <- opt$input_samplesheet +norm_method <- opt$norm_method + +#Create filelist for NachoQC + +list_of_rccs <- dir_ls(path = input_rcc_path, glob = "*.RCC", full.names = TRUE) + +####RealCode#### +nacho_data <- load_rcc(data_directory = input_rcc_path, + ssheet_csv = input_samplesheet, + id_colname = "RCC_FILE_NAME", + normalisation_method = norm_method) + +output_base <- "./" + +get_counts <- function( + nacho, + codeclass = "Endogenous", + rownames = "RCC_FILE_NAME", + colnames = c("Name", "Accession") +) { + nacho[["nacho"]] %>% + dplyr::select(c("RCC_FILE_NAME", "Name", "Count_Norm", "CodeClass")) %>% + tidyr::pivot_wider(names_from = "RCC_FILE_NAME", values_from = "Count_Norm") +} + +#Write out normalized counts +norm_counts <- as.data.frame(get_counts(nacho_data)) +write_tsv(norm_counts, file = "normalized_counts.tsv") + +#Write out non-hk normalized counts too +nacho_data_no_hk <- load_rcc(data_directory = input_rcc_path, + ssheet_csv = input_samplesheet, + id_colname = "RCC_FILE_NAME", + normalisation_method = norm_method, + housekeeping_norm = FALSE) + +norm_counts_without_hks <- as.data.frame(get_counts(nacho_data_no_hk)) +write_tsv(norm_counts_without_hks, file = "normalized_counts_wo_HKnorm.tsv") diff --git a/modules/nf-core/nacho/normalise/tests/main.nf.test b/modules/nf-core/nacho/normalise/tests/main.nf.test new file mode 100644 index 00000000000..dcb2ee297f6 --- /dev/null +++ b/modules/nf-core/nacho/normalise/tests/main.nf.test @@ -0,0 +1,43 @@ +// TODO nf-core: Once you have added the required tests, please run the following command to build this file: +// nf-core modules test nacho/normalise +nextflow_process { + + name "Test Process NACHO_NORMALISE" + script "../main.nf" + process "NACHO_NORMALISE" + config "./nextflow.config" + + tag "modules" + tag "modules_nfcore" + tag "nacho" + tag "nacho/normalise" + + test("Should run without failures") { + + when { + params { + module_args = '--norm_method "GLM"' + } + process { + """ + // RCC Files: Collect from sample sheet + input[0] = Channel.fromPath('https://raw.githubusercontent.com/nf-core/test-datasets/nanostring/samplesheets/samplesheet_test.csv', checkIfExists: true) + .splitCsv(header: true) + .map { row -> row.RCC_FILE } // Select first column: path to file + .collect() + + // Sample sheet + input[1] = file('https://raw.githubusercontent.com/nf-core/test-datasets/nanostring/samplesheets/samplesheet_test.csv', checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + +} \ No newline at end of file diff --git a/modules/nf-core/nacho/normalise/tests/main.nf.test.snap b/modules/nf-core/nacho/normalise/tests/main.nf.test.snap new file mode 100644 index 00000000000..328b619b96b --- /dev/null +++ b/modules/nf-core/nacho/normalise/tests/main.nf.test.snap @@ -0,0 +1,31 @@ +{ + "Should run without failures": { + "content": [ + { + "0": [ + + ], + "1": [ + + ], + "2": [ + + ], + "normalized_counts": [ + + ], + "normalized_counts_wo_HK": [ + + ], + "versions": [ + + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.1" + }, + "timestamp": "2024-11-26T12:25:34.208864197" + } +} \ No newline at end of file diff --git a/modules/nf-core/nacho/normalise/tests/nextflow.config b/modules/nf-core/nacho/normalise/tests/nextflow.config new file mode 100644 index 00000000000..918ae6f89ed --- /dev/null +++ b/modules/nf-core/nacho/normalise/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: 'NACHO_NORMALISE' { + ext.args = params.module_args + } +} From 3c5386ee09061dd6e96b442dacc29597ed723f5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alan=20M=C3=B6bbs?= Date: Tue, 26 Nov 2024 20:01:44 +0000 Subject: [PATCH 02/17] parse arguments on module R script --- modules/nf-core/nacho/normalise/main.nf | 20 +++---------------- .../normalise/resources/usr/bin/nacho_norm.R | 9 +++++---- 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/modules/nf-core/nacho/normalise/main.nf b/modules/nf-core/nacho/normalise/main.nf index 11fd6eeb106..98397b64784 100644 --- a/modules/nf-core/nacho/normalise/main.nf +++ b/modules/nf-core/nacho/normalise/main.nf @@ -1,19 +1,3 @@ -// TODO nf-core: If in doubt look at other nf-core/modules to see how we are doing things! :) -// https://github.com/nf-core/modules/tree/master/modules/nf-core/ -// You can also ask for help via your pull request or on the #modules channel on the nf-core Slack workspace: -// https://nf-co.re/join -// TODO nf-core: A module file SHOULD only define input and output files as command-line parameters. -// All other parameters MUST be provided using the "task.ext" directive, see here: -// https://www.nextflow.io/docs/latest/process.html#ext -// where "task.ext" is a string. -// Any parameters that need to be evaluated in the context of a particular sample -// e.g. single-end/paired-end data MUST also be defined and evaluated appropriately. -// TODO nf-core: Software that can be piped together SHOULD be added to separate module files -// unless there is a run-time, storage advantage in implementing in this way -// e.g. it's ok to have a single module for bwa to output BAM instead of SAM: -// bwa mem | samtools view -B -T ref.fasta -// TODO nf-core: Optional inputs are not currently supported by Nextflow. However, using an empty -// list (`[]`) instead of a file can be used to work around this issue. nextflow.enable.moduleBinaries = true process NACHO_NORMALISE { @@ -21,7 +5,7 @@ process NACHO_NORMALISE { label 'process_single' conda "${moduleDir}/environment.yml" - container "community.wave.seqera.io/library/r-dplyr_r-fs_r-ggplot2_r-nacho_pruned:9bb487ee68105a77" + container 'community.wave.seqera.io/library/r-dplyr_r-fs_r-ggplot2_r-nacho_pruned:2d777db141950c99' input: path rcc_files, stageAs: "input/*" @@ -49,6 +33,7 @@ process NACHO_NORMALISE { r-tidyr: \$(Rscript -e "library(tidyr); cat(as.character(packageVersion('tidyr')))") r-readr: \$(Rscript -e "library(readr); cat(as.character(packageVersion('readr')))") r-fs: \$(Rscript -e "library(fs); cat(as.character(packageVersion('fs')))") + r-optparse: \$(Rscript -e "library(optparse); cat(as.character(packageVersion('optparse')))") END_VERSIONS """ @@ -67,6 +52,7 @@ process NACHO_NORMALISE { r-tidyr: \$(Rscript -e "library(tidyr); cat(as.character(packageVersion('tidyr')))") r-readr: \$(Rscript -e "library(readr); cat(as.character(packageVersion('readr')))") r-fs: \$(Rscript -e "library(fs); cat(as.character(packageVersion('fs')))") + r-optparse: \$(Rscript -e "library(optparse); cat(as.character(packageVersion('optparse')))") END_VERSIONS """ } diff --git a/modules/nf-core/nacho/normalise/resources/usr/bin/nacho_norm.R b/modules/nf-core/nacho/normalise/resources/usr/bin/nacho_norm.R index a35de5b7768..dc424d852c6 100755 --- a/modules/nf-core/nacho/normalise/resources/usr/bin/nacho_norm.R +++ b/modules/nf-core/nacho/normalise/resources/usr/bin/nacho_norm.R @@ -43,17 +43,18 @@ if (is.null(opt$input_samplesheet)) { } # Validate that --norm_method is one of the allowed values -if (!(opt$norm_method %in% norm_methods <- c("GLM", "GEO"))) { +if (!(opt$norm_method %in% norm_methods)) { stop(paste("Error: The --norm_method parameter must be one of:", paste(norm_methods, collapse = " "))) } -input_rcc_path <- opt$input_rcc_path +input_rcc_path <- opt$input_rcc_path input_samplesheet <- opt$input_samplesheet -norm_method <- opt$norm_method +norm_method <- opt$norm_method #Create filelist for NachoQC -list_of_rccs <- dir_ls(path = input_rcc_path, glob = "*.RCC", full.names = TRUE) +list_of_rccs <- dir_ls(path = input_rcc_path, glob = "*.RCC") +print(list_of_rccs) ####RealCode#### nacho_data <- load_rcc(data_directory = input_rcc_path, From 713eb78bc0e7ae6cf7150faccddea1eefcce3e5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alan=20M=C3=B6bbs?= Date: Tue, 26 Nov 2024 20:01:56 +0000 Subject: [PATCH 03/17] update meta info --- modules/nf-core/nacho/normalise/meta.yml | 90 +++++++++++++----------- 1 file changed, 48 insertions(+), 42 deletions(-) diff --git a/modules/nf-core/nacho/normalise/meta.yml b/modules/nf-core/nacho/normalise/meta.yml index cc4af100e61..d9c30082555 100644 --- a/modules/nf-core/nacho/normalise/meta.yml +++ b/modules/nf-core/nacho/normalise/meta.yml @@ -1,58 +1,64 @@ --- # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json -name: "nacho_normalise" -## TODO nf-core: Add a description of the module and list keywords -description: write your description here +name: nacho_normalise +description: | + NACHO (NAnostring quality Control dasHbOard) is developed for NanoString nCounter data. + NanoString nCounter data is a messenger-RNA/micro-RNA (mRNA/miRNA) expression assay and works with fluorescent barcodes. + Each barcode is assigned a mRNA/miRNA, which can be counted after bonding with its target. + As a result each count of a specific barcode represents the presence of its target mRNA/miRNA. keywords: - - sort - - example - - genomics + - nacho + - nanostring + - mRNA + - miRNA + - qc tools: - - "nacho": - ## TODO nf-core: Add a description and other details for the software below - description: "" - homepage: "" - documentation: "" - tool_dev_url: "" - doi: "" - licence: - identifier: biotools:NACHO + - NACHO: + description: | + R package that uses two main functions to summarize and visualize NanoString RCC files, + namely: `load_rcc()` and `visualise()`. It also includes a function `normalise()`, which (re)calculates + sample specific size factors and normalises the data. + For more information `vignette("NACHO")` and `vignette("NACHO-analysis")` + homepage: https://github.com/mcanouil/NACHO + documentation: https://cran.r-project.org/web/packages/NACHO/vignettes/NACHO.html + doi: "doi:10.1093/bioinformatics/btz647" + licence: GPL-3.0 license + identifier: biotools:nacho -## TODO nf-core: Add a description of all of the variables used as input input: - # - ## TODO nf-core: Delete / customise this example input - - bam: - type: file - description: Sorted BAM/CRAM/SAM file - pattern: "*.{bam,cram,sam}" - ontologies: - - edam: "http://edamontology.org/format_25722" - - edam: "http://edamontology.org/format_2573" - - edam: "http://edamontology.org/format_3462" - + - - rcc_files: + type: file + description: | + List of RCC files for all samples, which are direct outputs from NanoString runs + pattern: "*.RCC" + - - sample_sheet: + type: "file" + pattern: "*.csv" + description: | + Comma-separated file with 3 columns: RCC_FILE, RCC_FILE_NAME, and SAMPLE_ID -## TODO nf-core: Add a description of all of the variables used as output output: - - bam: - # - ## TODO nf-core: Delete / customise this example output - - "*.bam": + - normalized_counts: + - "normalized_counts.tsv": + type: file + description: | + Tab-separated file with gene normalized counts for the samples + pattern: "*normalized_counts.tsv" + + - normalized_counts_wo_HK: + - "normalized_counts_wo_HKnorm.tsv": type: file - description: Sorted BAM/CRAM/SAM file - pattern: "*.{bam,cram,sam}" - ontologies: - - edam: "http://edamontology.org/format_25722" - - edam: "http://edamontology.org/format_2573" - - edam: "http://edamontology.org/format_3462" - + description: | + Tab-separated file with gene normalized counts for the samples, without housekeeping genes. + pattern: "*normalized_counts_wo_HKnorm.tsv" - versions: - "versions.yml": type: file - description: File containing software versions + description: | + File containing software versions pattern: "versions.yml" authors: - - "@alanmmobbs93" + - Mickaël Canouil, Gerard A. Bouland, Amélie Bonnefond, Philippe Froguel, Leen Hart, and Roderick Slieker. maintainers: - - "@alanmmobbs93" + - From 290b53f3be8a5188a2f050a273740a2a72917a31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alan=20M=C3=B6bbs?= Date: Tue, 26 Nov 2024 20:02:19 +0000 Subject: [PATCH 04/17] update nf-test --- modules/nf-core/nacho/normalise/tests/main.nf.test | 2 +- .../nacho/normalise/tests/main.nf.test.snap | 14 +++++++------- modules/nf-core/nacho/normalise/tests/test.tap | 2 ++ 3 files changed, 10 insertions(+), 8 deletions(-) create mode 100644 modules/nf-core/nacho/normalise/tests/test.tap diff --git a/modules/nf-core/nacho/normalise/tests/main.nf.test b/modules/nf-core/nacho/normalise/tests/main.nf.test index dcb2ee297f6..4de31dabfc5 100644 --- a/modules/nf-core/nacho/normalise/tests/main.nf.test +++ b/modules/nf-core/nacho/normalise/tests/main.nf.test @@ -16,7 +16,7 @@ nextflow_process { when { params { - module_args = '--norm_method "GLM"' + module_args = '--norm_method "GEO"' } process { """ diff --git a/modules/nf-core/nacho/normalise/tests/main.nf.test.snap b/modules/nf-core/nacho/normalise/tests/main.nf.test.snap index 328b619b96b..20de39a1e13 100644 --- a/modules/nf-core/nacho/normalise/tests/main.nf.test.snap +++ b/modules/nf-core/nacho/normalise/tests/main.nf.test.snap @@ -3,22 +3,22 @@ "content": [ { "0": [ - + "normalized_counts.tsv:md5,a0124c7a24bd04296f441d9ade82a05f" ], "1": [ - + "normalized_counts_wo_HKnorm.tsv:md5,5a2ce112c24e1b0d0f4cf3392111ef9e" ], "2": [ - + "versions.yml:md5,48b34cd3436038e6e80c7f92880be9f1" ], "normalized_counts": [ - + "normalized_counts.tsv:md5,a0124c7a24bd04296f441d9ade82a05f" ], "normalized_counts_wo_HK": [ - + "normalized_counts_wo_HKnorm.tsv:md5,5a2ce112c24e1b0d0f4cf3392111ef9e" ], "versions": [ - + "versions.yml:md5,48b34cd3436038e6e80c7f92880be9f1" ] } ], @@ -26,6 +26,6 @@ "nf-test": "0.9.2", "nextflow": "24.10.1" }, - "timestamp": "2024-11-26T12:25:34.208864197" + "timestamp": "2024-11-26T14:56:01.696817905" } } \ No newline at end of file diff --git a/modules/nf-core/nacho/normalise/tests/test.tap b/modules/nf-core/nacho/normalise/tests/test.tap new file mode 100644 index 00000000000..c8041c24064 --- /dev/null +++ b/modules/nf-core/nacho/normalise/tests/test.tap @@ -0,0 +1,2 @@ +1..1 +ok 1 Test Process NACHO_NORMALISE: Should run without failures From 69373fdad0c4c6ac0b202fc58fa552871df8f2f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alan=20M=C3=B6bbs?= Date: Tue, 26 Nov 2024 20:52:02 +0000 Subject: [PATCH 05/17] update snaps after upgrading versions file --- modules/nf-core/nacho/normalise/environment.yml | 2 +- modules/nf-core/nacho/normalise/main.nf | 2 +- modules/nf-core/nacho/normalise/tests/main.nf.test.snap | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/nf-core/nacho/normalise/environment.yml b/modules/nf-core/nacho/normalise/environment.yml index f7cc5f665f7..d22767a170a 100644 --- a/modules/nf-core/nacho/normalise/environment.yml +++ b/modules/nf-core/nacho/normalise/environment.yml @@ -9,4 +9,4 @@ dependencies: - conda-forge::r-nacho=2.0.6 - conda-forge::r-readr=2.1.5 - conda-forge::r-tidyr=1.3.0 - - conda-forge::r-optparse=1.6.0 + - conda-forge::r-optparse=1.7.5 diff --git a/modules/nf-core/nacho/normalise/main.nf b/modules/nf-core/nacho/normalise/main.nf index 98397b64784..87c26de0300 100644 --- a/modules/nf-core/nacho/normalise/main.nf +++ b/modules/nf-core/nacho/normalise/main.nf @@ -5,7 +5,7 @@ process NACHO_NORMALISE { label 'process_single' conda "${moduleDir}/environment.yml" - container 'community.wave.seqera.io/library/r-dplyr_r-fs_r-ggplot2_r-nacho_pruned:2d777db141950c99' + container 'community.wave.seqera.io/library/r-dplyr_r-fs_r-ggplot2_r-nacho_pruned:033bc017f5f36b6d' input: path rcc_files, stageAs: "input/*" diff --git a/modules/nf-core/nacho/normalise/tests/main.nf.test.snap b/modules/nf-core/nacho/normalise/tests/main.nf.test.snap index 20de39a1e13..5660052b028 100644 --- a/modules/nf-core/nacho/normalise/tests/main.nf.test.snap +++ b/modules/nf-core/nacho/normalise/tests/main.nf.test.snap @@ -9,7 +9,7 @@ "normalized_counts_wo_HKnorm.tsv:md5,5a2ce112c24e1b0d0f4cf3392111ef9e" ], "2": [ - "versions.yml:md5,48b34cd3436038e6e80c7f92880be9f1" + "versions.yml:md5,a67e277a3788bf01023f086295e6fab1" ], "normalized_counts": [ "normalized_counts.tsv:md5,a0124c7a24bd04296f441d9ade82a05f" @@ -18,7 +18,7 @@ "normalized_counts_wo_HKnorm.tsv:md5,5a2ce112c24e1b0d0f4cf3392111ef9e" ], "versions": [ - "versions.yml:md5,48b34cd3436038e6e80c7f92880be9f1" + "versions.yml:md5,a67e277a3788bf01023f086295e6fab1" ] } ], @@ -26,6 +26,6 @@ "nf-test": "0.9.2", "nextflow": "24.10.1" }, - "timestamp": "2024-11-26T14:56:01.696817905" + "timestamp": "2024-11-26T20:12:23.648098726" } } \ No newline at end of file From ec020a1da54934cfbd51940f932d6d58916cfa00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alan=20M=C3=B6bbs?= Date: Tue, 26 Nov 2024 20:55:17 +0000 Subject: [PATCH 06/17] update snaps after upgrading versions file --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index 5063679f104..34cd784c6ee 100644 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,3 @@ test_output/ tests/data/ work/ .github/CODEOWNERS-tmp -install_r.sh From 2e306bb0e492fe8d9c013e55072911601757b145 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alan=20M=C3=B6bbs?= Date: Wed, 27 Nov 2024 15:19:29 +0000 Subject: [PATCH 07/17] add stub test, meta components and update names --- modules/nf-core/nacho/normalise/main.nf | 11 ++-- .../normalise/resources/usr/bin/nacho_norm.R | 10 ++-- .../nacho/normalise/tests/main.nf.test | 59 ++++++++++++++++--- .../nacho/normalise/tests/main.nf.test.snap | 33 ++++++++++- .../nf-core/nacho/normalise/tests/test.tap | 2 - 5 files changed, 95 insertions(+), 20 deletions(-) delete mode 100644 modules/nf-core/nacho/normalise/tests/test.tap diff --git a/modules/nf-core/nacho/normalise/main.nf b/modules/nf-core/nacho/normalise/main.nf index 87c26de0300..495551473ec 100644 --- a/modules/nf-core/nacho/normalise/main.nf +++ b/modules/nf-core/nacho/normalise/main.nf @@ -1,15 +1,15 @@ nextflow.enable.moduleBinaries = true process NACHO_NORMALISE { - tag "$sample_sheet" + tag "${meta.id}" label 'process_single' conda "${moduleDir}/environment.yml" container 'community.wave.seqera.io/library/r-dplyr_r-fs_r-ggplot2_r-nacho_pruned:033bc017f5f36b6d' input: - path rcc_files, stageAs: "input/*" - path sample_sheet + tuple val(meta) , path(rcc_files, stageAs: "input/*") + tuple val(meta2), path(sample_sheet) output: path "*normalized_counts.tsv" , emit: normalized_counts @@ -22,7 +22,10 @@ process NACHO_NORMALISE { script: def args = task.ext.args ?: '' """ - nacho_norm.R --input_rcc_path input --input_samplesheet ${sample_sheet} $args + nacho_norm.R \\ + --input_rcc_path input \\ + $args \\ + --input_samplesheet ${sample_sheet} cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/nacho/normalise/resources/usr/bin/nacho_norm.R b/modules/nf-core/nacho/normalise/resources/usr/bin/nacho_norm.R index dc424d852c6..53899126a3b 100755 --- a/modules/nf-core/nacho/normalise/resources/usr/bin/nacho_norm.R +++ b/modules/nf-core/nacho/normalise/resources/usr/bin/nacho_norm.R @@ -51,12 +51,13 @@ input_rcc_path <- opt$input_rcc_path input_samplesheet <- opt$input_samplesheet norm_method <- opt$norm_method -#Create filelist for NachoQC +# Create filelist for NachoQC list_of_rccs <- dir_ls(path = input_rcc_path, glob = "*.RCC") print(list_of_rccs) -####RealCode#### +# Core Code +## Read data nacho_data <- load_rcc(data_directory = input_rcc_path, ssheet_csv = input_samplesheet, id_colname = "RCC_FILE_NAME", @@ -75,16 +76,17 @@ get_counts <- function( tidyr::pivot_wider(names_from = "RCC_FILE_NAME", values_from = "Count_Norm") } -#Write out normalized counts +## Write out normalized counts norm_counts <- as.data.frame(get_counts(nacho_data)) write_tsv(norm_counts, file = "normalized_counts.tsv") -#Write out non-hk normalized counts too +## Create non-hk normalized counts too nacho_data_no_hk <- load_rcc(data_directory = input_rcc_path, ssheet_csv = input_samplesheet, id_colname = "RCC_FILE_NAME", normalisation_method = norm_method, housekeeping_norm = FALSE) +## Export non-hk tables norm_counts_without_hks <- as.data.frame(get_counts(nacho_data_no_hk)) write_tsv(norm_counts_without_hks, file = "normalized_counts_wo_HKnorm.tsv") diff --git a/modules/nf-core/nacho/normalise/tests/main.nf.test b/modules/nf-core/nacho/normalise/tests/main.nf.test index 4de31dabfc5..d14b0873006 100644 --- a/modules/nf-core/nacho/normalise/tests/main.nf.test +++ b/modules/nf-core/nacho/normalise/tests/main.nf.test @@ -1,5 +1,3 @@ -// TODO nf-core: Once you have added the required tests, please run the following command to build this file: -// nf-core modules test nacho/normalise nextflow_process { name "Test Process NACHO_NORMALISE" @@ -12,7 +10,7 @@ nextflow_process { tag "nacho" tag "nacho/normalise" - test("Should run without failures") { + test("Salmon - RCC files") { when { params { @@ -21,13 +19,58 @@ nextflow_process { process { """ // RCC Files: Collect from sample sheet - input[0] = Channel.fromPath('https://raw.githubusercontent.com/nf-core/test-datasets/nanostring/samplesheets/samplesheet_test.csv', checkIfExists: true) - .splitCsv(header: true) - .map { row -> row.RCC_FILE } // Select first column: path to file - .collect() + input[0] = + Channel.fromPath('https://raw.githubusercontent.com/nf-core/test-datasets/nanostring/samplesheets/samplesheet_test.csv', checkIfExists: true) + .splitCsv( header: true ) + .map { row -> return file(row.RCC_FILE, checkIfExists: true) } // Select first column: path to file // Select first column: path to file + .collect() + .map{ files -> + tuple( [id: 'test'], files ) // Add meta component + } + + + // Sample sheet + input[1] = Channel.of( [ + [ id: 'test_samplesheet'], + [ file('https://raw.githubusercontent.com/nf-core/test-datasets/nanostring/samplesheets/samplesheet_test.csv', checkIfExists: true) ] + ] ) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("Salmon - RCC files - Stub") { + + options "-stub" + when { + params { + module_args = '--norm_method "GEO"' + } + process { + """ + // RCC Files: Collect from sample sheet + input[0] = + Channel.fromPath('https://raw.githubusercontent.com/nf-core/test-datasets/nanostring/samplesheets/samplesheet_test.csv', checkIfExists: true) + .splitCsv( header: true ) + .map { row -> return file(row.RCC_FILE, checkIfExists: true) } // Select first column: path to file // Select first column: path to file + .collect() + .map{ files -> + tuple( [id: 'test'], files ) // Add meta component + } // Sample sheet - input[1] = file('https://raw.githubusercontent.com/nf-core/test-datasets/nanostring/samplesheets/samplesheet_test.csv', checkIfExists: true) + input[1] = + Channel.of( [ + [id: 'test_samplesheet'], + [ file('https://raw.githubusercontent.com/nf-core/test-datasets/nanostring/samplesheets/samplesheet_test.csv', checkIfExists: true) ] + ] ) """ } } diff --git a/modules/nf-core/nacho/normalise/tests/main.nf.test.snap b/modules/nf-core/nacho/normalise/tests/main.nf.test.snap index 5660052b028..6d242b1e833 100644 --- a/modules/nf-core/nacho/normalise/tests/main.nf.test.snap +++ b/modules/nf-core/nacho/normalise/tests/main.nf.test.snap @@ -1,5 +1,34 @@ { - "Should run without failures": { + "Salmon - RCC files - Stub": { + "content": [ + { + "0": [ + "normalized_counts.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ], + "1": [ + "normalized_counts_wo_HKnorm.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ], + "2": [ + "versions.yml:md5,a67e277a3788bf01023f086295e6fab1" + ], + "normalized_counts": [ + "normalized_counts.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ], + "normalized_counts_wo_HK": [ + "normalized_counts_wo_HKnorm.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ], + "versions": [ + "versions.yml:md5,a67e277a3788bf01023f086295e6fab1" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.1" + }, + "timestamp": "2024-11-27T15:13:12.044326701" + }, + "Salmon - RCC files": { "content": [ { "0": [ @@ -26,6 +55,6 @@ "nf-test": "0.9.2", "nextflow": "24.10.1" }, - "timestamp": "2024-11-26T20:12:23.648098726" + "timestamp": "2024-11-27T15:12:49.870804363" } } \ No newline at end of file diff --git a/modules/nf-core/nacho/normalise/tests/test.tap b/modules/nf-core/nacho/normalise/tests/test.tap deleted file mode 100644 index c8041c24064..00000000000 --- a/modules/nf-core/nacho/normalise/tests/test.tap +++ /dev/null @@ -1,2 +0,0 @@ -1..1 -ok 1 Test Process NACHO_NORMALISE: Should run without failures From 32b8b2b530b51c6afa92d391f30f243ac168bac1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alan=20M=C3=B6bbs?= Date: Wed, 27 Nov 2024 15:19:56 +0000 Subject: [PATCH 08/17] remove comments from ymls --- modules/nf-core/nacho/normalise/environment.yml | 1 - modules/nf-core/nacho/normalise/meta.yml | 9 ++++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/modules/nf-core/nacho/normalise/environment.yml b/modules/nf-core/nacho/normalise/environment.yml index d22767a170a..a06ce44af9c 100644 --- a/modules/nf-core/nacho/normalise/environment.yml +++ b/modules/nf-core/nacho/normalise/environment.yml @@ -1,5 +1,4 @@ --- -# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json channels: - conda-forge dependencies: diff --git a/modules/nf-core/nacho/normalise/meta.yml b/modules/nf-core/nacho/normalise/meta.yml index d9c30082555..2eccbeaf3eb 100644 --- a/modules/nf-core/nacho/normalise/meta.yml +++ b/modules/nf-core/nacho/normalise/meta.yml @@ -1,5 +1,4 @@ --- -# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json name: nacho_normalise description: | NACHO (NAnostring quality Control dasHbOard) is developed for NanoString nCounter data. @@ -22,8 +21,8 @@ tools: homepage: https://github.com/mcanouil/NACHO documentation: https://cran.r-project.org/web/packages/NACHO/vignettes/NACHO.html doi: "doi:10.1093/bioinformatics/btz647" - licence: GPL-3.0 license - identifier: biotools:nacho + licence: [ "GPL-3.0" ] + identifier: "" input: - - rcc_files: @@ -59,6 +58,6 @@ output: pattern: "versions.yml" authors: - - Mickaël Canouil, Gerard A. Bouland, Amélie Bonnefond, Philippe Froguel, Leen Hart, and Roderick Slieker. + - "@alanmobbs93" maintainers: - - + - "@alanmobbs93" From b7ba0c588ccc6a38debb3945425bff0388f15ce1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alan=20M=C3=B6bbs?= Date: Wed, 27 Nov 2024 15:22:43 +0000 Subject: [PATCH 09/17] change output --- modules/nf-core/nacho/normalise/main.nf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/nf-core/nacho/normalise/main.nf b/modules/nf-core/nacho/normalise/main.nf index 495551473ec..e8020924665 100644 --- a/modules/nf-core/nacho/normalise/main.nf +++ b/modules/nf-core/nacho/normalise/main.nf @@ -12,8 +12,8 @@ process NACHO_NORMALISE { tuple val(meta2), path(sample_sheet) output: - path "*normalized_counts.tsv" , emit: normalized_counts - path "*normalized_counts_wo_HKnorm.tsv", emit: normalized_counts_wo_HK + path "normalized_counts.tsv" , emit: normalized_counts + path "normalized_counts_wo_HKnorm.tsv", emit: normalized_counts_wo_HK path "versions.yml" , emit: versions when: From b577694fcfdd8b934b40c14b29ea3a1af36d28e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alan=20M=C3=B6bbs?= Date: Wed, 27 Nov 2024 16:09:58 +0000 Subject: [PATCH 10/17] add meta to output channels --- modules/nf-core/nacho/normalise/main.nf | 6 +-- modules/nf-core/nacho/normalise/meta.yml | 51 +++++++++++++++++------- 2 files changed, 39 insertions(+), 18 deletions(-) diff --git a/modules/nf-core/nacho/normalise/main.nf b/modules/nf-core/nacho/normalise/main.nf index e8020924665..01826d31ebe 100644 --- a/modules/nf-core/nacho/normalise/main.nf +++ b/modules/nf-core/nacho/normalise/main.nf @@ -12,9 +12,9 @@ process NACHO_NORMALISE { tuple val(meta2), path(sample_sheet) output: - path "normalized_counts.tsv" , emit: normalized_counts - path "normalized_counts_wo_HKnorm.tsv", emit: normalized_counts_wo_HK - path "versions.yml" , emit: versions + tuple val(meta), path("normalized_counts.tsv") , emit: normalized_counts + tuple val(meta), path("normalized_counts_wo_HKnorm.tsv"), emit: normalized_counts_wo_HK + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/nacho/normalise/meta.yml b/modules/nf-core/nacho/normalise/meta.yml index 2eccbeaf3eb..b51bc693065 100644 --- a/modules/nf-core/nacho/normalise/meta.yml +++ b/modules/nf-core/nacho/normalise/meta.yml @@ -20,36 +20,57 @@ tools: For more information `vignette("NACHO")` and `vignette("NACHO-analysis")` homepage: https://github.com/mcanouil/NACHO documentation: https://cran.r-project.org/web/packages/NACHO/vignettes/NACHO.html - doi: "doi:10.1093/bioinformatics/btz647" + doi: "10.1093/bioinformatics/btz647" licence: [ "GPL-3.0" ] identifier: "" + args_id: "$args" input: - - - rcc_files: - type: file - description: | - List of RCC files for all samples, which are direct outputs from NanoString runs - pattern: "*.RCC" - - - sample_sheet: - type: "file" - pattern: "*.csv" - description: | - Comma-separated file with 3 columns: RCC_FILE, RCC_FILE_NAME, and SAMPLE_ID + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test' ] + - rcc_files: + type: file + description: | + List of RCC files for all samples, which are direct outputs from NanoString runs + pattern: "*.RCC" + - - meta2: + type: map + description: | + Groovy Map containing file information + e.g. [ id:'test_samplesheet' ] + - sample_sheet: + type: "file" + pattern: "*.csv" + description: | + Comma-separated file with 3 columns: RCC_FILE, RCC_FILE_NAME, and SAMPLE_ID output: - normalized_counts: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test' ] - "normalized_counts.tsv": type: file description: | Tab-separated file with gene normalized counts for the samples - pattern: "*normalized_counts.tsv" + pattern: "normalized_counts.tsv" - normalized_counts_wo_HK: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test' ] - "normalized_counts_wo_HKnorm.tsv": type: file description: | Tab-separated file with gene normalized counts for the samples, without housekeeping genes. - pattern: "*normalized_counts_wo_HKnorm.tsv" + pattern: "normalized_counts_wo_HKnorm.tsv" - versions: - "versions.yml": type: file @@ -58,6 +79,6 @@ output: pattern: "versions.yml" authors: - - "@alanmobbs93" + - "@alanmmobbs93" maintainers: - - "@alanmobbs93" + - "@alanmmobbs93" From a3dd7fce8c1884535cc32efe7fe2283f28ab318b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alan=20M=C3=B6bbs?= Date: Wed, 27 Nov 2024 16:10:12 +0000 Subject: [PATCH 11/17] fix environment.yml linting --- modules/nf-core/nacho/normalise/environment.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/nf-core/nacho/normalise/environment.yml b/modules/nf-core/nacho/normalise/environment.yml index a06ce44af9c..9cf652c88fe 100644 --- a/modules/nf-core/nacho/normalise/environment.yml +++ b/modules/nf-core/nacho/normalise/environment.yml @@ -1,11 +1,12 @@ ---- channels: - conda-forge + - bioconda + dependencies: - conda-forge::r-dplyr=1.1.4 - conda-forge::r-fs=1.6.4 - conda-forge::r-ggplot2=3.4.4 - conda-forge::r-nacho=2.0.6 + - conda-forge::r-optparse=1.7.5 - conda-forge::r-readr=2.1.5 - conda-forge::r-tidyr=1.3.0 - - conda-forge::r-optparse=1.7.5 From 8fea3b77513bf41cf59c539639bd24d62a6b7332 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alan=20M=C3=B6bbs?= Date: Wed, 27 Nov 2024 16:33:43 +0000 Subject: [PATCH 12/17] update snaps --- .../nacho/normalise/tests/main.nf.test.snap | 60 +++++++++++++++---- 1 file changed, 50 insertions(+), 10 deletions(-) diff --git a/modules/nf-core/nacho/normalise/tests/main.nf.test.snap b/modules/nf-core/nacho/normalise/tests/main.nf.test.snap index 6d242b1e833..2a8dfe1be0e 100644 --- a/modules/nf-core/nacho/normalise/tests/main.nf.test.snap +++ b/modules/nf-core/nacho/normalise/tests/main.nf.test.snap @@ -3,19 +3,39 @@ "content": [ { "0": [ - "normalized_counts.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + [ + { + "id": "test" + }, + "normalized_counts.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] ], "1": [ - "normalized_counts_wo_HKnorm.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + [ + { + "id": "test" + }, + "normalized_counts_wo_HKnorm.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] ], "2": [ "versions.yml:md5,a67e277a3788bf01023f086295e6fab1" ], "normalized_counts": [ - "normalized_counts.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + [ + { + "id": "test" + }, + "normalized_counts.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] ], "normalized_counts_wo_HK": [ - "normalized_counts_wo_HKnorm.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + [ + { + "id": "test" + }, + "normalized_counts_wo_HKnorm.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] ], "versions": [ "versions.yml:md5,a67e277a3788bf01023f086295e6fab1" @@ -26,25 +46,45 @@ "nf-test": "0.9.2", "nextflow": "24.10.1" }, - "timestamp": "2024-11-27T15:13:12.044326701" + "timestamp": "2024-11-27T16:33:31.221669303" }, "Salmon - RCC files": { "content": [ { "0": [ - "normalized_counts.tsv:md5,a0124c7a24bd04296f441d9ade82a05f" + [ + { + "id": "test" + }, + "normalized_counts.tsv:md5,a0124c7a24bd04296f441d9ade82a05f" + ] ], "1": [ - "normalized_counts_wo_HKnorm.tsv:md5,5a2ce112c24e1b0d0f4cf3392111ef9e" + [ + { + "id": "test" + }, + "normalized_counts_wo_HKnorm.tsv:md5,5a2ce112c24e1b0d0f4cf3392111ef9e" + ] ], "2": [ "versions.yml:md5,a67e277a3788bf01023f086295e6fab1" ], "normalized_counts": [ - "normalized_counts.tsv:md5,a0124c7a24bd04296f441d9ade82a05f" + [ + { + "id": "test" + }, + "normalized_counts.tsv:md5,a0124c7a24bd04296f441d9ade82a05f" + ] ], "normalized_counts_wo_HK": [ - "normalized_counts_wo_HKnorm.tsv:md5,5a2ce112c24e1b0d0f4cf3392111ef9e" + [ + { + "id": "test" + }, + "normalized_counts_wo_HKnorm.tsv:md5,5a2ce112c24e1b0d0f4cf3392111ef9e" + ] ], "versions": [ "versions.yml:md5,a67e277a3788bf01023f086295e6fab1" @@ -55,6 +95,6 @@ "nf-test": "0.9.2", "nextflow": "24.10.1" }, - "timestamp": "2024-11-27T15:12:49.870804363" + "timestamp": "2024-11-27T16:33:11.86337987" } } \ No newline at end of file From 01828c2fb844393a1c57ce888be260d6418fe6df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alan=20M=C3=B6bbs?= Date: Wed, 27 Nov 2024 19:34:45 +0000 Subject: [PATCH 13/17] replace Stub with stub to pass linting --- .../nacho/normalise/tests/main.nf.test | 2 +- .../nacho/normalise/tests/main.nf.test.snap | 24 +++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/modules/nf-core/nacho/normalise/tests/main.nf.test b/modules/nf-core/nacho/normalise/tests/main.nf.test index d14b0873006..3726ae6195a 100644 --- a/modules/nf-core/nacho/normalise/tests/main.nf.test +++ b/modules/nf-core/nacho/normalise/tests/main.nf.test @@ -46,7 +46,7 @@ nextflow_process { } } - test("Salmon - RCC files - Stub") { + test("Salmon - RCC files - stub") { options "-stub" when { diff --git a/modules/nf-core/nacho/normalise/tests/main.nf.test.snap b/modules/nf-core/nacho/normalise/tests/main.nf.test.snap index 2a8dfe1be0e..4d7ceb00dbb 100644 --- a/modules/nf-core/nacho/normalise/tests/main.nf.test.snap +++ b/modules/nf-core/nacho/normalise/tests/main.nf.test.snap @@ -1,5 +1,5 @@ { - "Salmon - RCC files - Stub": { + "Salmon - RCC files": { "content": [ { "0": [ @@ -7,7 +7,7 @@ { "id": "test" }, - "normalized_counts.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + "normalized_counts.tsv:md5,a0124c7a24bd04296f441d9ade82a05f" ] ], "1": [ @@ -15,7 +15,7 @@ { "id": "test" }, - "normalized_counts_wo_HKnorm.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + "normalized_counts_wo_HKnorm.tsv:md5,5a2ce112c24e1b0d0f4cf3392111ef9e" ] ], "2": [ @@ -26,7 +26,7 @@ { "id": "test" }, - "normalized_counts.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + "normalized_counts.tsv:md5,a0124c7a24bd04296f441d9ade82a05f" ] ], "normalized_counts_wo_HK": [ @@ -34,7 +34,7 @@ { "id": "test" }, - "normalized_counts_wo_HKnorm.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + "normalized_counts_wo_HKnorm.tsv:md5,5a2ce112c24e1b0d0f4cf3392111ef9e" ] ], "versions": [ @@ -46,9 +46,9 @@ "nf-test": "0.9.2", "nextflow": "24.10.1" }, - "timestamp": "2024-11-27T16:33:31.221669303" + "timestamp": "2024-11-27T19:32:45.057875179" }, - "Salmon - RCC files": { + "Salmon - RCC files - stub": { "content": [ { "0": [ @@ -56,7 +56,7 @@ { "id": "test" }, - "normalized_counts.tsv:md5,a0124c7a24bd04296f441d9ade82a05f" + "normalized_counts.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "1": [ @@ -64,7 +64,7 @@ { "id": "test" }, - "normalized_counts_wo_HKnorm.tsv:md5,5a2ce112c24e1b0d0f4cf3392111ef9e" + "normalized_counts_wo_HKnorm.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "2": [ @@ -75,7 +75,7 @@ { "id": "test" }, - "normalized_counts.tsv:md5,a0124c7a24bd04296f441d9ade82a05f" + "normalized_counts.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "normalized_counts_wo_HK": [ @@ -83,7 +83,7 @@ { "id": "test" }, - "normalized_counts_wo_HKnorm.tsv:md5,5a2ce112c24e1b0d0f4cf3392111ef9e" + "normalized_counts_wo_HKnorm.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "versions": [ @@ -95,6 +95,6 @@ "nf-test": "0.9.2", "nextflow": "24.10.1" }, - "timestamp": "2024-11-27T16:33:11.86337987" + "timestamp": "2024-11-27T19:33:06.874199328" } } \ No newline at end of file From 380c3b068ae517aa61926ae225888cc87280744a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alan=20M=C3=B6bbs?= <64787947+alanmmobbs93@users.noreply.github.com> Date: Wed, 27 Nov 2024 19:35:30 -0300 Subject: [PATCH 14/17] Update main.nf.test --- modules/nf-core/nacho/normalise/tests/main.nf.test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/nf-core/nacho/normalise/tests/main.nf.test b/modules/nf-core/nacho/normalise/tests/main.nf.test index 3726ae6195a..642c39bd026 100644 --- a/modules/nf-core/nacho/normalise/tests/main.nf.test +++ b/modules/nf-core/nacho/normalise/tests/main.nf.test @@ -22,7 +22,7 @@ nextflow_process { input[0] = Channel.fromPath('https://raw.githubusercontent.com/nf-core/test-datasets/nanostring/samplesheets/samplesheet_test.csv', checkIfExists: true) .splitCsv( header: true ) - .map { row -> return file(row.RCC_FILE, checkIfExists: true) } // Select first column: path to file // Select first column: path to file + .map { row -> return file(row.RCC_FILE, checkIfExists: true) } // Select first column: path to file .collect() .map{ files -> tuple( [id: 'test'], files ) // Add meta component @@ -83,4 +83,4 @@ nextflow_process { } } -} \ No newline at end of file +} From f195ac78d173f53f8b913b3b3c8f17b74ecdcb94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alan=20M=C3=B6bbs?= Date: Thu, 28 Nov 2024 15:50:38 +0000 Subject: [PATCH 15/17] change normalise by normalize --- .../nf-core/nacho/{normalise => normalize}/environment.yml | 0 modules/nf-core/nacho/{normalise => normalize}/main.nf | 2 +- modules/nf-core/nacho/{normalise => normalize}/meta.yml | 2 +- .../{normalise => normalize}/resources/usr/bin/nacho_norm.R | 0 .../nacho/{normalise => normalize}/tests/main.nf.test | 6 +++--- .../nacho/{normalise => normalize}/tests/main.nf.test.snap | 0 .../nacho/{normalise => normalize}/tests/nextflow.config | 0 7 files changed, 5 insertions(+), 5 deletions(-) rename modules/nf-core/nacho/{normalise => normalize}/environment.yml (100%) rename modules/nf-core/nacho/{normalise => normalize}/main.nf (99%) rename modules/nf-core/nacho/{normalise => normalize}/meta.yml (99%) rename modules/nf-core/nacho/{normalise => normalize}/resources/usr/bin/nacho_norm.R (100%) rename modules/nf-core/nacho/{normalise => normalize}/tests/main.nf.test (96%) rename modules/nf-core/nacho/{normalise => normalize}/tests/main.nf.test.snap (100%) rename modules/nf-core/nacho/{normalise => normalize}/tests/nextflow.config (100%) diff --git a/modules/nf-core/nacho/normalise/environment.yml b/modules/nf-core/nacho/normalize/environment.yml similarity index 100% rename from modules/nf-core/nacho/normalise/environment.yml rename to modules/nf-core/nacho/normalize/environment.yml diff --git a/modules/nf-core/nacho/normalise/main.nf b/modules/nf-core/nacho/normalize/main.nf similarity index 99% rename from modules/nf-core/nacho/normalise/main.nf rename to modules/nf-core/nacho/normalize/main.nf index 01826d31ebe..2166639738e 100644 --- a/modules/nf-core/nacho/normalise/main.nf +++ b/modules/nf-core/nacho/normalize/main.nf @@ -1,6 +1,6 @@ nextflow.enable.moduleBinaries = true -process NACHO_NORMALISE { +process NACHO_NORMALIZE { tag "${meta.id}" label 'process_single' diff --git a/modules/nf-core/nacho/normalise/meta.yml b/modules/nf-core/nacho/normalize/meta.yml similarity index 99% rename from modules/nf-core/nacho/normalise/meta.yml rename to modules/nf-core/nacho/normalize/meta.yml index b51bc693065..8fddb762e3a 100644 --- a/modules/nf-core/nacho/normalise/meta.yml +++ b/modules/nf-core/nacho/normalize/meta.yml @@ -1,5 +1,5 @@ --- -name: nacho_normalise +name: nacho_normalize description: | NACHO (NAnostring quality Control dasHbOard) is developed for NanoString nCounter data. NanoString nCounter data is a messenger-RNA/micro-RNA (mRNA/miRNA) expression assay and works with fluorescent barcodes. diff --git a/modules/nf-core/nacho/normalise/resources/usr/bin/nacho_norm.R b/modules/nf-core/nacho/normalize/resources/usr/bin/nacho_norm.R similarity index 100% rename from modules/nf-core/nacho/normalise/resources/usr/bin/nacho_norm.R rename to modules/nf-core/nacho/normalize/resources/usr/bin/nacho_norm.R diff --git a/modules/nf-core/nacho/normalise/tests/main.nf.test b/modules/nf-core/nacho/normalize/tests/main.nf.test similarity index 96% rename from modules/nf-core/nacho/normalise/tests/main.nf.test rename to modules/nf-core/nacho/normalize/tests/main.nf.test index 642c39bd026..ec21ec5c87f 100644 --- a/modules/nf-core/nacho/normalise/tests/main.nf.test +++ b/modules/nf-core/nacho/normalize/tests/main.nf.test @@ -1,14 +1,14 @@ nextflow_process { - name "Test Process NACHO_NORMALISE" + name "Test Process NACHO_NORMALIZE" script "../main.nf" - process "NACHO_NORMALISE" + process "NACHO_NORMALIZE" config "./nextflow.config" tag "modules" tag "modules_nfcore" tag "nacho" - tag "nacho/normalise" + tag "nacho/normalize" test("Salmon - RCC files") { diff --git a/modules/nf-core/nacho/normalise/tests/main.nf.test.snap b/modules/nf-core/nacho/normalize/tests/main.nf.test.snap similarity index 100% rename from modules/nf-core/nacho/normalise/tests/main.nf.test.snap rename to modules/nf-core/nacho/normalize/tests/main.nf.test.snap diff --git a/modules/nf-core/nacho/normalise/tests/nextflow.config b/modules/nf-core/nacho/normalize/tests/nextflow.config similarity index 100% rename from modules/nf-core/nacho/normalise/tests/nextflow.config rename to modules/nf-core/nacho/normalize/tests/nextflow.config From e4e779b61ddd9a8f8cb466b7dc13e1b97b4a6919 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alan=20M=C3=B6bbs?= Date: Thu, 28 Nov 2024 18:03:10 +0000 Subject: [PATCH 16/17] move moduleBinaries to test nextflow config --- modules/nf-core/nacho/normalize/main.nf | 2 -- modules/nf-core/nacho/normalize/tests/nextflow.config | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/nf-core/nacho/normalize/main.nf b/modules/nf-core/nacho/normalize/main.nf index 2166639738e..69cc49ec143 100644 --- a/modules/nf-core/nacho/normalize/main.nf +++ b/modules/nf-core/nacho/normalize/main.nf @@ -1,5 +1,3 @@ -nextflow.enable.moduleBinaries = true - process NACHO_NORMALIZE { tag "${meta.id}" label 'process_single' diff --git a/modules/nf-core/nacho/normalize/tests/nextflow.config b/modules/nf-core/nacho/normalize/tests/nextflow.config index 918ae6f89ed..e64446a7c4d 100644 --- a/modules/nf-core/nacho/normalize/tests/nextflow.config +++ b/modules/nf-core/nacho/normalize/tests/nextflow.config @@ -1,3 +1,5 @@ +nextflow.enable.moduleBinaries = true + process { withName: 'NACHO_NORMALISE' { ext.args = params.module_args From aa2faad335385a6a18964a95d85f6edd36d38414 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alan=20M=C3=B6bbs?= Date: Thu, 28 Nov 2024 18:32:32 +0000 Subject: [PATCH 17/17] update snapshot after renaming --- .../nf-core/nacho/normalize/tests/main.nf.test.snap | 12 ++++++------ .../nf-core/nacho/normalize/tests/nextflow.config | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/nf-core/nacho/normalize/tests/main.nf.test.snap b/modules/nf-core/nacho/normalize/tests/main.nf.test.snap index 4d7ceb00dbb..f6e20e3947d 100644 --- a/modules/nf-core/nacho/normalize/tests/main.nf.test.snap +++ b/modules/nf-core/nacho/normalize/tests/main.nf.test.snap @@ -19,7 +19,7 @@ ] ], "2": [ - "versions.yml:md5,a67e277a3788bf01023f086295e6fab1" + "versions.yml:md5,dbc82908e1d1fcd2429022a4f327b9ba" ], "normalized_counts": [ [ @@ -38,7 +38,7 @@ ] ], "versions": [ - "versions.yml:md5,a67e277a3788bf01023f086295e6fab1" + "versions.yml:md5,dbc82908e1d1fcd2429022a4f327b9ba" ] } ], @@ -46,7 +46,7 @@ "nf-test": "0.9.2", "nextflow": "24.10.1" }, - "timestamp": "2024-11-27T19:32:45.057875179" + "timestamp": "2024-11-28T18:31:49.03241566" }, "Salmon - RCC files - stub": { "content": [ @@ -68,7 +68,7 @@ ] ], "2": [ - "versions.yml:md5,a67e277a3788bf01023f086295e6fab1" + "versions.yml:md5,dbc82908e1d1fcd2429022a4f327b9ba" ], "normalized_counts": [ [ @@ -87,7 +87,7 @@ ] ], "versions": [ - "versions.yml:md5,a67e277a3788bf01023f086295e6fab1" + "versions.yml:md5,dbc82908e1d1fcd2429022a4f327b9ba" ] } ], @@ -95,6 +95,6 @@ "nf-test": "0.9.2", "nextflow": "24.10.1" }, - "timestamp": "2024-11-27T19:33:06.874199328" + "timestamp": "2024-11-28T18:32:02.81614763" } } \ No newline at end of file diff --git a/modules/nf-core/nacho/normalize/tests/nextflow.config b/modules/nf-core/nacho/normalize/tests/nextflow.config index e64446a7c4d..b08db067be7 100644 --- a/modules/nf-core/nacho/normalize/tests/nextflow.config +++ b/modules/nf-core/nacho/normalize/tests/nextflow.config @@ -1,7 +1,7 @@ nextflow.enable.moduleBinaries = true process { - withName: 'NACHO_NORMALISE' { + withName: 'NACHO_NORMALIZE' { ext.args = params.module_args } }