Closed sdwien closed 1 year ago
It seems that the objects in matrix_list are themselves lists, not matrices. What format is your data in on the filesystem?
Dear Andrew,
thanks a lot for looking into it.
I checked the matrix_list object; it is a list, as expected:
class(matrix_list)
[1] "list"
I also checked the two elements of the list, and as you said, these are also recognized as lists:
class(matrix_list$PGWT)
[1] "list"
class(matrix_list$PGKO)
[1] "list"
Is this not the expected behaviour of the read10X function? In the usage of the function, it says: "Value: List of merged matrices across data types (returns sparse matrix if only one data type detected), or nested list of matrices organized by sample if merge=F
Did I specify the input directories (sample/outs/raw_feature_bc_matrix) correctly? This is a plain Single Cell 3' v3 experiment, as far as I know. I assume that what is supposed to be loaded is the sample/outs/raw_feature_bc_matrix/matrix.mtx.gz , correct? This is also what I see inside the loaded elements:
matrix_list$PGWT
$`Gene Expression`
32285 x 1305055 sparse Matrix of class "dgCMatrix"
[[ suppressing 32 column names ‘AAACCCAAGAAACCAT’, ‘AAACCCAAGAAACCCG’, ‘AAACCCAAGAAACTGT’ ... ]]
[[ suppressing 32 column names ‘AAACCCAAGAAACCAT’, ‘AAACCCAAGAAACCCG’, ‘AAACCCAAGAAACTGT’ ... ]]
Xkr4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......
Gm1992 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......
Gm19938 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......
Gm37381 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......
[...]
So maybe I'd have to use this slot of the matrix_list for createLiger:
class(matrix_list$PGWT$`Gene Expression`)
[1] "dgCMatrix"
attr(,"package")
[1] "Matrix"
I ran the following:
PG_liger <- createLiger(list(PGWT = matrix_list$PGWT$
Gene Expression, PGKO = matrix_list$PGKO$
Gene Expression))
However, there is an error:
Error in createLiger(list(PGWT = matrix_list$PGWT$`Gene Expression`, PGKO = matrix_list$PGKO$`Gene Expression`)) :
At least one cell name is repeated across datasets; please make sure all cell names
are unique.
I believe I have seen this error in another thread here on github, so I'll read up on it there. I would appreciate though if you could let me know if this would be the correct way to load the data or whether you have any further suggestions.
Many thanks, best, Sophia
Yeah, the dgCmatrices look like exactly what you want. It appears to me that it is loading correctly and failing on validation, which is a step in the correct direction.
Dear LIGER Team,
I am just trying to test LIGER for the first time, and for this purpose, I am trying to load two 10x single cell samples using the
read10X
and thecreateLiger
functions. I was trying to follow this tutorial http://htmlpreview.github.io/?https://github.com/welch-lab/liger/blob/master/vignettes/Integrating_multi_scRNA_data.html , however, there, data are loaded from .rds files and it is not further elaborated how to load the data from the matrix_list object. I was trying to do it as follows :matrix_list <- read10X(sample.dirs =c("WTsample/outs/raw_feature_bc_matrix", "KOsample/outs/raw_feature_bc_matrix"), sample.names = c("PGWT", "PGKO"), merge = F)
This step seems to work, says:
Then, I am trying to create the LIGER object:
liger <- createLiger(list(WT = matrix_list$PGWT, KO = matrix_list$PGKO))
Here, I am getting an error:
I am surely missing something obvious, but I cannot find out what, so thanks a lot in advance for your help,
best, Sophia