#Here the object data is the gene expression from RMA with dimension pxn = 54675 x 248, here n=248 (two batches: 192+56)
genes<-data[1:54613,]
genes<-t(genes)
pcs<-prcomp(genes)
summary(pcs)
library(scatterplot3d)
PC1<-pcs$x[,1]
PC2<-pcs$x[,2]
PC3<-pcs$x[,3]
group.colors <- rep("#000000", length(PC1))
group.colors[seq(1,192,1)] = "#FF77FF" #SG Batch A
group.colors[seq(193,248,1)] = "blue" #SG Batch B
scatterplot3d(PC3,PC1,PC2, main="PCA scatterplot before ComBat normalization", color=group.colors, pch=16)
legend.txt <- c("SG Batch A", "SG Batch B")
legend.col <- c("#00FF00","#0000FF")
legend(-5.75, 5.2, legend.txt , bty="n", col=legend.col,cex=1.2, pch=15)
No comments:
Post a Comment