Skip to content

Instantly share code, notes, and snippets.

@sashaphanes
Created April 19, 2013 18:42
Show Gist options
  • Save sashaphanes/5422325 to your computer and use it in GitHub Desktop.
Save sashaphanes/5422325 to your computer and use it in GitHub Desktop.
The following is a real data file and contains four different types of gene expression measurements (including RPKM) from one most recent finished RNAseq data. Find the file path from your Linux machine or rhdna account and load the data directly into R. Then select RPKM measurements for all samples. After excluding genes that no samples have RP…
http://156.40.185.32/pub/human.Hela.ALDH.ethanol.RNAseq/features/allHela.sorted.wig.exon.high50Ave.peakFeats.allChr.exonLen.subTotal.RPKM.highest_in_gene.transposed.txt.gz
README file: http://156.40.185.32/pub/human.Hela.ALDH.ethanol.RNAseq/README.human.Hela.ALDH.ethanol.RNAseq.txt
dataFile = "/mnt/xdat/pub/human.Hela.ALDH.ethanol.RNAseq/features/allHela.sorted.wig.exon.high50Ave.peakFeats.allChr.exonLen.subTotal.RPKM.highest_in_gene.transposed.txt.gz"
rawdata = read.delim(gzfile(dataFile), sep="\t", header=T)
rownames(rawdata) = paste(rawdata[,"Chr"], rawdata[,"GeneSym"], sep = ".")
data.RPKM = rawdata[, grep("RPKM", colnames(rawdata))]
rowMax = do.call("pmax", c(data.RPKM[,1:ncol(data.RPKM)],na.rm=TRUE))
data.RPKM.rowMax.gt1 = data.RPKM[rowMax >1,]
data.RPKM.rowMax.gt1[is.na(data.RPKM.rowMax.gt1)] = 0
data.RPKM.log2 = log2(data.RPKM.rowMax.gt1 + 1)
RNAseq.RPKM.log.m = as.matrix(data.RPKM.log2)
library(limma)
library(affy)
RNAseq.RPKM.log.m.qNorm = normalizeBetweenArrays(RNAseq.RPKM.log.m, method="quantile")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment