Skip to content

Instantly share code, notes, and snippets.

@sashaphanes
Created March 11, 2013 19:34
Show Gist options
  • Save sashaphanes/5136985 to your computer and use it in GitHub Desktop.
Save sashaphanes/5136985 to your computer and use it in GitHub Desktop.
Exclude genes without a value over 2rpkm and select only columns marching string "rpkm"
source("http://bioconductor.org/biocLite.R")
biocLite("preprocessCore")
library(preprocessCore)
data <- read.delim(gzfile("fileOfInterest.txt.gz"), sep="\t")
data <- data[,grep("RPKM", colnames(data))]
filtered <- data[!apply(data, 1, function(x){ all(x <2) }),]
qn <- normalize.quantiles(as.matrix(filtered), copy = TRUE)]
qn <- as.data.frame(qn)
colnames(qn) <- colnames(filtered)
rownames(qn) <- rownames(filtered)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment