This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Example of ggvis scatterplot | |
| # on over - display MGI gene symbol | |
| # on click - open browser with Ensembl page | |
| library(ggvis) | |
| # load dataset | |
| dataset <- read.csv("http://dl.dropboxusercontent.com/u/232839/DO_liver_variability_sex.csv", as.is=TRUE) | |
| head(dataset) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This function sorts the matrix for better visualization of mutual exclusivity across genes | |
| memoSort <- function(M) { | |
| geneOrder <- sort(rowSums(M), decreasing=TRUE, index.return=TRUE)$ix; | |
| scoreCol <- function(x) { | |
| score <- 0; | |
| for(i in 1:length(x)) { | |
| if(x[i]) { | |
| score <- score + 2^(length(x)-i); | |
| } | |
| } |