how to get legends labels for multiqc plots
1
0
Entering edit mode
2.7 years ago
adR ▴ 120

Hi everyone, Does anyone know were to get to the legend labels of plots generated from multiQC report ? For example I would like to see the legends GC content distribution from QualiMap. Thank you adr

multiQC • 2.0k views
ADD COMMENT
0
Entering edit mode

What do you mean by "get legends labels"? Plots should already have axis labels.

ADD REPLY
0
Entering edit mode

for example the plot below, I know each color line is indicating a library but I want to see the label as legend . enter image description here

ADD REPLY
0
Entering edit mode

Since multiQC is aggregating tens (or hundreds) of samples it would be pretty difficult to produce those as a legend in the limited space available in the plot.

Phil Ewels (developer of multiQC) participates here and may have more to say.

ADD REPLY
0
Entering edit mode

Not adding anything to the specific issue here , just some alternative thoughts. :)

give it a try with fewer number of samples.

Many of those MultiQC graphs are interactive but only up to a certain number of samples, above they become static (unless specified on the cmdline). The interactive part will likely give you sample info when you hoover over that particular line in the graph.

ADD REPLY
0
Entering edit mode

It is not simply a question of fewer samples/interactivity. OP wants to get names of the samples as a side legend in the graph itself.

ADD REPLY
0
Entering edit mode

GenoMax and lieven.sterck , thank you so much for participating in my question. The plot above is actually interactively displaying each sample name, and I was wondering if there was a way to show the sample name as a legend next to the plot. As a matter of fact, I downloaded the matrix used to plot the above graph and exported it into R, but the plot generated by ggplot2 does not look good. Thanks for your help! Best, adr

ADD REPLY
3
Entering edit mode
2.7 years ago
Phil Ewels ★ 1.4k

There's currently no (easy) way to customise MultiQC report styling to include a visible legend in the interactive plot. As others have said, this is a deliberate style choice because many people generate reports with very large numbers of samples. Hovering the mouse over a series should show a tooltip with the sample name.

However, this is just the interactive plots. Flat image plots _do_ include the sample names in a visible legend (they have no tooltip, so it's the only way to interpret the plot). Flat image plots are used automatically with very large sample numbers, or can be forced with the --flat command-line flag. If you like, you can have the best of both worlds - interactive plots in the report but a directory of flat image plots - with the --export flag. You can find more details over in the MultiQC docs.

Here's an example of the flat version of one of the plots from the reports shown on the MultiQC website:

Flat image example

ADD COMMENT
0
Entering edit mode

Phil Ewels : Is there a cap on those legends in terms of sample numbers? I don't recall seeing them on a flat report which had 400+ samples but I will have to re-verify.

ADD REPLY
0
Entering edit mode

@Phil Ewels and GenoMax , Although I performed my analysis with the --export flag, I was unable to get the legend information as you shown in the above graph. I am not sure whether MultiQC requires a legend file with the sample name. I should probably read in detail the documentation. Thank you!

ADD REPLY
2
Entering edit mode

Yeah you're right - looks like I set a cutoff for 15 samples (see code). I guess that's because I didn't want the legend to grow to ridiculous proportions. I could look into adjusting this but to be honest I'm not keen, the matplotlib code was difficult to write and involves a lot of empirically determined values..

Ok well then if you have > 15 samples then I think you're going to have to export the raw data and recreate the plot yourself I'm afraid.

ADD REPLY
1
Entering edit mode

Thank you all! That was a great discussion

ADD REPLY

Login before adding your answer.

Traffic: 2610 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