Skip to content

Commit

Permalink
Modify parameters and continue refactor.
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthiasZepper committed Oct 22, 2024
1 parent 0c3f7cd commit 64cc996
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 9 deletions.
6 changes: 3 additions & 3 deletions lib/SeqinspectorDataClasses.groovy
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
// enum for the supported run modes

static enum RunMode {
public static enum RunMode {
FASTQ,
RUNFOLDER,
}

// enum for the available tools

static enum Tool {
public static enum Tool {
FASTQSCREEN,
FASTQC,
MULTIQC,
}

// ToolProfile class to define and intersect selections of tools and handle extra arguments and settings

class ToolProfile {
public class ToolProfile {
Set<Tool> enable
Set<Tool> disable
Map<Tool, Map<String,String>> tool_arguments = [:]
Expand Down
2 changes: 2 additions & 0 deletions modules/local/utils_seqinspector_profiles/main.nf
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
new GroovyShell().evaluate(new File("$projectDir/lib/SeqinspectorDataClasses.groovy"))

/*
========================================================================================
FUNCTIONS
Expand Down
2 changes: 2 additions & 0 deletions modules/local/utils_seqinspector_tools/main.nf
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

include { getEnumNames } from '../utils_seqinspector_validation/main.nf'

new GroovyShell().evaluate(new File("$projectDir/lib/SeqinspectorDataClasses.groovy"))

/*
========================================================================================
FUNCTIONS
Expand Down
3 changes: 3 additions & 0 deletions modules/local/utils_seqinspector_validation/main.nf
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@

new GroovyShell().evaluate(new File("$projectDir/lib/SeqinspectorDataClasses.groovy"))

/*
========================================================================================
FUNCTIONS
Expand Down
6 changes: 6 additions & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ params {
max_multiqc_email_size = '25.MB'
multiqc_methods_description = null

// Tool selection options
tool_profile = 'default'
tool_profile_custom_path = null
tools_include = null
tools_exclude = null

// Boilerplate options
outdir = null
publish_dir_mode = 'copy'
Expand Down
14 changes: 10 additions & 4 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,20 @@
"description": "Select the quality checks and tools you wish to run.",
"default": "",
"properties": {
"tool_selection": {
"tool_profile": {
"type": "string",
"default": "default",
"description": "Pick and apply profiles to select tools. Choose from the profiles `none`, `minimal`,`default`, `all` and the operations `AND`, `OR`, `XOR` as well as `IAND`.",
"description": "Pick and apply preconfigured profiles to select tools.",
"fa_icon": "fab fa-blackberry",
"pattern": "^\\w+(\\s(AND|OR|XOR|IAND)\\s\\w+)*$"
},
"tool_profile_custom_path": {
"type": "string",
"description": "Path to a custom profile used instead of the preconfigured ones.",
"format": "file-path",
"mimetype": "text/vnd.yaml",
"fa_icon": "fas fa-clipboard-list"
},
"tools_include": {
"type": "string",
"fa_icon": "fas fa-search-plus",
Expand All @@ -68,8 +75,7 @@
"description": "Comma-seperated list of tools that must not run. The selection will be subtracted from the evaluated profiles.",
"pattern": "^(\\w+(,\\s\\w+)*)?$"
}
},
"required": ["tool_selection"]
}
},
"reference_genome_options": {
"title": "Reference genome options",
Expand Down
8 changes: 6 additions & 2 deletions subworkflows/local/utils_nfcore_seqinspector_pipeline/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,17 @@ workflow PIPELINE_INITIALISATION {
//
// Process the tool selection parameters to generate the final list of tools (processes) to run
//
def seqinspector_tools = Constants.ToolProfiles["NONE"] // Start with no tools (except MultiQC)
def seqinspector_tools = new SeqinspectorDataClasses.ToolProfile() // Start with no tools (except MultiQC)


if(path.tool_profile_custom_path){

} else {
// Activate the tools that are selected through the applied profiles (typically `default`)
if (params.tool_selection) {
def evaluated_profiles = Utilities.parseAndApplyBooleanOperation(params.tool_selection, Constants.ToolProfiles, log)
seqinspector_tools = seqinspector_tools.orOperation(evaluated_profiles)
}
}}

if (params.tools_include || params.tools_exclude) {
def tool_include_list = Utilities.getToolList(params.tools_include, log)
Expand Down

0 comments on commit 64cc996

Please sign in to comment.