Properly rendering MultiQC reports in a Shiny app

I created a Shiny app that allows users to easily view MultiQC reports that are scattered across a GCP Cloud Storage bucket.

My app uses the googleCloudStorageR package to read in each html report as a string, and then the app renders the report via htmltools::HTML() and shiny::htmlOutput().

This works, except some of the plots are not visible (see attached). If I view the same reports in a web browser, the plots render correctly.

I’m guessing that >=1 javascript library is not correctly integrated into my Shiny app, which is causing the rendering issue. I’d appreciate any suggestions on how to fix this problem.



Hi @nick-youngblut,

Sounds like a nice idea! As you guessed, the “loading report” message is usually an indicator that the JavaScript has crashed on the page render. Not much we can do from here to help sorry, best you can do is check the browser developer console. You’ll probably see a bunch of JavaScript errors.

If you’re able to, rendering the report via an iframe is more likely to work as the report then has its own browser and doesn’t have to fight with whatever HTML environment it’s being embedded within.

Phil

Yeah, I’m definitely getting a lot of errors:

I can’t figure out how to get iframe working with local files. I’ve tried placing the multiqc html files in my app’s www directory, but I just get Not found errors in the iframe.

It’s hard to say for sure what’s wrong, but it looks like it’s not working correctly with multiple reports embedded into a single web page: 'mqc_plots' has already been declared - this variable should be a singleton for a DOM model.

Would you be able to check and confirm whether it’s the case and multiple reports are embedded on one page? If yes, that’s probably something that should be changed on the wrapper side, not in the MultiQC itself.

@vlad.savelyev yeah, the issue is rendering a second MultiQC report after one has already been rendered. Any suggestions on how to perform a “reset” in between rendering each report?

Not on my side sorry - this is a Shiny app thing rather than a MultiQC thing, and I don’t have much experience with that.