Open derrik-gratz opened 11 months ago
What does traceback() say? This looks like it might be originating from glmer.
On Mon, Sep 18, 2023 at 10:59 AM Derrik Gratz @.***> wrote:
Otherwise I am trying to run MAST with a full single-cell dataset of multiple identified CD8 cell subtypes, one condition with two factors, and two timepoints. I am trying to run everything in one model since all the CD8s are being processed together, but perhaps it would be better to split by celltype, although I ran a similar model successfully for combined CD4 subtypes. See the chunk below for my model formula
zlmCond <- zlm(~ cdr + cluster_labels + condition + timepoint + condition:timepoint + cluster_labels:condition + cluster_labels:timepoint + cluster_labels:condition:timepoint + (1|hash.ID), obj.sce, method = 'glmer', ebayes = FALSE, exprs_values = 'logcounts', fitArgsD = list(nAGQ=0), parallel = TRUE, silent = FALSE)
The model starts running but fails ~8% of the way through with this error:
Error in validObject(.Object) : invalid class “corMatrix” object: 'sd' slot has nonfinite elements
Again I was able to run this model formula successfully on a CD4 subset from the same dataset. Any idea what might be causing this?
— Reply to this email directly, view it on GitHub https://github.com/RGLab/MAST/issues/180, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALLAHX3KXHJFMULQF3DX5TX3CDY7ANCNFSM6AAAAAA45DDB4I . You are receiving this because you are subscribed to this thread.Message ID: @.***>
I subsetted the data by celltype to allow for a simpler design. The issue still occurs with the following model on one portion of my data with 1061 cells
zlm(~ cdr +
condition +
timepoint +
condition:timepoint +
(1|hash.ID),
obj.sce_sub,
method = 'glmer',
ebayes = FALSE,
exprs_values = 'logcounts',
fitArgsD = list(nAGQ=0),
parallel = TRUE,
silent = TRUE)
Thanks. This actually looks like a bug in lmer/glmer in that it managed to fit the model but somehow was left in an undefined state. Unless/until lme4 fixes this, I can add another test to try to trap this...
I tried subsetting to the problem cells and running it without fitArgsD = list(nAGQ=0)
and nothing changed. Not expecting a response based on that, just documenting other info that might be of interest
I pinned down a possible cause: I wasn't properly filtering out genes with low expression threshold. The problem gene in this case had 3(!) cells expressing it. When I remove that gene the model runs fine.
Even running the more complex model (not subset for celltypes) worked when removing genes expressed in less than 100 cells. So this issue may only arise if you don't follow the preprocessing steps correctly. I'm fine for this to be closed, unless you want to leave it open to prompt a patch on your end
Otherwise I am trying to run MAST with a full single-cell dataset of multiple identified CD8 cell subtypes, one condition with two factors, and two timepoints. I am trying to run everything in one model since all the CD8s are being processed together, but perhaps it would be better to split by celltype, although I ran a similar model successfully for combined CD4 subtypes. See the chunk below for my model formula
The model starts running but fails ~8% of the way through with this error:
Again I was able to run this model formula successfully on a CD4 subset from the same dataset. Any idea what might be causing this?