Entering edit mode
6.2 years ago
nikitavlassenko
▴
120
I have two subsets of cells and their gene expression in a web app written in javascript
. I need a way now to determine which genes are differentially expressed between the groups. I searched for javascript
libraries but found nothing, so I reasoned to try using OpenCPU
to call an R script
located on my server. How could I call R script
on the server from my javascript
- based app, receive several parameters in the script, and then send back the results to the front end?
Also asked here: https://bioinformatics.stackexchange.com/questions/5059/find-differentially-expressed-genes-from-a-web-app
Javascript is not meant to do heavy duty analyses like this. R only runs on a server, maybe you can expose a web service to accept data for analysis and return analyzed results, but don't try to run R from a browser.
JavaScript is for client side processing, you don't want to rely on your client's processing power/browser stability/JS settings for data analysis.
What about server-side javascript? I have
node.js
on the server. Maybe there are any other libraries in other languages that could be accessed easily from javascript? LikeC++
, idk... I actually think thatOpenCPU
is the right way to go, I am just not sure how to call it on the server from my javascript appSearching for "gene expression javascript webapp" leads me to many seemingly good hits, among them DEIVA: a web application for interactive visual analysis of differential gene expression profiles and UBiT2: a client-side web-application for gene expression data analysis. I am sure you can gather some ideas from these projects. Or maybe you want to use shiny for this, as in shinyGEO: a web-based application for analyzing gene expression omnibus datasets.
I need something like this: https://docs.microsoft.com/en-us/machine-learning-server/deployr/deployr-about But I do not want to use DeployR server itself, just need such an API.
Only R shiny has a persistent always-listening server, which is what you need for R scripts on demand. You can write a PHP page that runs an R script and returns the result, and call this PHP page from JavaScript, if you'd like. Just be aware that parameters and results need to be passed as plain text (say JSON) and it will open your server wide to bot attacks that can throw random data at the PHP page running the R process.