timothy-barry / ondisc

Space- and time-optimal algorithms for large single-cell expression matrices, with a focus on single-cell CRISPR screens.
https://timothy-barry.github.io/ondisc/
Other
11 stars 5 forks source link

Cannot create matrix #3

Closed yihan1119 closed 3 years ago

yihan1119 commented 3 years ago

Hi,

I tried to use "create_ondisc_matrix_from_mtx" function, but got the following error when writing CSR data: Error in list2DF(.) : could not find function "list2DF" In addition: Warning message: In fun(libname, pkgname) : Option 'datatable.old.unique.by.key' has been removed as warned for 4 years. It is now ignored. Please use by=key(DT) instead and stop using this option.

Version in my environment: R version: 3.6.1, data.table version: 1.14.0

timothy-barry commented 3 years ago

Hi. Are you using the data provided by tutorial 1 on the website? Link: https://timothy-barry.github.io/ondisc/articles/tutorial_odm_class.html

yihan1119 commented 3 years ago

Hello, I used the script from tutorial 1 but used my own data from 10x cellranger output directly. Thanks!

timothy-barry commented 3 years ago

It might be a good idea to run through the tutorial just to make sure that works on your machine.

Could you please provide some information about the format of the mtx file? In particular, could you please post the first 5-6 lines of the file? Different versions of cellranger output slightly different kinds of mtx files, and that might be the problem.

yihan1119 commented 3 years ago

I have the same error message when running on the example dataset published by Gasperini et al. I figure this may be some dependent package version issue in my environment. Do you have any suggestions? Thanks!

timothy-barry commented 3 years ago

Here are the dependences of the package: readr, magrittr, rhdf5 (available on Bioconductor), data.table, Matrix, Rcpp, crayon, dplyr Rhdf5lib (available on Bioconductor), R (>= 3.5.0). Could you please make sure these are up-to-date?

yihan1119 commented 3 years ago

I have the error: Error in list2DF(.) : could not find function "list2DF" after updating all the dependent packages to latest version listed on Cran. Here are the packages version: R 3.6.1 version (my environment) readr 1.4.0 magrittr 2.0.1 rhdf5 2.34.0 data.table 1.14.0 Matrix 1.3-2 Rcpp 1.0.6 crayon 1.4.1 dplyr 1.0.5 Rhdf5lib 1.12.1

Do you have any idea that which packages could cause this problem? Thanks!

timothy-barry commented 3 years ago

Hmm. The list2DF function is part of base R, not any package dependency. What sort of machine and operating system are you using? The package has been tested fairly extensively on Mac, and we've not encountered this problem.

We will be investing significantly more time into this package starting about three weeks from now. Unfortunately, I do not quite have the bandwidth to do extensive debugging at this moment. Are you able to wait for a few weeks? We will look into this issue in greater detail then.

yihan1119 commented 3 years ago

I use hpc, so it is linux system. Thanks for helping! I can definitely wait, and at the same time I can try to run it locally on Mac system to see if it works.

timothy-barry commented 3 years ago

Got it. And if you have time, that would be helpful, thanks.

(I'll add you as a contributor.)

yihan1119 commented 3 years ago

I solved the problem by updating R to version 4.0.2. It seems like the list2DF function is not supported with R < 4.0. For future reference, here is my environment in linux system: R 4.0.2 readr 1.4.0 magrittr 2.0.1 rhdf5 2.34.0 data.table 1.14.0 Matrix 1.3-2 Rcpp 1.0.6 crayon 1.4.1 dplyr 1.0.5 Rhdf5lib 1.12.1

Thanks for helping!

timothy-barry commented 3 years ago

Thanks so much. This is really helpful! I'll add R > 4.0 as a requirement.

By the way, I don't mean to snoop, but it looks like you might be interested in enhancers. If by any chance you want to use the sceptre package, we added a new function that allows users to bypass ondisc entirely. The function is called run_sceptre_in_memory, and it's most appropriate for small to moderately-sized datasets. The vignette is here: https://timothy-barry.github.io/sceptre/articles/sceptre-on-moderately-sized-data.html. :)

yihan1119 commented 3 years ago

It is really good to know. Thanks for providing the new function, I really appreciate your help!

timothy-barry commented 3 years ago

Great, best of luck. Feel free to open an issue over there if you have a question.