sccomp icon indicating copy to clipboard operation
sccomp copied to clipboard

Multiple covariates use case

Open andrewdchen opened this issue 1 year ago • 1 comments

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!

andrewdchen avatar Oct 04 '24 22:10 andrewdchen

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

Thanks.

stemangiola avatar Oct 06 '24 23:10 stemangiola

Ah realized I was supposed to put patient id in the sample slot not single cell ids... this was the final regression that I did.

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

andrewdchen avatar Nov 14 '24 14:11 andrewdchen