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

Skip to content

Computing observational weights in the zinbwave function using a sparse matrix #60

@rfarouni

Description

@rfarouni

Hi,

When I try to compute the observational weights using by supplying a fitted model object to the zinbwave function zinbwave(sce10x, fitted_model = zinb, K = 0,observationalWeights = TRUE) I get the following error

Error in t.default(x) : argument is not a matrix

Since the matrix in the SCE object is sparse, I had to convert the count matrix to dense manually

weights <- computeObservationalWeights(zinb, as.matrix(assay(sce10x)))
dimnames(weights) <- dimnames(sce10x)
assay(sce10x, "weights") <- weights

I think a one line change to the code can fix the problem.

Best,
Rick

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