This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Web best practice for returning python/R plots (previously generated or dynamically generated if that is best practice) based on user input?

I would like to develop a web database that allows users to input a single query (let's say one gene). Then I'd like to return a graph of expressions of that gene (not what I actually want, but it is the same for the purpose of the question). Would I store the expression data in SQL and then dynamically generate the plot each time? Or do I somehow store the plots and then call on them based on their IDs.

Gtexportal.org is a webserver that performs this exactly the way that I'm looking for.

web gene plot r python

You want your web site to offer a decent user experience so if it takes too long to generate the page then it's better to store some pre-computed plots. When there's a combinatorial explosion of possible plots to return, you may not be able to avoid generating content dynamically. However, if it's a matter of one plot per gene then I would decide based on the speed gain in page loading time.

Why does it has to be R/Python? For a web project I would maybe consider javascript.

1 answer

Seems to me most efficient to store the data and dynamically generate plots, I would have a look at Shiny in R for this.

Log in to answer this question.