JovingeLabSoftware / LincServe

A high performance (hopefully) LINCS data server including Node.js server, couchbase backend, and R package for ETL
0 stars 0 forks source link

UI: Dashboard for CouchLincs #1

Open ghost opened 8 years ago

ghost commented 8 years ago

It would be ideal if we had a dashboard for our CouchLincs server. This dashboard would display the following information:

  1. How many datasets (i.e., documents) have been uploaded
  2. Number of unique perturbagens (maybe broken down by type: chemical vs. sirna, etc.)
  3. Allow querying datasets by perturbagen and/or cell line, returning number of matching datasets.
  4. Maybe allow downloading an R Data file containing the zscores for the datasets matching the above query?
  5. Other stuff

Here is some sample code for querying and formatting data from couchbase.

library(httr)
url <- "http://54.152.59.84:8093/query/service"
zs <- function(x) { unlist(x$zscore) }
id <- function(x) { x$id }

# get gene ids
statement <- ("SELECT meta(LINCS1).id, data.gene_id FROM LINCS1 WHERE meta(LINCS1).id = 'GSM1715626'")
gids <- unlist(data$results[[1]]$gene_id)

# get zscores
statement <- ("SELECT meta(LINCS1).id, data.gene_id, data.zscore FROM LINCS1 WHERE metadata.cell_line = 'A375'")
res <- POST(url, query=list(statement=statement))
data <- content(res, as = 'parsed')
zscores <- sapply(data[[3]], zs)
colnames(zscores) <- sapply(data[[3]], id) 
rownames(zscores) <- gids
borgmaan commented 8 years ago

Skeleton for dashboard using shinydashboard introduced in 63e2109c1eb5cd54cd8dd9203f9296e718fa1cb0