ChenWeiyan / LandSCENT

Landscape Single Cell Entropy
19 stars 6 forks source link

too many NULL in SR #8

Closed zhumengyan closed 4 years ago

zhumengyan commented 4 years ago

Thanks for your tool. When I applied the tool to my data, the SR for about 1/3 of cells is NULL.

ChenWeiyan commented 4 years ago

Hi,

It could be quite a lot reasons since I am not aware of the input data format.

Did you follow the steps in our vignette? Or is there any warning/error information you can provide?

Perhaps you could firstly check if the gene identifiers or cell names are properly set? Then whether the data is well normalized to gain a non-zero minimum value?

And also check the integrated data matrix in the out put list, to see if the integration is done perfectly?

Best, Weiyan

zhumengyan commented 4 years ago

Thanks for your quickly reply. Here is my code. ` library(Seurat) require(scater) library(LandSCENT) require(AnnotationDbi) require(org.Hs.eg.db) data(net17Jan16.m)

tumor info

tumor <- readRDS("./result/integration/seurat/seurat_integration1.rds") tumor_sce <- as.SingleCellExperiment(tumor, assay = "RNA")

tumor_sce <- normalize(tumor_sce, log_exprs_offset = 1.1) tumor.m <- as.matrix(assay(tumor_sce, i = "logcounts")) min(tumor.m) anno.v <- mapIds(org.Hs.eg.db, keys = rownames(tumor.m), keytype = "SYMBOL", column = "ENTREZID", multiVals = "first") unique_anno.v <- unique(anno.v) tumor_New.m <- matrix(0, nrow = length(unique_anno.v), ncol = dim(tumor.m)[2]) for (i in seq_len(length(unique_anno.v))) { tmp <- tumor.m[which(anno.v == unique_anno.v[i]) ,] if (!is.null(dim(tmp))) { tmp <- colSums(tmp) / dim(tmp)[1] } tumor_New.m[i ,] <- tumor_New.m[i ,] + tmp } rownames(tumor_New.m) <- unique_anno.v colnames(tumor_New.m) <- colnames(tumor.m) tumor_New.m <- tumor_New.m[-which(rownames(tumor_New.m) %in% NA) ,] tumor_New2.m <- tumor_New.m Integration.l <- DoIntegPPI(exp.m = tumor_New2.m, ppiA.m = net17Jan16.m) str(Integration.l) SR.o <- CompSRana(Integration.l, local = TRUE, mc.cores = 6) `

ChenWeiyan commented 4 years ago

Hi,

Thanks for providing your script.

But unfortunately, I do not spot anything wrong. This seems to be the standard procedure as I suggested in the vignette T_T

However could you tell me, in the 'Integration.l$expMC' matrix, how many genes are left?

Best, Weiyan

zhumengyan commented 4 years ago

` dim(Integration.l$expMC)

10266 18489

` 10266 genes left

ChenWeiyan commented 4 years ago

emmmmmm.....Seems also fine.

No idea what is going on here T_T