multiqc: group samples by population + boxplot ?
1
0
Entering edit mode
10 months ago

Hi All,

is there a simple way to tell multiqc to group data by population ?

for example, say I've got the output of samtools flagstat for 50 cases and 50 controls, how can I get a boxplot that would display the duplicates for those two populations ?

enter image description here

multiqc • 1.2k views
ADD COMMENT
0
Entering edit mode

update 2024: https://github.com/MultiQC/MultiQC/releases/tag/v1.21

Added a new plot type: box plot. It's useful to visualise a distribution when you have a set of values for each sample.

ADD REPLY
1
Entering edit mode

Thanks Pierre Lindenbaum - super speedy! ;) I also updated my answer below..

ADD REPLY
3
Entering edit mode
10 months ago
Phil Ewels ★ 1.4k

[Edit] - Box plots are now available as a core plot type in MultiQC v1.21, Feb 2024. See release notes and docs.

MultiQC box plot

Previous answer kept below:


You can't group and make boxplots as you describe, probably your best bet is to use the highlight tool in the report (especially if you force the report to generate a beeswarm plot instead of a table, you should be able to get an idea of distributions).

Alternatively, check the multiqc_data directory to find the exported + sanitised data. It should be fairly easy to throw this into Excel / a custom script to generate the plot. If you _really_ want, you can generate a plot image or HTML and then run MultiQC a second time, including this output into the report using Custom Content. Another option is to write a plugin for MultiQC - then you can do things like adding your own command line flags, generating your own plots during run time and basically anything else that you can think of.

In the future I plan to make it much easier to run and use MultiQC in scripts, for exactly this kind of thing. Then you would be able to create a notebook where you import multiqc and run parsing, then are able to directly access the parsed data objects to easily create custom plots. Stay tuned for that..

Phil

ADD COMMENT
0
Entering edit mode

It worked by parsing a first run of multiqc, extract the data from the sanitised data , create a SVG plot with R, include the SVG into a file custom_mqc.html, re-run multiqc ! thanks Phil !

nevertheless, it's not clear how to specify a "section" for the *mqc.html, all the examples I saw are about a custom plot.. (edit : ah non, https://github.com/nf-core/modules/blob/ea8bd14b947319f4ffa16817f9685fc42a240cbe/modules/nf-core/custom/dumpsoftwareversions/templates/dumpsoftwareversions.py#L4 was useful to understand )

enter image description here

ADD REPLY
1
Entering edit mode

Yes the documentation for Custom Content is the worst out of all MultiQC docs. I've been intending to rewrite it for a while now. Best bet is usually to poke around in the MultiQC test data repo: https://github.com/ewels/MultiQC_TestData/tree/master/data/custom_content (this is what I usually do myself to answer questions!)

ADD REPLY

Login before adding your answer.

Traffic: 2381 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6