Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Sample 3 has only 0 counts! #70

@ambertrujillo

Description

@ambertrujillo

Hello there and thank you in advance for your help!

I am running zinbwave on a single cell dataset with many 0s. The following is my code and error:

Cluster9 <- SingleCellExperiment(list(counts=GetAssayData(object = Aotus.Cluster9, slot = "counts")))
Cluster9

#class: SummarizedExperiment 
#dim: 21456 119 
#metadata(0):
#assays(1): counts
#rownames(21456): Aotus-ENSANAG00000002703 Aotus-LMNB1 ...
#  Aotus-ENSANAG00000028075 Aotus-ENSANAG00000031036
#rowData names(0):
#colnames(119): ACGGAGATCTTCAACT-1_1 ACTGCTCCAATGGATA-1_1 ...
#  GTCATTTCACAAGTAA-1_6 TCTTCGGGTCCGTGAC-1_6
#colData names(0):

# Filter lowly expressed genes, genes that do not have at least 1 reads in at least 1 samples
filter <- rowSums(assay(Cluster9)>1)>1

Cluster9 <- Cluster9[filter,]

# Identify the 100 most variable genes, which will be the input for zinbwave. 
assay(Cluster9) %>% log1p %>% rowVars -> vars
names(vars) <- rownames(Cluster9)
vars <- sort(vars, decreasing = TRUE)

Cluster9 <- Cluster9[names(vars)[1:100],]

assayNames(Cluster9)[1] <- "counts" #To avoid needing to specify which assay we should use for the zinbwave workflow

# ZINB-WaVE

Cluster9_zinb <- zinbwave(Cluster9, K = 2,  BPPARAM=SerialParam(), epsilon=1e12, normalizedValues=TRUE, observationalWeights = TRUE)

I get the following error:

Error in zinbInitialize(m, Y, nb.repeat = nb.repeat.initialize, BPPARAM = BPPARAM) : 
  Sample 3 has only 0 counts!

However, when I check the rowSums there doesn't appear to be any rows that return 0 counts.

table(rowSums(assay(Cluster9)) == 0)
#FALSE 
#  100

Any suggestions/help would be much appreciated!

Best,
Amber

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions