CompEpigen / MeDeCom

Decomposition of heterogeneous DNA methylomes
22 stars 16 forks source link

Error running on a beta matrix #36

Closed Kani0n closed 1 year ago

Kani0n commented 1 year ago

I tried running MeDeCom on my beta batrix and after ~30min i run into this Error: Error in { : task 1 failed - "attempt to select less than one element in get1index" Any idea what cuses this?

schmic05 commented 1 year ago

Hi @Kani0n ,

From this message, I can only speculate that your option cg_subsets contains indeces outside of the dimension of the matrix. If this is not the case, I would need some more information about your analysis.

Best,

Michael

Kani0n commented 1 year ago

Do you know what may cause this?

schmic05 commented 1 year ago

As I described before, I speculate that the cg_subsets parameters is not properly configured. Can you please paste your code for running MeDeCom here or give me some more information? How many CpGs does your matrix have?

Kani0n commented 1 year ago

the code is just: medecom.result<-runMeDeCom(beta_matrix, Ks=2:10, lambdas=c(0,10^(-5:-1))) i have 866.238 CpGs over 191 samples

schmic05 commented 1 year ago

I see, then the issue is likely a memory issue. A matrix decomposition of more than 800,000 rows is very challenging and MeDeCom probably fails. I recommend that you have a look at our protocol (https://www.nature.com/articles/s41596-020-0369-6). An essential step in the protocol is feature selection and we suggest different ways in there. This should solve the issue.

Kani0n commented 1 year ago

it is a memory issue, thank you! I will try the recommended steps!

Kani0n commented 1 year ago

Hey, so i tried running my analysis on a Server and i get a new error about 10 minutes into the analysis. It looks the following:

Error in results[[elt]][[K_index, ll_index]] <- el(res, where = elt) : incompatible types (from NULL to list) in [[ assignment In addition: Warning messages: 1: In mclapply(rev(concurr_indices), single_run_fun, mc.cores = NCORES, : 90 function calls resulted in an error 2: In mclapply(rev(concurr_indices), single_run_fun, mc.cores = NCORES, : 9 function calls resulted in an error

my call is: medecom.result<-runMeDeCom(beta_matrix, Ks=2:10, lambdas=c(0,10^(-5:-1)), NINIT=10, NFOLDS=10, ITERMAX=300, NCORES=9)

Can you help me?

lutsik commented 1 year ago

This error might be associated with missing values (NA's) in your input matrix. Make sure there are no NA's since MeDeCom cannot handle them.