Skip to content

Commit

Permalink
Merge pull request #174 from nf-cmgg/migrate-to-nf-schema
Browse files Browse the repository at this point in the history
Migrate to nf schema
  • Loading branch information
nvnieuwk authored Apr 23, 2024
2 parents d64431c + 45a11fc commit a5cc150
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 22 deletions.
2 changes: 1 addition & 1 deletion 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/germline/master/assets/schema_input.json",
"title": "Samplesheet validation schema",
"description": "Schema for the samplesheet used in this pipeline",
Expand Down
13 changes: 8 additions & 5 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,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 @@ -250,7 +246,14 @@ singularity.registry = 'quay.io'

// Nextflow plugins
plugins {
id '[email protected]' // Validation of pipeline parameters and creation of an input channel from a sample sheet
id '[email protected]' // 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
18 changes: 9 additions & 9 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/germline/master/nextflow_schema.json",
"title": "nf-cmgg/germline pipeline parameters",
"description": "A nextflow pipeline for calling and annotating variants",
"type": "object",
"definitions": {
"defs": {
"input_output_options": {
"title": "Input/output options",
"type": "object",
Expand Down Expand Up @@ -682,25 +682,25 @@
},
"allOf": [
{
"$ref": "#/definitions/input_output_options"
"$ref": "#/defs/input_output_options"
},
{
"$ref": "#/definitions/reference_genome_options"
"$ref": "#/defs/reference_genome_options"
},
{
"$ref": "#/definitions/pipeline_specific_parameters"
"$ref": "#/defs/pipeline_specific_parameters"
},
{
"$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"
},
{
"$ref": "#/definitions/annotation_parameters"
"$ref": "#/defs/annotation_parameters"
}
]
}
6 changes: 3 additions & 3 deletions subworkflows/local/utils_cmgg_germline_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 @@ -84,7 +84,7 @@ workflow PIPELINE_INITIALISATION {
// Output the samplesheet
file(params.input).copyTo("${params.outdir}/samplesheet.csv")

Channel.fromSamplesheet("input")
Channel.fromList(samplesheetToList(params.input, "assets/schema_input.json"))
.map { meta, cram, crai, gvcf, tbi, roi, ped, truth_vcf, truth_tbi, truth_bed ->
// Infer the family ID from the PED file if no family ID was given.
// If no PED is given, use the sample ID as family ID
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.

2 changes: 1 addition & 1 deletion workflows/germline.nf
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ ch_multiqc_logo = params.multiqc_logo ? file(params.multiqc_logo, checkIfE
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

include { paramsSummaryMap } from 'plugin/nf-validation'
include { paramsSummaryMap } from 'plugin/nf-schema'
include { paramsSummaryMultiqc } from '../subworkflows/nf-core/utils_nfcore_pipeline'
include { softwareVersionsToYAML } from '../subworkflows/nf-core/utils_nfcore_pipeline'
include { methodsDescriptionText } from '../subworkflows/local/utils_cmgg_germline_pipeline'
Expand Down

0 comments on commit a5cc150

Please sign in to comment.