privefl / bigstatsr

R package for statistical tools with big matrices stored on disk.
https://privefl.github.io/bigstatsr/
179 stars 30 forks source link

Read data using ‘bigsnpr’ package and run Linear mixed effect model using other packages #155

Closed NadNadi closed 2 years ago

NadNadi commented 2 years ago

Hi, I want to run a linear mixed effect model. I read my plink format dataset using "bigsnpr" package and now I need a matrix contain all SNPs in columns and individual IDs per row to run model. How can I give this matrix to my linear mixed effect model?

Thank you in advance for your time and consideration.

privefl commented 2 years ago

For a FBM (the format used to store the genotype matrix G), you can convert it to a standard R matrix with G[]. Beware of the memory then.

NadNadi commented 2 years ago

Hi to all, I read the data using the bigsnpr package using these codes.

After running the last line I get the following error: Error: Path ' ' must have 'bed' extension. My directory (extdata) contains the plink files. How to solve this error?

Thank you in advance!

privefl commented 2 years ago

Do not use system.file(), it is used to access a path installed in a package. Just provide the path directly between quotes.