Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the single cell seurat object store in mongodb in R environment issue #251

Open
honghh2018 opened this issue Apr 10, 2023 · 0 comments
Open

Comments

@honghh2018
Copy link

Hi developer,
Thanks for the great tools to manipulate the mongod

Here is my problem:
how to insert the object data (size 1Gb) into the mongo using R script package mongolite
code below:
library(mongolite)

data <- readRDS("hg19_seurat.rds")

binary_data <- serialize(data, NULL)

mongo_con <- mongo(collection = "seurat_col", db = "seurat_db", url = "mongodb://127.0.0.1")

gridfs_id <- mongo_con$gridfs$put(data = binary_data, filename = "seurat_data")

mongo_con$disconnect()

mongo_con <- mongo(collection = "seurat_col", db = "seurat_db", url = "mongodb://127.0.0.1")

binary_data1 <- mongo_con$gridfs$get(gridfs_id)$read()

seurat_obj1 <- unserialize(binary_data1)

identical(data, seurat_obj1)

the above code show me error

can not get the object "binary_data1"
how can i fix this issue?
any advice would be appreciated.
Best,
hanhuihong

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant