Open PilanEli opened 2 years ago
Do you have mouse data? If so, then there may be no marker genes. cell_markers_genes_score generated in line 40 of the function (original R script file downloaded manually) may be empty.
Hi
I have the data; however i think i have identified the problem. I didn't rescue all the genes after applying the integration.
Thank you!
Hi
I have the data; however i think i have identified the problem. I didn't rescue all the genes after applying the integration.
Thank you!
Hello,
I am having the same problem, how did you fix this?
Thanks
I am having the same problem, how did you fix this?
@dmclean22 I'm not OP or developer but for me I accidently set it to a different layer, so make sure that you select the correct assay, either setting it indectory DefaultAssay(sc) <- "SCT"
or set it in the function call. Else you need to look in the @assay$SCT$scale.data and see what in particular is going on with the genes (rows )
Hi I face the same error due to my Seurat object being made with "use.names = F", which gives you ENSEMBL ID instead of gene ID change to "use.names = T" and works again
I have a similar problem running the example on the readme page. I am using Seurat 5.0 and it seems problematic:
es.max = sctype_score(scRNAseqData = pbmc[["RNA"]]@scale.data, scaled = TRUE, gs = gs_list$gs_positive, gs2 = gs_list$gs_negative)
I changed to: es.max = sctype_score(scRNAseqData = pbmc@assays$RNA@layers$scale.data, scaled = TRUE, gs = gs_list$gs_positive, gs2 = gs_list$gs_negative)
and then got the same error:
Could anyone help? Thanks
Hi, just to confirm I am experiencing the same error as @chenli-bioinfo mentioned above with a Seurat v5 object, no solution as of yet - would appreciate any advice!
@chenli-bioinfo found a workaround for using Seurat v5, it isn't ideal.
If you create a new assay by casting your RNA assay5 to a v3 assay with as() like below:
pbmc3k[["RNA3"]] <- as(object = pbmc3k[["RNA"]], Class = "Assay")
you can then alter the sctype function to use the new assay instead of the original RNA assay. I have used this with my data and it has worked as expected.
Please, take a look to this other issue and to the tutorial note:
# NOTE: scRNAseqData parameter should correspond to your input scRNA-seq matrix.
# In case Seurat is used, it is either pbmc[["RNA"]]@scale.data (default), pbmc[["SCT"]]@scale.data, in case sctransform is used for normalization,
# or pbmc[["integrated"]]@scale.data, in case a joint analysis of multiple single-cell datasets is performed.
For me, the error occurs after I modified the gene_sets_prepare
function to silent the checkgenessymbol
and toupper
function (which I have no idea why they were necessary). Therefore, gene names with special symbols would not be discarded. And gene names would not be converted to uppercase. Under this circumstance, I would have to modify the sctype_score
function to silent the toupper
function again, and everything works fine.
hello, I ran into the same issue. And I check the source code.
I found the issue in step '# subselect genes only found in data".
GeneIndToKeep = rownames(scRNAseqData) %in% as.character(gs[[d_]])
rownames(scRNAseqData) is upper case, but my input mouse gs is lower case,
So I change gs_list$gs_positive into upper case and solved it.
gs = lapply(gs_list$gs_positive, toupper
)
The problem arise, as there is no gene names in the scale.data layer, can be solve by
pbmc_mat = as.matrix(pbmc[["RNA"]]@layers$scale.data)
rownames(pbmc_mat) = rownames(pbmc)
colnames(pbmc_mat) = colnames(pbmc)
es.max = sctype_score(scRNAseqData = pbmc_mat, scaled = TRUE,
gs = gs, gs2 = gs_list$gs_negative)
Here, I created a matrix (pbmc_mat), then set the rownames and colnames from the seurat object (pbmc).
I see this issue with Seurat 5.1.0 objects as well, irrespective whether scaled = T or F, or whether object is pre- or post-integration. Would greatly appreciate @IanevskiAleksandr to weigh in. Thanks!
PS. Traced this back to how data_type is handled in line 25 of auto_detect_tissue_type.R, replaced with: as.matrix(LayerData(object = seuratObject,layer = data_type))
Hi
Dear Aleksandr
Thanks for the useful software. May I ask how to solve the " Error in Z[cell_markers_genesscore[jj, "gene"], ] : subscript out of bounds." After running the commands to get cell-type by cell matrix this error is displayed.
I'm using a file normalized by sctransform.
Thank you very much, Yours sincerely,
Eli