hredestig / pcaMethods

Perform PCA on data with missing values in R
GNU General Public License v2.0
45 stars 10 forks source link

Running llsImpute never ends - but it does end my memory #18

Open iquasere opened 1 year ago

iquasere commented 1 year ago

Hey there!

I am trying to run llsImpute on my spectracounts, with the following commands:

library("vsn")
library("pcaMethods")
pdata = as.matrix(read.table('spectracounts.tsv.txt', sep='\t', h=T, row.names=1))
pdata[pdata==0] = NA
norm = justvsn(ExpressionSet(pdata))
imputed = llsImpute(t(exprs(norm)), allVariables = TRUE)

However, the last command never ends (been running for four hours at this point), and drains around 50 Gb of memory for dealing with a matrix of a few Kb. What is happening here?

At first I tried running that command as imputed = llsImpute(t(exprs(norm))), but it always failed with

Error in svd(X) : infinite or missing values in 'x'
In addition: Warning message:
In llsImpute(t(exprs(norm))) :
  Less than 50% of the genes are complete, consider using allVariables = TRUE
iquasere commented 1 year ago

Limiting the matrix I seem to have stumbled upon the reason, which I found I had already reported one year ago (although I didn't follow on the issue, my bad). Running

pdata = pdata[1:1000,]
norm = justvsn(ExpressionSet(pdata))
imputed = llsImpute(t(exprs(norm)), allVariables = TRUE)

Finishes successfully, but calling imputed to see the results gives me

> imputed
        Variables
        Samples
Error in (function (classes, fdef, mtable)  :
  unable to find an inherited method for function ‘nObs’ for signature ‘"nniRes"’