Plot a histogram of different samples as a bargraph with custom content

Hi,
I have a nextflow pipeline that produces a TSV file with a histogram of m/z values for each input sample (with columns bin and value, the bins are the same for all samples):

266.6666666666667 - 276.5	0.0
276.5 - 286.33333333333337	0.0
286.33333333333337 - 296.1666666666667	0.00036845983787767205
296.1666666666667 - 306.0	0.00036845983787767205
...

I would like to plot the histogram using custom content, i.e. in multiqc_config.yaml:

custom_data:
  mz_plot:
      plot_type: "bargraph"
      file_format: "tsv"
      section_name: "Histogram of the m/z values"
      pconfig:
        id: "histogram_mz"
        title: "Histogram of the m/z values"
        xlab: "Frequency"
        ylab: "m/z"

However, this will not create a histogram but will create a bar for each sample with the bins as the different categories, as shown here:

I have already encountered a similar situation where I had to write a custom module to swap out the sample id with the categorical variable but is there a way to achieve this without having to do that?
Can i somehow put the bins onto the y-axis and use the samples as categories in the bargraphs just using custom content?

Best, Julia

Hi Julia!

This is the expected multi-sample bargraph format:

The first column should contain sample names, and the header line should have category names.

Thank you, that is exactly what I was looking for!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.