**0**wrote:

Hello,

I want to use the trendVar function in screen packs to get the highly variant genes across my single cell samples.

But for some reason it is not working for me and throwing the following error:

Error in .trend_var(assay(x, i = assay.type), ..., subset.row = subset.row) :

need at least 4 values for non-linear curve fitting

I think it throws the error at lout <- .Call(cxx_fit_linear_model, QR$qr, QR$qraux, x, subset.row - 1L, FALSE)

Apparently doesn’t keep enough genes for some reason.

This is how I use it though:

dim(cells.counts)

[1] 18574 3483

sce <- SingleCellExperiment(list(counts=cells.counts))

sce <- scran::computeSumFactors(sce)

summary(sizeFactors(sce))

Min. 1st Qu. Median Mean 3rd Qu. Max.

0.08161 0.61558 0.89761 1.00000 1.28977 3.65026

quantile(logcounts(sce))

0% 25% 50% 75% 100%

0.0000000 0.0000000 0.0000000 0.7415879 13.7971704

fit <- trendVar(sce, parametric=TRUE)

Error in .trend_var(assay(x, i = assay.type), ..., subset.row = subset.row) :

need at least 4 values for non-linear curve fitting

I put the dimension of the data and the range of the values and sum factors for you in case it might help figuring out the issue.

Can you please help figure out what is going wrong here?