Skip to content

Commit

Permalink
New Module: NACHO_QC (#7108)
Browse files Browse the repository at this point in the history
* initialize module

* update test

* Remove TO-DO from main.nf.test

* Remove comment from main.nf.test

* update test after meta component in output channels

* split channel into png and txt outputs

* update meta file

* move moduleBinaries to test nextflow config
  • Loading branch information
alanmmobbs93 authored Nov 29, 2024
1 parent 8aa4eca commit 06093bb
Show file tree
Hide file tree
Showing 7 changed files with 617 additions and 0 deletions.
12 changes: 12 additions & 0 deletions modules/nf-core/nacho/qc/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +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
77 changes: 77 additions & 0 deletions modules/nf-core/nacho/qc/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
process NACHO_QC {
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:
tuple val(meta) , path(rcc_files, stageAs: "input/*")
tuple val(meta2), path(sample_sheet)

output:
tuple val(meta), path("*.html") , emit: nacho_qc_reports
tuple val(meta), path("*_mqc.png"), emit: nacho_qc_png
tuple val(meta), path("*_mqc.txt"), emit: nacho_qc_txt
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''

"""
nacho_qc.R \\
--input_rcc_path input \\
--input_samplesheet ${sample_sheet}
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')))")
r-optparse: \$(Rscript -e "library(optparse); cat(as.character(packageVersion('optparse')))")
END_VERSIONS
"""

stub:
"""
touch qc.html
touch qc_with_outliers.html
touch AVG_vs_BD_mqc.png
touch AVG_vs_MED_mqc.png
touch BD_mqc.png
touch FOV_mqc.png
touch HKF_mqc.png
touch HK_mqc.png
touch LOD_mqc.png
touch Neg_mqc.png
touch PCA1_vs_PCA2_mqc.png
touch PCAi_mqc.png
touch PCA_mqc.png
touch plot_normf_mqc.png
touch Posctrl_linearity_mqc.png
touch POSF_vs_NEGF_mqc.png
touch Pos_mqc.png
touch Pos_vs_neg_mqc.png
touch normalized_qc_mqc.txt
touch hk_detected_mqc.txt
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')))")
r-optparse: \$(Rscript -e "library(optparse); cat(as.character(packageVersion('optparse')))")
END_VERSIONS
"""
}
89 changes: 89 additions & 0 deletions modules/nf-core/nacho/qc/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: nacho_qc
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:
- nacho
- nanostring
- mRNA
- miRNA
- qc
tools:
- 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: "10.1093/bioinformatics/btz647"
licence: [ "GPL-3.0" ]
identifier: ""
input:
- - 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:
- nacho_qc_reports:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test' ]
- "*.html":
type: file
description: |
HTML report
pattern: "*.html"
- nacho_qc_png:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test' ]
- "*_mqc.png":
type: file
description: |
Output PNG files
pattern: "*_mqc.png"
- nacho_qc_txt:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test' ]
- "*_mqc.txt":
type: file
description: |
Plain text reports
pattern: "*_mqc.txt"
- versions:
- "versions.yml":
type: file
description: |
File containing software versions
pattern: "versions.yml"
authors:
- "@alanmmobbs93"
maintainers:
- "@alanmmobbs93"
Loading

0 comments on commit 06093bb

Please sign in to comment.