Skip to content

Commit

Permalink
Added schema validation settings
Browse files Browse the repository at this point in the history
  • Loading branch information
nschcolnicov committed Dec 20, 2024
1 parent bbb7344 commit 65eb7e4
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 1 deletion.
39 changes: 39 additions & 0 deletions assets/schema_contrasts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://example.com/schemas/schema_contrasts.json",
"title": "nf-core/differentialabundance pipeline - params.contrasts schema",
"description": "Schema for the file provided with params.contrasts",
"type": "object",
"properties": {
"contrasts": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"comparison": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
},
"blocking_factors": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"required": ["id", "comparison"],
"additionalProperties": false
},
"minItems": 1
}
},
"required": ["contrasts"],
"additionalProperties": false
}
2 changes: 1 addition & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ manifest {

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

validation {
Expand Down
1 change: 1 addition & 0 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"description": "A CSV file describing sample contrasts",
"help_text": "This file is used to define groups of samples from 'input' to compare. It must contain at least the columns 'variable', 'reference', 'target' and 'blocking', where 'variable' is a column in the input sample sheet, 'reference' and 'target' are values in that column, and blocking is a colon-separated list of additional 'blocking' variables (can be an empty string)",
"pattern": "^\\S+\\.(yaml|yml|csv)$",
"schema": "assets/schema_contrasts.json",
"format": "file-path",
"mimetype": "text/csv",
"fa_icon": "fas fa-adjust"
Expand Down

0 comments on commit 65eb7e4

Please sign in to comment.