I need to do quantile normalization in R
Input file just a small subset I have over 5000 values:
x <- data.frame(A =c(193973, 185750, 185511,NA), B= c(56433,52298, 53040, NA), C = c(4668, 6074,6246, NA))
software I am using is recommending
xtransformed = qqnorm(x, plot.it =F)$x
I don't understand "$x" here in the end ?
other question is:
if input is (which is my actual input
x <- data.frame(A =c("A","B","C","D"), B = c("X", "Y", "Z","L"), C=c(193973, 185750, 185511, "NA"), D = c(56433,52298, 53040, "NA"), E = c(4668, 6074,6246, "NA"))
and I just select column I want to transform
y =x[,3:5]
Transformed it with that code and it doesnt work? What is the reason
ytransformed <- qqnorm(y, plot.it =F)$y
ytransformed
I did that. Now I want to plot and see if it has transformed or not? how can I do that?
The preprocessCore
package in Bioconductor has this function. First install & load it:
source('http://bioconductor.org/biocLite.R')
biocLite('preprocessCore')
library(preprocessCore)
Then make a matrix out of your data frame, and normalize.quantiles
:
> x <- data.frame(A =c(193973, 185750, 185511,NA), B= c(56433,52298, 53040, NA), C = c(4668, 6074,6246, NA))
> m <- data.matrix(x,rownames.force=nrow(x))
> normalize.quantiles(m)
[,1] [,2] [,3]
[1,] 85550.67 85550.67 80825.67
[2,] 82143.61 80825.67 82143.61
[3,] 80825.67 82143.61 85550.67
[4,] NA NA NA
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.