MangiolaLaboratory / sccomp

Testing differences in cell type proportions from single-cell data.
https://stemangiola.github.io/sccomp/
91 stars 7 forks source link

Multiple covariates use case #154

Open andrewdchen opened 2 weeks ago

andrewdchen commented 2 weeks ago

Hello authors of sccomp!

Not a bug here, but just wondering what the correct way to specify this regression is. I'm trying to regress cell type abundance (as specified by the 'annot' column) on grade (factor), whilst controlling for subtype (factor) and age (integer). The code isn't working as is. Hard to report what the problem is right now so just posing an open question in case I'm missing something obvious.

Thanks!

sccomp_result = 
  seurat |>
  sccomp_estimate( 
    formula_composition = ~ grade + subtype + age, 
    .sample =  batch, 
    .cell_group = annot, 
    bimodal_mean_variability_association = TRUE,
    cores = 16 
  ) |> 
  sccomp_remove_outliers(cores = 1) |> # Optional
  sccomp_test()

Thanks!

stemangiola commented 2 weeks ago

Hello Andrew, can you please copy/paste the full error, and an anonimised dataset to reproduce the error?

Thanks.