Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
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/minion/qcbench/master/assets/schema_input.json",
"title": "minion-qcbench pipeline - params.input schema",
"description": "Schema for the file provided with params.input",
Expand Down
34 changes: 17 additions & 17 deletions conf/base.config
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
process {

// TODO nf-core: Check the defaults for all processes
cpus = { check_max( 1 * task.attempt, 'cpus' ) }
memory = { check_max( 6.GB * task.attempt, 'memory' ) }
time = { check_max( 4.h * task.attempt, 'time' ) }
cpus = { 1 * task.attempt }
memory = { 6.GB * task.attempt }
time = { 4.h * task.attempt }

errorStrategy = { task.exitStatus in ((130..145) + 104) ? 'retry' : 'finish' }
maxRetries = 1
Expand All @@ -27,30 +27,30 @@ process {
// TODO nf-core: Customise requirements for specific processes.
// See https://www.nextflow.io/docs/latest/config.html#config-process-selectors
withLabel:process_single {
cpus = { check_max( 1 , 'cpus' ) }
memory = { check_max( 6.GB * task.attempt, 'memory' ) }
time = { check_max( 4.h * task.attempt, 'time' ) }
cpus = { 1 }
memory = { 6.GB * task.attempt }
time = { 4.h * task.attempt }
}
withLabel:process_low {
cpus = { check_max( 2 * task.attempt, 'cpus' ) }
memory = { check_max( 12.GB * task.attempt, 'memory' ) }
time = { check_max( 4.h * task.attempt, 'time' ) }
cpus = { 2 * task.attempt }
memory = { 12.GB * task.attempt }
time = { 4.h * task.attempt }
}
withLabel:process_medium {
cpus = { check_max( 6 * task.attempt, 'cpus' ) }
memory = { check_max( 36.GB * task.attempt, 'memory' ) }
time = { check_max( 8.h * task.attempt, 'time' ) }
cpus = { 6 * task.attempt }
memory = { 36.GB * task.attempt }
time = { 8.h * task.attempt }
}
withLabel:process_high {
cpus = { check_max( 12 * task.attempt, 'cpus' ) }
memory = { check_max( 72.GB * task.attempt, 'memory' ) }
time = { check_max( 16.h * task.attempt, 'time' ) }
cpus = { 12 * task.attempt }
memory = { 72.GB * task.attempt }
time = { 16.h * task.attempt }
}
withLabel:process_long {
time = { check_max( 20.h * task.attempt, 'time' ) }
time = { 20.h * task.attempt }
}
withLabel:process_high_memory {
memory = { check_max( 200.GB * task.attempt, 'memory' ) }
memory = { 200.GB * task.attempt }
}
withLabel:error_ignore {
errorStrategy = 'ignore'
Expand Down
15 changes: 9 additions & 6 deletions conf/test.config
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,22 @@
----------------------------------------------------------------------------------------
*/

process {
resourceLimits = [
cpus: 4,
memory: '15.GB',
time: '1.h'
]
}

params {
config_profile_name = 'Test profile'
config_profile_description = 'Minimal test dataset to check pipeline function'

// Limit resources so that this can run on GitHub Actions
max_cpus = 2
max_memory = '6.GB'
max_time = '6.h'

// Input data
input = params.pipelines_testdata_base_path + 'test_samplesheet.csv'
outdir = 'results'

quality_scores = '13,15'
flye_modes = 'nano-raw,nano-corr'
}
4 changes: 2 additions & 2 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ workflow {
//
PIPELINE_INITIALISATION (
params.version,
params.help,
// params.help,
params.validate_params,
params.monochrome_logs,
args,
params.outdir,
params.input
)

//
// WORKFLOW: Run main workflow
//
Expand Down
5 changes: 5 additions & 0 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@
"branch": "master",
"git_sha": "5caf7640a9ef1d18d765d55339be751bb0969dfa",
"installed_by": ["subworkflows"]
},
"utils_nfschema_plugin": {
"branch": "master",
"git_sha": "2fd2cd6d0e7b273747f32e465fdc6bcc3ae0814e",
"installed_by": ["subworkflows"]
}
}
}
Expand Down
32 changes: 23 additions & 9 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ params {

// Flye options
flye_modes = null // fyle modes representing the underlying sequencing technology (supported options: pacbio-raw, pacbio-corr, pacbio-hifi, nano-raw, nano-corr, nano-hq)
flye_genome_size = null // estimated genome size e.g. 4.4m
flye_genome_size = null // estimated genome size e.g. 4.4m

// QUAST options
quast_refseq = null // path to reference genome file
Expand All @@ -38,19 +38,24 @@ params {

// Max resource options
// Defaults only, expecting to be overwritten
/*
max_memory = '128.GB'
max_cpus = 16
max_time = '240.h'
*/

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

}

process {
resourceLimits = [
cpus: 16,
memory: '128.GB',
time: '6.h'
]
}

// Load base.config by default for all pipelines
includeConfig 'conf/base.config'

Expand Down Expand Up @@ -166,7 +171,7 @@ 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.4.1' // Validation of pipeline parameters and creation of an input channel from a sample sheet
}

// Export these variables to prevent local Python/R libraries from conflicting with those in the container
Expand Down Expand Up @@ -207,19 +212,27 @@ dag {
manifest {
name = 'minion-qcbench'
author = """Thu Thao Nguyen"""
homePage = 'https://github.com/minion/qcbench'
homePage = 'https://github.com/ththng/minion-qcbench'
description = """Benchmarking quality control tools for MinION data"""
mainScript = 'main.nf'
nextflowVersion = '!>=22.10.6'
nextflowVersion = '!>=24.0.0'
version = '1.0dev'
doi = ''
}

validation {
help {
enabled = true
command = "nextflow run ${manifest.name} -profile <docker/singularity/.../institute> --input samplesheet.csv --outdir <OUTDIR> --quality_scores <SCORE1,SCORE2,...> --flye_modes <FLYE_MODE1,FLYE_MODE2,...>"
}
}

// Load modules.config for DSL2 module specific options
includeConfig 'conf/modules.config'

// Function to ensure that resource requirements don't go beyond
// a maximum limit
/*
def check_max(obj, type) {
if (type == 'memory') {
try {
Expand Down Expand Up @@ -250,3 +263,4 @@ def check_max(obj, type) {
}
}
}
*/
33 changes: 6 additions & 27 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/minion/qcbench/master/nextflow_schema.json",
"title": "minion/qcbench pipeline parameters",
"description": "Benchmarking quality control tools for MinION data",
"type": "object",
"definitions": {
"$defs": {
"input_output_options": {
"title": "Input/output options",
"type": "object",
Expand Down Expand Up @@ -128,27 +128,6 @@
"fa_icon": "fas fa-check-square",
"hidden": true
},
"validationShowHiddenParams": {
"type": "boolean",
"fa_icon": "far fa-eye-slash",
"description": "Show all params when using `--help`",
"hidden": true,
"help_text": "By default, parameters set as _hidden_ in the schema are not shown on the command line when a user runs with `--help`. Specifying this option will tell the pipeline to show all parameters."
},
"validationFailUnrecognisedParams": {
"type": "boolean",
"fa_icon": "far fa-check-circle",
"description": "Validation of parameters fails when an unrecognised parameter is found.",
"hidden": true,
"help_text": "By default, when an unrecognised parameter is found, it returns a warinig."
},
"validationLenientMode": {
"type": "boolean",
"fa_icon": "far fa-check-circle",
"description": "Validation of parameters in lenient more.",
"hidden": true,
"help_text": "Allows string values that are parseable as numbers or booleans. For further information see [JSONSchema docs](https://github.com/everit-org/json-schema#lenient-mode)."
},
"pipelines_testdata_base_path": {
"type": "string",
"fa_icon": "far fa-check-circle",
Expand All @@ -161,16 +140,16 @@
},
"allOf": [
{
"$ref": "#/definitions/input_output_options"
"$ref": "#/$defs/input_output_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"
}
],
"properties": {
Expand Down
1 change: 1 addition & 0 deletions null/pipeline_info/execution_trace_2025-05-25_16-18-38.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
task_id hash native_id name status exit submit duration realtime %cpu peak_rss peak_vmem rchar wchar
1 change: 1 addition & 0 deletions null/pipeline_info/execution_trace_2025-05-25_16-20-16.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
task_id hash native_id name status exit submit duration realtime %cpu peak_rss peak_vmem rchar wchar
30 changes: 21 additions & 9 deletions subworkflows/local/utils_nfcore_qcbench_pipeline/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
*/

include { UTILS_NFVALIDATION_PLUGIN } from '../../nf-core/utils_nfvalidation_plugin'
include { paramsSummaryMap } from 'plugin/nf-validation'
include { fromSamplesheet } from 'plugin/nf-validation'
include { UTILS_NFSCHEMA_PLUGIN } from '../../nf-core/utils_nfschema_plugin'
include { paramsSummaryMap } from 'plugin/nf-schema'
include { samplesheetToList } from 'plugin/nf-schema'
include { UTILS_NEXTFLOW_PIPELINE } from '../../nf-core/utils_nextflow_pipeline'
include { completionSummary } from '../../nf-core/utils_nfcore_pipeline'
include { dashedLine } from '../../nf-core/utils_nfcore_pipeline'
Expand All @@ -27,7 +28,7 @@ workflow PIPELINE_INITIALISATION {

take:
version // boolean: Display version and exit
help // boolean: Display help text
// help // boolean: Display help text
validate_params // boolean: Boolean whether to validate parameters against the schema at runtime
monochrome_logs // boolean: Do not use coloured log outputs
nextflow_cli_args // array: List of positional nextflow CLI args
Expand All @@ -51,17 +52,28 @@ workflow PIPELINE_INITIALISATION {
//
// Validate parameters and generate parameter summary to stdout
//
/*
pre_help_text = workflowHeader(monochrome_logs)
post_help_text = '\n'
def String workflow_command = "nextflow run ${workflow.manifest.name} -profile <docker/singularity/.../institute> --input samplesheet.csv --outdir <OUTDIR> --quality_scores <SCORE1,SCORE2,...> --flye_modes <FLYE_MODE1,FLYE_MODE2,...>"
UTILS_NFVALIDATION_PLUGIN (
help,
workflow_command,
pre_help_text,
post_help_text,
// help,
// workflow_command,
// pre_help_text,
// post_help_text,
validate_params,
"nextflow_schema.json"
)
*/

//
// Validate parameters and generate parameter summary to stdout
//
UTILS_NFSCHEMA_PLUGIN (
workflow,
validate_params,
null
)

//
// Check config provided to the pipeline
Expand All @@ -74,7 +86,7 @@ workflow PIPELINE_INITIALISATION {
// Create channel from input file provided through params.input
//
Channel
.fromSamplesheet("input")
.fromList(samplesheetToList(params.input, "${projectDir}/assets/schema_input.json"))
.map {
meta, fastq ->
return [ meta + [ single_end:true ], [ fastq ] ]
Expand Down Expand Up @@ -141,7 +153,7 @@ def create_flye_samplesheet(ch_samplesheet, modes) {
modes.collect { mode ->
[meta + [mode: mode], filePath]
}
}
}
.multiMap { meta, fastq ->
def mode_input = "--" + meta.mode
samplesheet: [meta, fastq]
Expand Down
46 changes: 46 additions & 0 deletions subworkflows/nf-core/utils_nfschema_plugin/main.nf

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

Loading