This file contains 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
######## | |
# | |
# http://mikelove.wordpress.com/2009/09/14/measure-of-structure-in-residual-matrix/ | |
# | |
####### | |
k <- 15 | |
p <- 40 | |
n <- 100 | |
var <- 10 |
This file contains 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
script2Rmd <- function(filein) { | |
lns <- scan(filein,what="char",sep="\n") | |
comments <- substr(lns,1,1) == "#" | |
lnsout <- lns | |
lnsout[comments] <- substr(lns[comments],3,nchar(lns[comments])) | |
rlelens <- rle(comments)$lengths | |
f <- factor(rep(seq_along(rlelens),rlelens)) | |
lnsoutsplit <- split(lnsout, f) | |
chunkdelims <- rep(c("\n\n```{r}","```\n\n"), length(lnsoutsplit)/2) | |
#from https://stat.ethz.ch/pipermail/r-help/2006-March/101023.html |
We can't make this file beautiful and searchable because it's too large.
This file contains 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
"","SRR1027591Aligned.out.sam","SRR1027592Aligned.out.sam","SRR1027593Aligned.out.sam","SRR1027594Aligned.out.sam","SRR1027595Aligned.out.sam","SRR1027596Aligned.out.sam","SRR1027597Aligned.out.sam","SRR1027598Aligned.out.sam","SRR1027599Aligned.out.sam","SRR1027600Aligned.out.sam","SRR1027601Aligned.out.sam","SRR1027602Aligned.out.sam","SRR1027603Aligned.out.sam","SRR1027604Aligned.out.sam","SRR1027605Aligned.out.sam","SRR1027606Aligned.out.sam" | |
"653635",19,23,12,23,2,5,3,6,0,0,1,1,8,8,4,4 | |
"100422834",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 | |
"645520",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 | |
"79501",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 | |
"729737",28,35,22,42,15,15,36,25,7,4,15,14,47,61,20,9 | |
"100507658",1,3,2,1,0,0,0,2,0,0,1,0,0,2,1,0 | |
"100132287",0,0,9,7,0,0,1,5,2,1,0,0,8,3,3,7 | |
"100288646",0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0 | |
"729759",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 10.
This file contains 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
"","experiment","title","gsm","condition","study","submission","sample","run" | |
"SRR1027592","SRX375129","Control 00i","GSM1261105","Normal control","SRP032798","SRA110634","SRS500408","SRR1027592" | |
"SRR1027591","SRX375129","Control 00i","GSM1261105","Normal control","SRP032798","SRA110634","SRS500408","SRR1027591" | |
"SRR1027593","SRX375130","Control 03i","GSM1261106","Normal control","SRP032798","SRA110634","SRS500407","SRR1027593" | |
"SRR1027594","SRX375130","Control 03i","GSM1261106","Normal control","SRP032798","SRA110634","SRS500407","SRR1027594" | |
"SRR1027595","SRX375131","Control 14i","GSM1261107","Normal control","SRP032798","SRA110634","SRS500409","SRR1027595" | |
"SRR1027596","SRX375131","Control 14i","GSM1261107","Normal control","SRP032798","SRA110634","SRS500409","SRR1027596" | |
"SRR1027598","SRX375132","Control 83i","GSM1261108","Normal control","SRP032798","SRA110634","SRS500410","SRR1027598" | |
"SRR1027597","SRX375132","Control 83i","GSM1261108","Normal control","SRP032798","SRA110634","SRS500410","SRR1027597" | |
"S |
This file contains 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
fc.counts <- read.csv("fccounts.csv",row.names=1) | |
pheno <- read.csv("pheno.csv",row.names=1) | |
pheno$sam <- paste0(pheno$run,"Aligned.out.sam") | |
library(DESeq2) | |
dds <- DESeqDataSetFromMatrix(fc.counts, | |
DataFrame(pheno[match(colnames(fc.counts),pheno$sam),]), | |
~ condition) | |
dds$condition <- relevel(dds$condition,"Normal control") | |
levels(dds$condition) |
This file contains 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
d <- read.csv("ph525x_vids.csv") | |
d <- d[-1,] # first 1 minute video | |
d$week <- factor(d$week) | |
sum(d$min)/60 # "hours of video") | |
barplot(tapply(d$min, d$week, sum)/60, main="hours of video / week") | |
barplot(table(d$week), main="video units / week") | |
stripchart(min ~ week, data=d, vertical=TRUE, | |
pch=1, method="jitter", | |
xlab="week", ylab="min", main="minutes per video unit") | |
abline(h=10, lwd=2, col="red") |
This file contains 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
;; obtain from http://jblevins.org/projects/markdown-mode/ | |
(load "~/path/to/markdown-mode.el") | |
(autoload 'markdown-mode "markdown-mode" | |
"Major mode for editing Markdown files" t) | |
(add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode)) | |
;; obtain from https://github.com/vitoshka/polymode | |
(setq load-path |
This file contains 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
# Rcpp demo | |
# Mike Love | |
# BioC2014 | |
# 30 Jul 2014 | |
# Go here for all the info: | |
# http://dirk.eddelbuettel.com/code/rcpp.html | |
# examples: go down to the 'Other documentation' vignettes |
This file contains 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
; mike love's .emacs | |
; general stuff | |
(menu-bar-mode -1) | |
(tool-bar-mode -1) | |
(global-set-key "\C-x\C-b" 'electric-buffer-list) | |
(global-unset-key (kbd "\C-x DEL") ) | |
(global-unset-key (kbd "\C-t") ) | |
(setq inhibit-startup-screen t) | |
(setq backup-directory-alist '(("" . "~/emacs-backup"))) |
This file contains 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
options(repos=c("https://cran.rstudio.com/"),showWarnCalls=TRUE,showErrorCalls=TRUE, | |
max.print=1000,width=100,menu.graphics=FALSE) | |
options(defaultPackages = c(getOption("defaultPackages"),"devtools","rmarkdown")) | |
# Sys.setenv(TZDIR = "/usr/share/zoneinfo") # this is for a peculiar Mac OS X setup | |
library(utils) | |
rc.settings(ipck=TRUE) | |
if (interactive()) message(R.version$version.string) |
OlderNewer