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

Validate YML contrasts #436

Open
wants to merge 54 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
f69703b
init script
alanmmobbs93 Dec 13, 2024
352a6fc
add function to check samplesheet
alanmmobbs93 Dec 16, 2024
afa2472
add check model code
alanmmobbs93 Dec 17, 2024
9e42bdd
POC ready
alanmmobbs93 Dec 18, 2024
c2f666f
change function structure
alanmmobbs93 Dec 18, 2024
6614f4d
fix bug in module
alanmmobbs93 Dec 18, 2024
d9d18c5
update yml structure input limited to contrasts only
alanmmobbs93 Dec 19, 2024
887332d
Merge branch 'dev' of https://github.com/nf-core/differentialabundanc…
nschcolnicov Dec 20, 2024
d90a576
Updated changelog
nschcolnicov Dec 20, 2024
34ca6ec
Update ci.yml and rever changes in nf-core module
nschcolnicov Dec 20, 2024
ec554b2
Merge pull request #382 from nf-core/issue_370
nschcolnicov Dec 20, 2024
3834865
Merge branch 'dev_tmp' into newfeature_validate_model
alanmmobbs93 Dec 20, 2024
bc3859a
Update tabulartogseachip
nschcolnicov Dec 20, 2024
5cc6fd0
update modules.config
nschcolnicov Dec 20, 2024
ae39a00
Updated snaps
nschcolnicov Dec 20, 2024
8597c2b
Merge pull request #412 from nf-core/update_tabulartogseachip
nschcolnicov Dec 20, 2024
6dafd95
Add condition to execute the module and update snaps
alanmmobbs93 Dec 20, 2024
2ee77d0
Merge branch 'dev_tmp' into newfeature_validate_model
alanmmobbs93 Dec 20, 2024
d40becf
Merge branch 'dev_tmp' into newfeature_validate_model
alanmmobbs93 Dec 20, 2024
89cb7bc
Merge branch 'newfeature_validate_model' of https://github.com/alanmm…
alanmmobbs93 Dec 20, 2024
17e1e37
address PR comments
alanmmobbs93 Dec 21, 2024
6ed0793
update snaps
alanmmobbs93 Dec 21, 2024
964bef1
chore: remove dev_tmp from test branches
atrigila Feb 13, 2025
d6885b7
chore: rename validate_model to validate_yml_model
atrigila Feb 13, 2025
4bb3a23
Merge branch 'dev' into feature-validate-model
atrigila Feb 13, 2025
11d558a
chore: separate csv vs yml test
atrigila Feb 13, 2025
5ab2976
refact: move yml validation to params.contrasts_yml
atrigila Feb 13, 2025
cc3d7a0
chore: change local for nf-core version
atrigila Feb 13, 2025
801f1c5
fix: update input contrasts file to contrasts_yml params
atrigila Feb 13, 2025
b0a6fda
test: update tests
atrigila Feb 13, 2025
34d40fb
Merge branch 'dev' into feature-validate-model
atrigila Feb 14, 2025
de5025b
test: update snapshots
atrigila Feb 14, 2025
b4c693f
test: update snapshot
atrigila Feb 14, 2025
f531ba2
chore: remove unused local module
atrigila Feb 17, 2025
59fb2fa
docs: update changelog
atrigila Feb 17, 2025
295e863
chore: remove unused module backup
atrigila Feb 17, 2025
a5d0ea2
chore: remove unused old template line
atrigila Feb 17, 2025
bc920c3
refact: adapt R code to template
atrigila Feb 19, 2025
edc56f1
refact: adapt to template structure
atrigila Feb 19, 2025
f2b97ed
test: update test and snapshot
atrigila Feb 19, 2025
8977b86
Merge branch 'dev' into feature-validate-model
atrigila Feb 20, 2025
a773933
test: add gsea seed and update snapshot
atrigila Feb 20, 2025
2ab6388
Merge branch 'dev' into feature-validate-model
atrigila Feb 20, 2025
9043cd3
test: update snapshots after dev merge
atrigila Feb 20, 2025
82ff806
Merge branch 'dev' into feature-validate-model
atrigila Feb 21, 2025
a946e08
refact: change code to roxygen style
atrigila Feb 24, 2025
c3d5a6e
refact: pass more meaningful params
atrigila Feb 24, 2025
b4aec27
docs: add meta.yml to local module
atrigila Feb 24, 2025
84fe7a2
test: update snapshots
atrigila Feb 24, 2025
3b7c470
refact: replace module_args for sample_id_col
atrigila Feb 24, 2025
3fa6012
fix: fix linting issues
atrigila Feb 24, 2025
0be1720
docs: remove unused sections, add new info
atrigila Feb 24, 2025
4891c6c
revert: environment.yml equal to nf-core module
atrigila Feb 24, 2025
4e3c82b
Update modules/local/validatemodel/templates/validate_model.R
atrigila Feb 24, 2025
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [[#345](https://github.com/nf-core/differentialabundance/pull/345)] - Plot differentially expressed genes by gene biotype ([@atrigila](https://github.com/atrigila), review by [@grst](https://github.com/grst))
- [[#343](https://github.com/nf-core/differentialabundance/pull/343)] - Add pipeline-level nf-tests ([@atrigila](https://github.com/atrigila), review by [@pinin4fjords](https://github.com/pinin4fjords) and [@nschcolnicov](https://github.com/nschcolnicov))
- [[#286](https://github.com/nf-core/differentialabundance/pull/286)] - Integration of limma voom for rnaseq data ([@KamilMaliszArdigen](https://github.com/KamilMaliszArdigen), review by [@pinin4fjords](https://github.com/pinin4fjords))
- [[#463](https://github.com/nf-core/differentialabundance/pull/463)] - Replace local tabulartogseachip with nf-core version. Add YML validation module. (developed by [@alanmmobbs93](https://github.com/alanmmobbs93) and [@nschcolnicov](https://github.com/nschcolnicov), review by [@grst](https://github.com/grst), [@nschcolnicov](https://github.com/nschcolnicov), [@pinin4fjords](https://github.com/pinin4fjords) and [@suzannejin](https://github.com/suzannejin))

### Fixed

Expand Down
15 changes: 15 additions & 0 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,21 @@ process {
ext.args = "--sample_id_col '${params.observations_id_col}' --feature_id_col '${params.features_id_col}'"
}

withName: VALIDATE_YML_MODEL {
ext.args = {
params.observations_name_col ?
"--sample_id_col ${params.observations_name_col}" :
params.observations_id_col ?
"--sample_id_col ${params.observations_id_col}" :
''
}
publishDir = [
path: { "${params.outdir}/validate" },
mode: params.publish_dir_mode,
]

}

withName: AFFY_JUSTRMA_RAW {
publishDir = [
[
Expand Down
8 changes: 8 additions & 0 deletions modules/local/validatemodel/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
channels:
- conda-forge
- bioconda
dependencies:
- conda-forge::r-jsonlite
- conda-forge::r-optparse
- conda-forge::r-tidyverse
- conda-forge::r-yaml
40 changes: 40 additions & 0 deletions modules/local/validatemodel/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
process VALIDATE_YML_MODEL {
tag "${models_yml}"
label 'process_single'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/f5/f5ef116da0b04fc6359efa48f08b9acfc040a02d7a1ec62476c77b6db0fc1499/data' :
'community.wave.seqera.io/library/r-jsonlite_r-optparse_r-tidyverse_r-yaml:18dc3fc2d990206d' }"

input:
tuple val(meta), path(samplesheet)
tuple val(meta2), path(models_yml)

output:
tuple val(meta), path("pheno_table.csv"), emit: pheno_table
tuple val(meta), path("designs.json") , emit: designs
tuple val(meta), path("warnings.json") , emit: warnings, optional: true
path "versions.yml" , emit: versions

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

script:
template 'validate_model.R'

stub:
"""
touch pheno_table.csv
touch designs.json
touch warnings.json

cat <<-END_VERSIONS > versions.yml
"${task.process}":
r-base: \$(Rscript -e 'R.Version()\$version.string' | sed -n 's|\\[1\\] "R version \\(.*\\) (.*|\\1|p')
tidyverse: \$(Rscript -e "cat(paste(packageVersion('tidyverse'), collapse='.'))")
yaml: \$(Rscript -e "cat(paste(packageVersion('yaml'), collapse='.'))")
jsonlite: \$(Rscript -e "cat(paste(packageVersion('jsonlite'), collapse='.'))")
END_VERSIONS
"""
}
74 changes: 74 additions & 0 deletions modules/local/validatemodel/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: "validate_yml_model"
description: "Validate a YAML model file and generate phenotype table, experimental designs, warnings, and software versions outputs."
keywords:
- validation
- yaml
- model
tools:
- "R":
description: "R programming language for statistical computing"
homepage: "https://www.r-project.org/"
licence: ["GPL >=2"]
- "tidyverse":
description: "Collection of R packages for data manipulation and visualization"
homepage: "https://www.tidyverse.org/"
licence: ["MIT"]
- "jsonlite":
description: "jsonlite: A Simple and Robust JSON Parser and Generator for R"
homepage: "https://cran.r-project.org/web/packages/jsonlite/index.html"
licence: ["MIT"]
- "yaml":
description: "yaml: Methods to Convert R Data to YAML and Back"
homepage: "https://cran.r-project.org/web/packages/yaml/index.html"
licence: ["BSD 3"]

input:
- - meta:
type: map
description: "Groovy map containing sample metadata (e.g., [ id:'sample1' ])"
- samplesheet:
type: file
description: "CSV or TSV sample sheet with metadata and file names"
pattern: "*.csv, *.tsv"
- - meta2:
type: map
description: "Groovy map containing model metadata (e.g., [ id:'sample1' ])"
- models_yml:
type: file
description: "YAML file defining model parameters and configuration"
pattern: "*.yml, *.yaml"

output:
- pheno_table:
- meta:
type: map
description: "Groovy map containing sample metadata"
- "pheno_table.csv":
type: file
description: "CSV file with phenotype table derived from the model"
pattern: "pheno_table.csv"
- designs:
- meta:
type: map
description: "Groovy map containing sample metadata"
- "designs.json":
type: file
description: "JSON file containing experimental designs"
pattern: "designs.json"
- warnings:
- meta:
type: map
description: "Groovy map containing sample metadata"
- "warnings.json":
type: file
description: "Optional JSON file with warnings and validation notes"
pattern: "warnings.json"
optional: true
- versions:
- versions.yml:
type: file
description: "YAML file recording versions of software used during validation"
pattern: "versions.yml"

authors:
- "@alanmmobbs93"
Loading