This is a test version of Biostars. For the public version, visit https://www.biostars.org.
zinbwave is not generating observational weights (zinbwave_1.8.0)

I have a problem in which I am trying to use the zinbwave R package for differential expression analysis from snRNAseq data, but I cannot get the necessary observational weights.

I am using: R version 3.6.1 zinbwave_1.8.0

I created a SummarizedExperiment object by using data and metadata from a Seurat object:

se <- SummarizedExperiment(seurat@assays$RNA@counts,
                                       colData = seurat@meta.data)

After filtering the se_object by gene counts, I use the 'zinbwave' command to generate a SingleCellObject

singlecell <- zinbwave(se, K=2, X="~genotype", epsilon=1000)

The SingleCellExperiment object ('singlecell') is generated, but after creating the object there is no "weights" data in the object.

Trying to access weights data:

weights <- assay(singlecell, "weights")

results in this error message:

Error in assay(singlecell, "weights") : 
  'assay(<SingleCellExperiment>, i="character", ...)' invalid subscript 'i'
'weights' not in names(assays(<SingleCellExperiment>))

In the documentation, it says that "Since version 1.1.5, zinbwave computes the observational weights by default." However, I also tried specifying "observationalWeights = TRUE" and this did not appear to lead to any weights being generated, either.

Why are the weights not generated by the zinbwave function? Could it be because of a problem with how I set up the SummarizedExperiment? Or is it more likely related to the way I have used the zinbwave command?

rna-seq r zinbwave bioconductor

Output of assayNames(singlecell)?

Hi, thanks for your question.

The output of 'assayNames(singlecell)' is: NULL

The output of 'singlecell@assays' is: An object of class "SimpleAssays" Slot "data": List of length 1

1 answer

Hi, thanks for your question.

The output of 'assayNames(singlecell)' is: NULL

The output of 'singlecell@assays' is: An object of class "SimpleAssays" Slot "data": List of length 1

Log in to answer this question.