Hi, I have a problem with nf-core tools and valid...
# nf-schema
l
Hi, I have a problem with nf-core tools and validation of parameters. In the phaseimpute workflow I would like to introduce a
map_sep
to define what kind of separator is present in the genetic map provided either tabulation, space or comma. I define it as
\\t
in the nextflow.config and add the following to nextflow.schema
Copy code
"map_sep": {
                    "type": "string",
                    "description": "Separator used in the genetic map file.",
                    "default": "\\t",
                    "fa_icon": "fas fa-arrows-alt-h",
                    "enum": ["\\t", ",", ";", " "],
                    "hidden": true
                }
But then either
nf-core pipelines lint
complains that the default in the config and schema does not match or it's when I run the pipeline. Also if I change it to a space, the linting remove the space and also complains. What should I do ?
If I set config and schema to "\\t" then running the pipelines is fine but the linting give
Config default value incorrect: params.map_sep is set as \t in nextflow_schema.json but is \\t in nextflow.config.
I can simply remove the enum I guess, but there is an issue ongoing with escaped character.
m
what if you set it it just to
\t
?
l
If I set both to "\t" then nf-core pipelines lint complains as:
Copy code
ERROR    [✗] Pipeline schema does not follow nf-core specs:                                                                                                                               
          Default parameters are invalid: '' is not one of ['\t', ',', ';', ' ']
The issue seems to be in nf-core schema.py where the sanitize_param_default do the following:
Copy code
if isinstance(param["default"], str) and param["default"].strip() == "":
            param["default"] = ""
            return param
Unfortunately the strip function convert the "\t" and " " to and empty string.
It might need to be changed to
.strip(" ")
to fix it for "\t" but it would remain the " " to "" error.