privefl / bigsnpr

R package for the analysis of massive SNP arrays.
https://privefl.github.io/bigsnpr/
186 stars 44 forks source link

LDpred2: error in rowMeans on supercomputer cluster but not in R studio #445

Closed SaraBecelaere closed 11 months ago

SaraBecelaere commented 1 year ago

Hi Florian,

I am using LDpred2 to calculate scores. I tried the script with a small subset of my data locally on R studio without any errors, but the idea is to use LDpred2 on large datasets. Therefore I need to submit the script as a job on the VSC (Flemish SuperComputer). However using the same small subset, I tried to submit the script as a job and I encountered an error at this line of code:

“Error in rowMeans(beta_auto[, abs(pred_scaled - median(pred_scaled)) < :

'x' must be an array of at least two dimensions”

I used exactly the same input files. Could you think of a reason why I would suddenly get this error while I do not get it if I run the script locally on R studio? I have already checked that the script and input files are exactly the same multiple times.

Thanks in advance.

Kind regards

privefl commented 1 year ago

Just add drop = FALSE when accessing beta_auto. Be careful, you're using some very old code it seems.

SaraBecelaere commented 12 months ago

Thanks! Just to be sure, where can I find the most recent code?

privefl commented 12 months ago

The tutorial is there: https://privefl.github.io/bigsnpr/articles/LDpred2.html