Entering edit mode
4.5 years ago
ipalmisa
▴
10
Hi I am running a PCA analysis using prcomp function on my FPKM data from Rnaseq analysis. I am scaling the FPKM data by using zFPKM from here (https://www.bioconductor.org/packages/release/bioc/html/zFPKM.html) The zero values in FPKM data are converted in -Infinite, so when I run prcomp funtion, I get Error in svd(x, nu = 0, nv = k) : infinite or missing values in 'x' Can you help me, please? Should I just remove the -infinite?
I read here Question about PCA plot using RPKM/FPKM. the suggestion to scale
prcomp()
will, by default, only center your data. You can set it to additionally scale by using:If you are having trouble with zFPKM, then just try the above.
zFPKM converts 0 values to -Inf (negative infinities):
Yes, i have noticed that the zeros are scaled to minus infinite But when I try to use the prcomp on the FPKM data using pca=prcomp(my_data, center=TRUE, scale = TRUE) I get Error in prcomp.default(my_data, center = TRUE, scale = TRUE) : cannot rescale a constant/zero column to unit variance It works only with scale=FALSE I think here the zeros are the issue...
I see. You have variables that are just all 0. You need to remove these like this:
Thank you! It worked!
ah ok! I will remove the ones that are Zero in ALL my samples, and keep the ones that are Zero only in some samples, right? Have I understood correctly? Thanks
Yes, that is correct. I cannot see your data but you may also have other non-zero variables that have constant variance, but, first, try to remove just those variables that are all zero.
I also updated my original answer: A: Question about PCA plot using RPKM/FPKM.
Sorry to piyushjo for overtaking the thread.
It's alright. You are the pro! I was just trying to get more information but you had better answer.
You are pro too. Everybody has much to offer in different areas.