Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Random Effects #134

Open
jgockley62 opened this issue May 3, 2024 · 4 comments
Open

Multiple Random Effects #134

jgockley62 opened this issue May 3, 2024 · 4 comments

Comments

@jgockley62
Copy link

Hi,

I have a data set of single cell RNA seq run out on 167 individuals, with individuals spread across several batches. I want to run a model across all cells such as ~ (1|Indv_ID) + (1|Batch) + cov_1 + cov_2. From what I understand, I could change the Indvidual ID to column name to sample_id and run:

mmDS(sce,
     covs = c( "cov_1" + "cov_2" ),
     method = "dream2",
     n_threads = 32 )

But this would only specify a mixed linear model of ~ (1|Indv_ID) + (1|Batch) + cov_1 + cov_2 correct?
How could I add Batch as random effect, would renaming the column ID of batch to (1|Batch) ?
Thanks

@plger
Copy link
Collaborator

plger commented May 4, 2024 via email

@jgockley62
Copy link
Author

Using as a fixed is possible, albeit not the most optimal. Its not posible to use a mixed model an then pseudobulk the corrected expression is it? ie

  1. correct on the cell level: ~ (1|batch) + mt_Percent + logUMI
  2. pseudobulk by individual
  3. DE Analysis: ~ (1|IndvID) + sex + age + disease

@plger
Copy link
Collaborator

plger commented May 7, 2024

Hi,
of course you can do that, but you lose the uncertainty related to the effect of the covariates you correct for, which is dangerous. This is getting into an area where we don't have very clear facts on which to base decisions, but I'm pretty confident that this is considerably worse than treating your batches as fixed effects.
If you really insist on fitting the model you want to fit (and again I'm not sure you should), you can do it by splitting your clusters and manually running dream on each (instructions for dream are available in this vignette).

@jgockley62
Copy link
Author

I'll poke around the options and see how it pans out, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants