I have two microarray datasets with same platform. I performed batch normalization using:
norm1=removeBatchEffect(norm, batch=NULL, batch2=NULL, covariates=NULL, design=matrix(1,ncol(norm),1))
and now I want a PCA plot of test and control samples. I tried using the following codes:
#pca plot
library(ggfortify)
control<- norm1[,c(1:19,35:63)]
test<-norm1[,c(20:34,64:93)]
autoplot(prcomp(control,test))
# OR
library(ggplot)
df<- data.frame(control=norm1[,c(1:19,35:63)], test=norm1[,c(20:34,64:93)])
ggplot(df, aes(control,test)) + geom_point(aes(shape=control,colour= test))
but the plot is not showing groups of test and control. instead, it plots the genes present in samples.
can anyone point out what's wrong here and suggest any other function in limma or affy?