Entering edit mode
4.8 years ago
parinv
▴
80
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?
Thank you for help. Can you suggest how to add colour to PCA plot? I tried the following:
and other one:
but it is giving error: Warning message: In prcomp.default(t(norm1), colour = "control") : extra argument ‘colour’ will be disregarded
In both examples of code, you are attempting to pass arguments,
colour
andcolby
, to prcomp. prcomp does not accept any arguments by these names