Reconstruct Gene Networks Using Shiny

December 6, 2012
By

(This article was first published on Trestle Technology, LLC » R, and kindly contributed to R-bloggers)

Check out the application on Glimmer!  http://glimmer.rstudio.com/qbrc/grn/

 

We’ve been experimenting with RStudio’s new Shiny software as a way to quickly and easily create interactive, responsive web applications which are able to leverage complicated analytics back-ends built in the R programming language.

We created a simple interface which can infer the structure of an underlying Gene Regulatory information based on gene expression patterns; the application is available at http://glimmer.rstudio.com/qbrc/grn/. (At the time of writing, Shiny’s file upload functionality is highly unstable and may not work from your machine — hopefully improvements to the project will resolve the issues shortly.)

Technical Details

I’m using Shiny/Glimmer to handle all web traffic, and ENA to wrap GeneNet to do the actual network inference (more methods could easily be added later). I used D3′s Force Layout to provide some interactive network visualization — I don’t know that it’s really the most practical way to view the data, but it’s some fun eye-candy.

I had stumbled through a few un-documented features of Shiny (app-specific `www` directories, JS to handle custom Shiny outputs, fileInput() for uploading data, etc.) — if you find yourself in the same boat, all my source is available on Github here if anyone’s interested.

I had created a custom reactive function in Shiny to handle an adjacency matrix (the preferred format for the ENA package), which will translate the adjacency matrix into an adjacency list which can be properly handled by RJSONIO, which is how Shiny transfers data. I think created the client-side portion in Javascript which is able to parse that JSON and display it in a D3 Force-Directed Graph.

To leave a comment for the author, please follow the link and comment on his blog: Trestle Technology, LLC » R.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.