I want the table given by get_module_data to be the same as what’s given internally to MultiQC when it’s putting the table in the report. The ToL ID is lost on the same table.
custom_data:
dtol:
file_format: "tsv"
section_name: "DToL"
description: "Darwin Tree of Life identifier and related meta data."
plot_type: "table"
sp: # Search pattern
dtol:
fn: "DToL.tsv"
When the MultiQC report displays it, it displays with the “ToL ID” header, but it’s not possible it seems in a notebook to get the exact same table.
I feel like the issue is the same with the plots as well. Even though you can display plots in a notebook, they’re not as feature rich as you get in the MultiQC html.
I’m not entirely sure why get_plot() isn’t returning the table with this config though, if it is ending up in the report. I guess there is some order of logic somewhere that’s being lost…
Tables in notebooks are different from plots because they are not rendered with Plotly, but rather we just wrap data in a Pandas DataFrame object and return it to the cell, so the notebook would display it with it’s intefrated widget. This, there is not going to be any of the HTML-verion rich functionality there, for now.
However, the col1 header should be possible to display as you are pointing out, so I added that in this PR:
So, setting the config in the yaml didn’t help for the notebook case. It works for the normal multiqc report, but the pandas DataFrame object remains the same.
Hopefully Vlad’s PR fixes that though.
It’s also a shame we don’t get the same HTML version rich functionality there. What was the decision behind that?
MultiQC tables use a bunch of custom javascript, which is why we didn’t package it up in the same way. In contrast, Plotly plots are generally well supported natively by notebook environments.
You can try using MultiQC tables yourself if you want, the function is multiqc.plot.table() - but it’s likely that we need to pull some extra magic to somehow inject in the custom CSS and JavaScript for them to function properly.
Feel free to open an issue for this on the MultiQC repo if it’s something you’d like to see.