Skip to content

Commit

Permalink
one group is apparently bigger than other
Browse files Browse the repository at this point in the history
  • Loading branch information
jmzeng1314 committed May 24, 2016
1 parent 9cef440 commit 5eefed1
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions 9-microarray-examples/GSE21785.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
## kidney GPL96 HG-U133A
## different subtype tissue :Glomerulus Tubulus
rm(list=ls())
library(GEOquery)
library(limma)
GSE21785 <- getGEO('GSE21785', destdir=".",getGPL = F)
exprSet=exprs(GSE21785[[1]])
library("annotate")
GSE21785[[1]]

pdata=pData(GSE21785[[1]])
tissue=factor(unlist(lapply(pdata$title,function(x) strsplit(as.character(x),"_")[[1]][1])))

platformDB='hgu133a.db'
library(platformDB, character.only=TRUE)
probeset <- featureNames(GSE21785[[1]])
#EGID <- as.numeric(lookUp(probeset, platformDB, "ENTREZID"))
SYMBOL <- lookUp(probeset, platformDB, "SYMBOL")

a=cbind(SYMBOL,exprSet)
## remove the duplicated probeset
rmDupID <-function(a=matrix(c(1,1:5,2,2:6,2,3:7),ncol=6)){
exprSet=a[,-1]
rowMeans=apply(exprSet,1,function(x) mean(as.numeric(x),na.rm=T))
a=a[order(rowMeans,decreasing=T),]
exprSet=a[!duplicated(a[,1]),]
#
exprSet=exprSet[!is.na(exprSet[,1]),]
rownames(exprSet)=exprSet[,1]
exprSet=exprSet[,-1]
return(exprSet)
}
exprSet=rmDupID(a)
rn=rownames(exprSet)
exprSet=apply(exprSet,2,as.numeric)
rownames(exprSet)=rn
exprSet[1:4,1:4]
#exprSet=log(exprSet) ## based on e
boxplot(exprSet,las=2)
## very interesting here,one group is apparently bigger than other.

design=model.matrix(~ tissue)
fit=lmFit(exprSet,design)
fit=eBayes(fit)
#vennDiagram(decideTests(fit))

write.csv(topTable(fit,coef='tissueTubulus',n=Inf,adjust='BH'),"Tubulus-Glomerulus.DEG.csv")

0 comments on commit 5eefed1

Please sign in to comment.