Vivianstats / scINSIGHT

Matrix factorization model for interpreting single cell gene expression in biologically heterogeneous data
https://genomebiology.biomedcentral.com/articles/10.1186/s13059-022-02649-3
20 stars 2 forks source link

Error in extract running results and create da_tsne #10

Closed aboutfanfan closed 7 months ago

aboutfanfan commented 7 months ago

I have successfully run_scINSIGHT and got the real.scobj object, following the tutorial you gave.

image

It chooses k=7. When I run the following code I get an error: da_tsne = data.frame(tSNE1 = res_tsne$Y[,1], tSNE2 = res_tsne$Y[,2], sample = sample, condition = condition, celltype = celltype, clusters = clusters)

# Error in data.frame(tSNE1 = res_tsne$Y[, 1], tSNE2 = res_tsne$Y[, 2], :
#  Parameter values mean different row numbers: 105433, 105434

This looks like there is an inconsistency in the length of the parameters. So I checked the individual inputs:

image

I found that cluster has one more element than other input. clusters = as.character(unlist(real.scobj@clusters)) but sample,condition,celltype are from real.counts.

So I checked real.counts and real.scobj and found that real.scobj has one more element than real.counts, I don't know why real.counts:

image

real.scobj:

image

Could you please tell me which step I might have gone wrong, thank you very much!