How to get several "custom data" images into the same "custom content" section of the report

I’m having problems getting two “custom data” images into the same “section” of the report.

These are the png-images which I’m trying to have multiqc pickup and include in the report:

.
├── 1
│   └── raw_mqc.png
├── 2
│   └── raw_mqc.png

This is my config:

run_modules:
  - custom_content

custom_data:
  soapnuke:
    description: "foo"
  raw:
    parent_id: soapnuke
    parent_name: Soapnuke
    parent_description: "bar"
    file_format: "png"

sp:
  raw:
    fn: "*raw_mgc.png"

but I only get one of the images in the report:

My multiqc-config-yml is based on another multiqc-config-yml which I inherited, and it might contain some suboptimal or even nonsensical parts, but it works fine for just one input png-file.

I also tried fn: "raw_mgc.png", that is, without the astrix; same result.

I tried giving the input-png-images prefixes like:

├── 1
│   └── A_raw_mqc.png
├── 2
│   └── B_raw_mqc.png

With the prefixes in the input-png-files and with fn: "*raw_mgc.png", multiqc picks up both images. From stdout:

|    custom_content | A_raw: Found 1 sample (image)
|    custom_content | B_raw: Found 1 sample (image)

But then soapnuke section header and description is missing:

I get the same report if I run multiqc with any multiqc-config-yml! :thinking:

I’m starting to suspect that what I’m trying to do might not be possible:

image

As you say,

Only one plot per section is possible

Is it a problem to have the two plots in separate report sections?

Thanks for your prompt answer, Phil. (I know you’ve recently been super busy teaching :wink: )

I’m a multiqc newbie. I have no problem with the soapnuke-plots going into separate report sections. However, the number of soapnuke-jobs is variable, so I guess the number of “soapnuke-sections” in the report will also need to be variable :thinking: I’m not sure how that can be handled in the multiqc-config-yml, but I’ll have a look and probably come back for help :laughing:

The best solution is to not embed images in MultiQC reports :wink:

Images are supported for Custom Content, but I generally don’t allow them for full MultiQC modules:

No images

MultiQC doesn’t know how many samples it will need to handle for a report, and as such every module should work with anything from 1-1000 samples. With images, you can’t have more than a couple before the report is unusable. Worse, the file size will bloat the HTML file and it will crash the browser surprisingly fast. It’s not accessible and the data cannot be exported into multiqc_data for downstream use.

Plots should be recreated within MultiQC by parsing the raw data and generating dynamic plots instead.

I almost never merge modules that include images into reports. If you really need images in your report, you can do this either via Custom Content or an unofficial plugin module. Feel free to discuss on the community forum if you think that your case is an exception. There have been one or two in the past.