I would like to apply the quantile normalization on a huge matrix. I tried to turn my matrix into a ff object as the example below:
library(ff)
df <- ' sample1 sample2 sample3
1834.2 1743.4 1384
4711 4922 4650
4555 1387 4650.8
2588 1325 3258'
df <- read.table(text=df, header=T)
write.table(df, "del.txt", col.names=T, row.names=F, quote=F, sep="\t")
df <- read.table.ffdf(file="del.txt", header=T)
Thus, I tried:
library(preprocessCore)
df <- normalize.quantiles(df)
And got:
Error in normalize.quantiles(df) : Matrix expected in normalize.quantiles
I know that is possible to convert the ff object to a matrix and apply the nomalization, but is exactly what I am trying to avoid.
If I make the conversion ff object to a matrix and try to normalize it (after more than 20 hours running!) produce an error as follows:
Error in unlist(x, recursive = FALSE) :
long vectors not supported yet: memory.c:1648
I would be grateful for suggestions to perform this normalization, using or not using, the ff package. Thank you!
Update to cpad0112:
Thank you for your answer!
However, I tried to run the ff object (ff package) and I got:
quantile_normalisation(df)
Error in aperm.default(X, c(s.call, s.ans)) :
invalid first argument, must be an array
My matrix is too huge to run as.data.frame (600k in rows vs 3k in column). It can be adapted to a ff object?