Skip to content

Commit

Permalink
migrate to nf-schema
Browse files Browse the repository at this point in the history
  • Loading branch information
nvnieuwk committed Apr 23, 2024
1 parent 39f0f15 commit 5707f6c
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 306 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changes

1. Updated the pipeline template to nf-core v2.13.1
2. Migrate from nf-validation to nf-schema

## v1.1.0 - Naive Junior - [15 Sep 2023]

Expand Down
11 changes: 7 additions & 4 deletions assets/schema_input.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://raw.githubusercontent.com/nf-cmgg/wisecondorx/master/assets/schema_input.json",
"title": "nf-cmgg/wisecondorx pipeline - params.input schema",
"description": "Schema for the file provided with params.input",
Expand All @@ -10,16 +10,19 @@
"cram": {
"type": "string",
"pattern": "^\\S+\\.(b|cr)am$",
"format": "file-path"
"format": "file-path",
"exists": true
},
"crai": {
"type": "string",
"pattern": "^\\S+\\.(b|cr)ai$",
"format": "file-path"
"format": "file-path",
"exists": true
},
"gender": {
"type": "string",
"pattern": "^(male|female)$",
"errorMessage": "The gender needs to be either 'male' or 'female'",
"enum": ["male", "female"],
"meta": ["gender"]
}
},
Expand Down
6 changes: 3 additions & 3 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ params.fai = getGenomeAttribute('fai')
IMPORT FUNCTIONS / MODULES / SUBWORKFLOWS / WORKFLOWS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
include { paramsSummaryLog } from 'plugin/nf-validation'
include { paramsHelp } from 'plugin/nf-validation'
include { validateParameters } from 'plugin/nf-validation'
include { paramsSummaryLog } from 'plugin/nf-schema'
include { paramsHelp } from 'plugin/nf-schema'
include { validateParameters } from 'plugin/nf-schema'
include { WISECONDORX } from './workflows/wisecondorx'
include { PIPELINE_INITIALISATION } from './subworkflows/local/utils_nfcore_wisecondorx_pipeline'
include { PIPELINE_COMPLETION } from './subworkflows/local/utils_nfcore_wisecondorx_pipeline'
Expand Down
13 changes: 8 additions & 5 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ params {
max_time = '240.h'

// Schema validation default options
validationFailUnrecognisedParams = false
validationLenientMode = false
validationSchemaIgnoreParams = 'genomes,igenomes_base,test_data'
validationShowHiddenParams = false
validate_params = true

}
Expand Down Expand Up @@ -192,7 +188,14 @@ singularity.registry = 'quay.io'

// Nextflow plugins
plugins {
id 'nf-validation@1.1.3' // Validation of pipeline parameters and creation of an input channel from a sample sheet
id 'nf-schema@2.0.0' // Validation of pipeline parameters and creation of an input channel from a sample sheet
}

validation {
failUnrecognisedParams = false
lenientMode = false
defaultIgnoreParams = ['genomes','igenomes_base','test_data']
showHiddenParams = false
}

// Load igenomes.config if required
Expand Down
16 changes: 8 additions & 8 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://raw.githubusercontent.com/nf-cmgg/wisecondorx/master/nextflow_schema.json",
"title": "nf-cmgg/wisecondorx pipeline parameters",
"description": "A nextflow pipeline for creating references for WisecondorX",
"type": "object",
"definitions": {
"defs": {
"input_output_options": {
"title": "Input/output options",
"type": "object",
Expand Down Expand Up @@ -325,22 +325,22 @@
},
"allOf": [
{
"$ref": "#/definitions/input_output_options"
"$ref": "#/defs/input_output_options"
},
{
"$ref": "#/definitions/other_options"
"$ref": "#/defs/other_options"
},
{
"$ref": "#/definitions/reference_genome_options"
"$ref": "#/defs/reference_genome_options"
},
{
"$ref": "#/definitions/institutional_config_options"
"$ref": "#/defs/institutional_config_options"
},
{
"$ref": "#/definitions/max_job_request_options"
"$ref": "#/defs/max_job_request_options"
},
{
"$ref": "#/definitions/generic_options"
"$ref": "#/defs/generic_options"
}
]
}
6 changes: 3 additions & 3 deletions subworkflows/local/utils_nfcore_wisecondorx_pipeline/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
*/

include { UTILS_NFVALIDATION_PLUGIN } from '../../nf-core/utils_nfvalidation_plugin'
include { paramsSummaryMap } from 'plugin/nf-validation'
include { fromSamplesheet } from 'plugin/nf-validation'
include { paramsSummaryMap } from 'plugin/nf-schema'
include { samplesheetToList } from 'plugin/nf-schema'
include { UTILS_NEXTFLOW_PIPELINE } from '../../nf-core/utils_nextflow_pipeline'
include { completionEmail } from '../../nf-core/utils_nfcore_pipeline'
include { completionSummary } from '../../nf-core/utils_nfcore_pipeline'
Expand Down Expand Up @@ -81,7 +81,7 @@ workflow PIPELINE_INITIALISATION {
// Create channel from input file provided through params.input
//

Channel.fromSamplesheet("input")
Channel.fromList(samplesheetToList(params.input, "assets/schema_input.json"))
.set { ch_samplesheet }

emit:
Expand Down
6 changes: 3 additions & 3 deletions subworkflows/nf-core/utils_nfvalidation_plugin/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5707f6c

Please sign in to comment.