Skip to content

Instantly share code, notes, and snippets.

@dvdhover
dvdhover / click_on_ggvis.R
Created October 22, 2015 22:40 — forked from simecek/click_on_ggvis.R
Interactive scatterplot
# 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)
@dvdhover
dvdhover / basicOncoPrint.R
Created October 20, 2015 03:45 — forked from armish/basicOncoPrint.R
A simple R script to visualize OncoPrints out of an alteration matrix
# 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);
}
}