Irrationone / cellassign

Automated, probabilistic assignment of cell types in scRNA-seq data
Other
191 stars 79 forks source link

cell with zero counts is assigned to a cell type #58

Closed olechnwin closed 4 years ago

olechnwin commented 4 years ago

Hi, When I ran cellassign, I got a warning that some cell have 0 counts. However, that cell is assigned to a cell type. I'm wondering how come this particular cell is not assigned to other?

This is my code to run cellassign:

# creating markers gene variable
tmp <- read.table("../MSC Ob markers_v2.txt",sep="\t",header=TRUE,
 stringsAsFactors = FALSE)
tmp.lst =as.list(tmp)
bone.markers=NULL
bone.markers$symbol=tmp.lst
bone.markers.mat <- marker_list_to_mat(bone.markers$symbol)
sample.name="OS17.culture"
# raw gene expression for all bone.markers in each cluster
os17.CAinput <- subset(alldata.filt2.list[[sample.name]],features=
  rownames(bone.markers.mat))
# convert to singlecellexpreriment object
sce <- as.SingleCellExperiment(os17.CAinput,assay = "RNA")
# compute sum factor using entire assay
sce.sf <- as.SingleCellExperiment(alldata.filt2.list[[sample.name]],assay="RNA")
s=sizeFactors(computeSumFactors(sce.sf))

fit <- cellassign(exprs_obj = sce, 
 marker_gene_info = bone.markers.mat, 
 s = s, 
 learning_rate = 1e-2, 
 shrinkage = TRUE,
 verbose = FALSE)

Warning message and the empty cell assignment:

In cellassign(exprs_obj = sce, marker_gene_info = bone.markers.mat,  :
  Cells with no mapping counts are present. You might want to filter these out prior to using cellassign.

> which(colSums(assay(sce))==0)
OS17.lung_GTACAGTCATAGCACT
                      2809
> assay(sce)[,2809]
 BGLAP  SATB2   MITF NKX3-2   IBSP   SPP1  RUNX2   NT5E    ENG  ITGB1   CD44
     0      0      0      0      0      0      0      0      0      0      0
ASRGL1   MCAM   THY1 COL1A1 NFATC1   ATF4
     0      0      0      0      0      0
> celltypes(fit)[2809]
[1] "Osteoprogenitor"

And this is what is defined as markers:

> bone.markers.mat
       MSC Osteoprogenitor Pre.osteoblast Mature.osteoblast other
ASRGL1   0               0              1                 0     0
ATF4     0               0              0                 1     0
BGLAP    0               0              0                 1     0
CD44     1               0              0                 0     0
COL1A1   1               0              0                 0     0
ENG      1               0              0                 0     0
IBSP     0               0              0                 1     0
ITGB1    1               0              0                 0     0
MCAM     1               0              0                 0     0
MITF     0               1              0                 0     0
NFATC1   0               0              1                 1     0
NKX3-2   0               1              0                 0     0
NT5E     1               0              0                 0     0
RUNX2    0               1              0                 0     0
SATB2    0               1              0                 0     0
SPP1     0               0              0                 1     0
THY1     1               0              0                 0     0
Irrationone commented 4 years ago

There's a chance that CellAssign may not have fully converged with respect to this one cell, or that the mean marker expression values for Osteoprogenitor and other are not substantially different.

What are the outputs of fit$mle_params$delta and fit$mle_params$beta? Also, what is the size factor for this particular cell?

olechnwin commented 4 years ago

Sorry for the long delay in replying this. But, I cannot seem to reproduce this result. That's why I'm re-installing cellassign to make sure I can set the seed. I'm going to close this issue and will post a new issue if I ran into this issue again. Thanks for replying.