Does anyone know if Seqera is write in saying this...
# multiqc
j
Does anyone know if Seqera is write in saying this > TSV Alternative: The TSV format is often more reliable and easier to work with for tables in MultiQC. I'm revisting trying to get the full parameter list listed in an (ideally) hidden list at teh bottom of teh table. I wanted to exploit this: https://github.com/nf-core/tools/blob/fee44dae3fb1f86561f8ee11a62eb6207804dc5d/nf_core/pipeline-template/subworkflows/nf-core/utils_nextflow_pipeline/main.nf#L73-L82 which produces
Copy code
{
    "input": "<https://raw.githubusercontent.com/nf-core/test-datasets/funcscan/samplesheet_reduced.csv>",
    "multiqc_config": null,
    "multiqc_title": null,
    "multiqc_logo": null,
    "max_multiqc_email_size": "25.MB",
To make a MultiQC compatible JSON as well (my idea was to just inject the MultiQC header info), but this appears to be MUCH more involved to modify the default nf-core parameter JSON to get it into the correct 'long' format of one column for parameter name and one for values than I had hoped... For example: If I just add the header section, like this
Copy code
bash
{
  "id": "basic_pipeline_params",
  "section_name": "Basic Pipeline Parameters",
  "description": "Core configuration parameters",
  "plot_type": "table",
  "pconfig": {
    "id": "basic_params_table",
    "title": "Basic Configuration"
  },
  "data": {
    "input": "<https://raw.githubusercontent.com/nf-core/test-datasets/funcscan/samplesheet_reduced.csv>",
    "outdir": "./results",
    "annotation_tool": "pyrodigal",
    "run_amp_screening": "true",
    "run_arg_screening": "true",
    "run_bgc_screening": "false"
  }
}
I get a long traceback error. To get it to work, I have to add an intermedia 'key' ( guess normally representing samples):
Copy code
{
  "id": "pipeline_parameters",
  "section_name": "Pipeline Parameters",
  "description": "Configuration parameters used in the pipeline run",
  "plot_type": "table",
  "pconfig": {
    "id": "pipeline_params_table",
    "title": "Pipeline Configuration",
    "col1_header": "Parameter"
  },
  "data": {
    "Pipeline Configuration": {
      "input": "<https://raw.githubusercontent.com/nf-core/test-datasets/funcscan/samplesheet_reduced.csv>",
      "multiqc_config": "null",
      "multiqc_title": "null",
      "multiqc_logo": "null",
      "max_multiqc_email_size": "25.MB",
      "multiqc_methods_description": "null"
    }
  }
}
But this is nasty because it ends up with a single row wide table with the sample name as 'Pipeline configuratio'n and each parameter is a column To make it wide table I have do this large structure change making each parameter it's own key...
Copy code
{
  "id": "pipeline_parameters",
  "section_name": "Pipeline Parameters",
  "description": "Configuration parameters used in the pipeline run",
  "plot_type": "table",
  "pconfig": {
    "id": "pipeline_params_table",
    "title": "Pipeline Configuration"
  },
  "data": {
    "input": {
      "Value": "<https://raw.githubusercontent.com/nf-core/test-datasets/funcscan/samplesheet_reduced.csv>"
    },
    "multiqc_config": {
      "Value": "null"
    },
    "multiqc_title": {
      "Value": "null"
    },
    "multiqc_logo": {
      "Value": "null"
    },
    "max_multiqc_email_size": {
      "Value": "25.MB"
    },
Seqera AI keeps telling me make it into a TSV table instead... (which indeed works straight out)
Copy code
# id: 'pipeline_parameters'
# section_name: 'Pipeline Parameters'
# description: 'Configuration parameters used in the pipeline run'
# plot_type: 'table'
# pconfig:
#   id: 'pipeline_params_table'
#   title: 'Pipeline Configuration'
#   col1_header: 'Parameter'
Parameter	Value
input	<https://raw.githubusercontent.com/nf-core/test-datasets/funcscan/samplesheet_reduced.csv>
multiqc_config	null
multiqc_title	null
multiqc_logo	null
max_multiqc_email_size	25.MB
multiqc_methods_description	null
*So: should I just drop the idea of using the JSON file and converting to TSV instead? *
p
So your question boils down to:
Should I write a thing using loads of code, or a small amount of code?
I would go for the one that is a smaller amount of code šŸ‘šŸ»
j
YEs and no šŸ˜…
I could either write • A tiny bit of code if there is some hidden functionality I can't find documented • A medium amount of code for JSON -> TSV • A lot of code to convert the JSON to MQC JSON (as descibed)
p
To make it wide table I have do this large structure change making each parameter it's own key...
This sounds like it should be a single
map
call, no?
map { key, val -> key: ["Value": val] }
or something off the top of my head
j
I thought it would be but it wasn't when I tried before... but maybe I didn't persist enough šŸ˜… (I was getting annoyed at Seqera AI at the time not being helpful šŸ˜† )
I'll attempt again at some point
Thank you @Phil Ewels
p
np! šŸ‘šŸ»
j
I had a poke around the custom content code. One gotcha with the JSON route: remember to set
col1_header
in
pconfig
, otherwise the first column defaults to "Sample Name":
Copy code
"pconfig": {
  "col1_header": "Parameter"
}
TSV gets this for free from the header row.
šŸ‘ 1
j
TSV does sound easier at this point