-
Notifications
You must be signed in to change notification settings - Fork 28
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
SaveSeuratRds(): Is there a way to alter directory address of 'on-disk' matrices in Seurat object #198
Comments
Hi @jvelghe, Many Thanks for this. I'll give it a go. Regarding your question, if I understand your question correctly, I use the following for saving and loading data:
|
@jvelghe The directory name of the BP cells object must be stored in multiple places. After changing the location (as you describe) certain procedures, like trying to convert the 'in memory' matrix back to an 'on disk' matrix, Seurat still reports the old directory. seurat_obj[["RNA"]]$counts
#> 27379 x 66782 IterableMatrix object with class RenameDims
#> Row names: ABCA13, PENK-AS1 ... SLC7A7
#> Col names: 10X318_7:GGGTTTAGTTACGATC, 10X318_8:CCCGGAAGTGACTGAG ... 10X145_3:AACAGGGCAGCCGTCA
#> Data type: double
#> Storage order: column major
#> Queued Operations:
#> 1. Concatenate cols of 12 matrix objects with classes: RenameDims, RenameDims ... RenameDims (threads=0)
#> 2. Select rows: 1, 2 ... 27379 and cols: 1, 5345 ... 49485
#> 3. Reset dimnames
> as(object = seurat_obj[["RNA"]]$counts, Class = "dgCMatrix")
#> Error: Missing directory: /scratch/c.cXXXXXX/results/01R_objects/CaB_BP
> seurat_obj@assays[["RNA"]]@layers[["counts"]]@matrix@matrix@matrix_list[[1]]@matrix@matrix@matrix@matrix@matrix@matrix@matrix@matrix@matrix@matrix@dir
#> [1] "/scratch/c.cXXXXXX/results/01R_objects/CaB_BP"
> seurat_obj@assays[["RNA"]]@layers[["counts"]]@matrix@matrix@matrix_list[[1]]
#> 27379 x 5344 IterableMatrix object with class RenameDims
#> Row names: ABCA13, PENK-AS1 ... SLC7A7
#> Col names: 10X318_7:GGGTTTAGTTACGATC, 10X318_7:TGTGTGAGTTCCGCTT ... 10X318_7:GGGCTCATCCACAGGC
#> Data type: double
#> Storage order: column major
#> Queued Operations:
#> 1. Load compressed matrix from directory /scratch/c.cXXXXXX/results/01R_objects/CaB_BP
#> 2. Select rows: 1, 3 ... 59357 and cols: 1, 3 ... 32673
#> 3. Reset dimnames
#> 4. Reset dimnames
#> 5. Reset dimnames
#> 6. Reset dimnames
#> 7. Reset dimnames
#> 8. Reset dimnames
#> 9. Reset dimnames
#> 10. Reset dimnames
#> 11. Reset dimnames
> seurat_obj@assays[["RNA"]]@layers[["counts"]]@matrix@matrix@matrix_list[[1]]@matrix@matrix@matrix@matrix@matrix@matrix@matrix@matrix@matrix@matrix@dir <- '/Users/XXXXXX/Desktop/results/01R_objects/CaB_BP'
> seurat_obj@assays[["RNA"]]@layers[["counts"]]@matrix@matrix@matrix_list[[1]]
#> 27379 x 5344 IterableMatrix object with class RenameDims
#> Row names: ABCA13, PENK-AS1 ... SLC7A7
#> Col names: 10X318_7:GGGTTTAGTTACGATC, 10X318_7:TGTGTGAGTTCCGCTT ... 10X318_7:GGGCTCATCCACAGGC
#> Data type: double
#> Storage order: column major
#> Queued Operations:
#> 1. Load compressed matrix from directory /Users/XXXXXX/Desktop/results/01R_objects/CaB_BP
#> 2. Select rows: 1, 3 ... 59357 and cols: 1, 3 ... 32673
#> 3. Reset dimnames
#> 4. Reset dimnames
#> 5. Reset dimnames
#> 6. Reset dimnames
#> 7. Reset dimnames
#> 8. Reset dimnames
#> 9. Reset dimnames
#> 10. Reset dimnames
#> 11. Reset dimnames
> as(object = seurat_obj[["RNA"]]$counts, Class = "dgCMatrix")
Error: Missing directory: /scratch/c.cXXXXXX/results/01R_objects/CaB_BP |
Hello,
I have been running an analysis in Seurat 5 that is partially run on a local machine and a remote server, and I've been trying to work out how to change the address of where the BP cell generated count matrices are located. After moving Seurat objects generated remotely to my local machine, I encounter errors when trying to run certain functions as the root directory for the count data is set to the remote directory, rather than the local directory. See here for more details.
The
SaveSeuratRds()
function looks as if it may be able to change this directory address, but there does not appear to be functionality to just change it without moving the on-disk layers from their original location. I've tried runningSaveSeuratRds()
withmove = F
, but when you reload the object the layers are missing:When running
SaveSeuratRds()
withmove = T
, obviously the original path is not found (this also occurs when settingrelative = T
orrelative = F
).I've also tried digging around the Seurat Object, but I can't put my finger where this address is stored. The best I could do was find a list of 28 identical items containing the following, but I'm not convinced this is worth changing as it looks like a log:
Matrix_list
So a couple of questions then:
SaveSeuratRds()
or otherwise?SaveSeuratRds()
to handle local / remote analyses?Many thanks.
The text was updated successfully, but these errors were encountered: