Skip to content

Commit

Permalink
Bump shinyngs (#5543)
Browse files Browse the repository at this point in the history
* Bump shinyngs

* Fix containers

* Migrate shinyngs/app to nf-test

* Bump versions again

* Bump conda envs too

* Bump snapshots for versions

* shinyngs/staticexploratory -> nftest

* Appease eclint

---------

Co-authored-by: Adam Talbot <[email protected]>
  • Loading branch information
pinin4fjords and adamrtalbot authored May 2, 2024
1 parent 3f6c1f1 commit 2876a02
Show file tree
Hide file tree
Showing 23 changed files with 475 additions and 192 deletions.
2 changes: 1 addition & 1 deletion modules/nf-core/shinyngs/app/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ channels:
- bioconda
- defaults
dependencies:
- bioconda::r-shinyngs=1.8.5
- bioconda::r-shinyngs=1.8.7
21 changes: 18 additions & 3 deletions modules/nf-core/shinyngs/app/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ process SHINYNGS_APP {

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/r-shinyngs:1.8.5--r43hdfd78af_0' :
'biocontainers/r-shinyngs:1.8.5--r43hdfd78af_0' }"
'https://depot.galaxyproject.org/singularity/r-shinyngs:1.8.7--r43hdfd78af_0' :
'biocontainers/r-shinyngs:1.8.7--r43hdfd78af_0' }"

input:
tuple val(meta), path(sample), path(feature_meta), path(assay_files) // Experiment-level info
Expand Down Expand Up @@ -49,8 +49,23 @@ process SHINYNGS_APP {
cat <<-END_VERSIONS > versions.yml
"${task.process}":
r-base: \$(echo \$(R --version 2>&1) | sed 's/^.*R version //; s/ .*\$//')
r-shinyngs: \$(Rscript -e "library(shinyngs); cat(as.character(packageVersion('shinyngs')))")
END_VERSIONS
"""

stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: meta.id

"""
mkdir -p $prefix
touch ${prefix}/data.rds
touch ${prefix}/app.R
cat <<-END_VERSIONS > versions.yml
"${task.process}":
r-shinyngs: \$(Rscript -e "library(shinyngs); cat(as.character(packageVersion('shinyngs')))")
END_VERSIONS
"""

}
133 changes: 133 additions & 0 deletions modules/nf-core/shinyngs/app/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "shinyngs"
tag "shinyngs/app"

test("mouse - multi matrix") {

config './nextflow.config'

when {
process {
"""
expression_test_data_dir = params.modules_testdata_base_path + 'genomics/mus_musculus/rnaseq_expression/'
expression_sample_sheet = file(expression_test_data_dir + 'SRP254919.samplesheet.csv', checkIfExists: true)
expression_feature_meta = file(expression_test_data_dir + 'SRP254919.gene_meta.tsv', checkIfExists: true)
raw_expression_matrix_file = file(expression_test_data_dir + 'SRP254919.salmon.merged.gene_counts.top1000cov.tsv', checkIfExists: true)
expression_contrasts = file(expression_test_data_dir + 'SRP254919.contrasts.csv', checkIfExists: true)
expression_differential = file(expression_test_data_dir + 'SRP254919.salmon.merged.deseq2.results.tsv', checkIfExists: true)
// Copy some inputs for testing the multi-matrix functionality
raw_expression_matrix_file.copyTo('normalised.tsv')
normalised_expression_matrix_file = file('normalised.tsv')
expression_differential.copyTo('second_contrast_stats.tsv')
second_contrast_stats = file('second_contrast_stats.tsv')
contrast_stats_assay = Channel.value(1)
input[0] = [ [ "id":"SRP254919" ], expression_sample_sheet, expression_feature_meta, [ raw_expression_matrix_file, normalised_expression_matrix_file ] ]
input[1] = [ [ "id":"SRP254919" ], expression_contrasts, [ expression_differential, second_contrast_stats ] ]
input[2] = contrast_stats_assay
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(
file(process.out.app[0][1]).name,
process.out.app[0][2],
process.out.versions
).match() }
)
}
}

test("mouse - single matrix") {

config './nextflow.config'

when {
process {
"""
expression_test_data_dir = params.modules_testdata_base_path + 'genomics/mus_musculus/rnaseq_expression/'
expression_sample_sheet = file(expression_test_data_dir + 'SRP254919.samplesheet.csv', checkIfExists: true)
expression_feature_meta = file(expression_test_data_dir + 'SRP254919.gene_meta.tsv', checkIfExists: true)
raw_expression_matrix_file = file(expression_test_data_dir + 'SRP254919.salmon.merged.gene_counts.top1000cov.tsv', checkIfExists: true)
expression_contrasts = file(expression_test_data_dir + 'SRP254919.contrasts.csv', checkIfExists: true)
expression_differential = file(expression_test_data_dir + 'SRP254919.salmon.merged.deseq2.results.tsv', checkIfExists: true)
// Copy some inputs for testing the multi-matrix functionality
expression_differential.copyTo('second_contrast_stats.tsv')
second_contrast_stats = file('second_contrast_stats.tsv')
contrast_stats_assay = Channel.value(1)
input[0] = [ [ "id":"SRP254919" ], expression_sample_sheet, expression_feature_meta, [ raw_expression_matrix_file ] ]
input[1] = [ [ "id":"SRP254919" ], expression_contrasts, [ expression_differential, second_contrast_stats ] ]
input[2] = contrast_stats_assay
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(
file(process.out.app[0][1]).name,
process.out.app[0][2],
process.out.versions
).match() }
)
}
}

test("mouse - stub") {

options "-stub"

when {
process {
"""
expression_test_data_dir = params.modules_testdata_base_path + 'genomics/mus_musculus/rnaseq_expression/'
expression_sample_sheet = file(expression_test_data_dir + 'SRP254919.samplesheet.csv', checkIfExists: true)
expression_feature_meta = file(expression_test_data_dir + 'SRP254919.gene_meta.tsv', checkIfExists: true)
raw_expression_matrix_file = file(expression_test_data_dir + 'SRP254919.salmon.merged.gene_counts.top1000cov.tsv', checkIfExists: true)
expression_contrasts = file(expression_test_data_dir + 'SRP254919.contrasts.csv', checkIfExists: true)
expression_differential = file(expression_test_data_dir + 'SRP254919.salmon.merged.deseq2.results.tsv', checkIfExists: true)
// Copy some inputs for testing the multi-matrix functionality
expression_differential.copyTo('second_contrast_stats.tsv')
second_contrast_stats = file('second_contrast_stats.tsv')
contrast_stats_assay = Channel.value(1)
input[0] = [ [ "id":"SRP254919" ], expression_sample_sheet, expression_feature_meta, [ raw_expression_matrix_file ] ]
input[1] = [ [ "id":"SRP254919" ], expression_contrasts, [ expression_differential, second_contrast_stats ] ]
input[2] = contrast_stats_assay
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(
file(process.out.app[0][1]).name,
process.out.app[0][2],
process.out.versions
).match() }
)
}
}
}
44 changes: 44 additions & 0 deletions modules/nf-core/shinyngs/app/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"mouse - stub": {
"content": [
"data.rds",
"app.R:md5,d41d8cd98f00b204e9800998ecf8427e",
[
"versions.yml:md5,09111b64e01c10c1c0788e9700488e5c"
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.1"
},
"timestamp": "2024-05-02T15:29:41.473618"
},
"mouse - multi matrix": {
"content": [
"data.rds",
"app.R:md5,bedcfc45b6cdcc2b8fe3627987e2b17a",
[
"versions.yml:md5,09111b64e01c10c1c0788e9700488e5c"
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.1"
},
"timestamp": "2024-05-02T15:29:06.587538"
},
"mouse - single matrix": {
"content": [
"data.rds",
"app.R:md5,bedcfc45b6cdcc2b8fe3627987e2b17a",
[
"versions.yml:md5,09111b64e01c10c1c0788e9700488e5c"
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.1"
},
"timestamp": "2024-05-02T15:29:26.649048"
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
process {

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

//withName: test_shinyngs_app:SHINYNGS_APP {
// secret 'SHINYAPPS_TOKEN'
// secret 'SHINYAPPS_SECRET'
//}

withName: test_shinyngs_app:SHINYNGS_APP {
ext.prefix = { "${meta.id}_test" }
ext.args = { "--contrast_stats_assay 1" }
Expand Down
2 changes: 2 additions & 0 deletions modules/nf-core/shinyngs/app/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
shinyngs/app:
- "modules/nf-core/shinyngs/app/**"
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ channels:
- bioconda
- defaults
dependencies:
- bioconda::r-shinyngs=1.8.5
- bioconda::r-shinyngs=1.8.7
4 changes: 2 additions & 2 deletions modules/nf-core/shinyngs/staticdifferential/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ process SHINYNGS_STATICDIFFERENTIAL {

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/r-shinyngs:1.8.5--r43hdfd78af_0' :
'biocontainers/r-shinyngs:1.8.5--r43hdfd78af_0' }"
'https://depot.galaxyproject.org/singularity/r-shinyngs:1.8.7--r43hdfd78af_0' :
'biocontainers/r-shinyngs:1.8.7--r43hdfd78af_0' }"

input:
tuple val(meta), path(differential_result) // Differential info: contrast and differential stats
Expand Down
2 changes: 1 addition & 1 deletion modules/nf-core/shinyngs/staticexploratory/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ channels:
- bioconda
- defaults
dependencies:
- bioconda::r-shinyngs=1.8.5
- bioconda::r-shinyngs=1.8.7
28 changes: 25 additions & 3 deletions modules/nf-core/shinyngs/staticexploratory/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ process SHINYNGS_STATICEXPLORATORY {

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/r-shinyngs:1.8.5--r43hdfd78af_0' :
'biocontainers/r-shinyngs:1.8.5--r43hdfd78af_0' }"
'https://depot.galaxyproject.org/singularity/r-shinyngs:1.8.7--r43hdfd78af_0' :
'biocontainers/r-shinyngs:1.8.7--r43hdfd78af_0' }"

input:
tuple val(meta), path(sample), path(feature_meta), path(assay_files)
Expand Down Expand Up @@ -43,7 +43,29 @@ process SHINYNGS_STATICEXPLORATORY {
cat <<-END_VERSIONS > versions.yml
"${task.process}":
r-base: \$(echo \$(R --version 2>&1) | sed 's/^.*R version //; s/ .*\$//')
r-shinyngs: \$(Rscript -e "library(shinyngs); cat(as.character(packageVersion('shinyngs')))")
END_VERSIONS
"""

stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: meta.id
"""
mkdir -p ${prefix}/png ${prefix}/html
touch ${prefix}/png/boxplot.png
touch ${prefix}/html/boxplot.html
touch ${prefix}/png/density.png
touch ${prefix}/html/density.html
touch ${prefix}/png/pca2d.png
touch ${prefix}/html/pca3d.html
touch ${prefix}/png/pca3d.png
touch ${prefix}/html/pca2d.html
touch ${prefix}/png/mad_correlation.png
touch ${prefix}/html/mad_correlation.html
touch ${prefix}/png/sample_dendrogram.png
cat <<-END_VERSIONS > versions.yml
"${task.process}":
r-shinyngs: \$(Rscript -e "library(shinyngs); cat(as.character(packageVersion('shinyngs')))")
END_VERSIONS
"""
Expand Down
Loading

0 comments on commit 2876a02

Please sign in to comment.