MangiolaLaboratory / sccomp

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

Warning message when duplicated samples #90

Open shikhanayar opened 1 year ago

shikhanayar commented 1 year ago

Hi, using scCOMP for the first time; the issue I'm running into is that for some reason cell_group and sample calling are not working appropriately from a Seurat object when running scCOMP.

Here is the code (contrasts have been pre-defined):

results1 <- seurat |> sccomp_glm( formula_composition = ~ 0 + disease_inflammation_response, contrasts = contrasts, .sample = sample, .cell_group = cell_type, bimodal_mean_variability_association = TRUE )

Here is the error message:

sccomp says: outlier identification first pass - step 1/3 Joining with by = join_by(sample)Joining with by = join_by(cell_group)error occurred during calling the sampler; sampling not done error occurred during calling the sampler; sampling not done error occurred during calling the sampler; sampling not done error occurred during calling the sampler; sampling not done error occurred during calling the sampler; sampling not done error occurred during calling the sampler; sampling not done here are whatever error messages were returned [[1]] Stan model 'glm_multi_beta_binomial' does not contain samples.

[[2]] Stan model 'glm_multi_beta_binomial' does not contain samples.

[[3]] Stan model 'glm_multi_beta_binomial' does not contain samples.

[[4]] Stan model 'glm_multi_beta_binomial' does not contain samples.

[[5]] Stan model 'glm_multi_beta_binomial' does not contain samples.

[[6]] Stan model 'glm_multi_beta_binomial' does not contain samples.

Error in draws[, draws_colnames, drop = FALSE] : no 'dimnames' attribute for array

Any help would be great. Thanks!

stemangiola commented 1 year ago

Hello @shikhanayar,

can you send me a minimal object, anonymised if needed, so I can test it?

shikhanayar commented 1 year ago

Thanks for your reply @stemangiola . I was able to resolve the above issue (I think that there was an issue in my samples column).

stemangiola commented 1 year ago

Thanks for your reply @stemangiola . I was able to resolve the above issue (I think that there was an issue in my samples column).

Great, however, knowing your specific case would help me create a warning that would leave users less confused if this happens.

shikhanayar commented 1 year ago

For sure, I believe that some of the sample rows were duplicated, so when creating a dataframe of cell type and samples, there weren't complete distinct values. Follow-up question -- are there scenarios you have seen where 2D plots were not computed by plots<- plot_summary(results)?

stemangiola commented 1 year ago

are there scenarios you have seen where 2D plots were not computed by plots<- plot_summary(results)?

Can you be more elaborate more?

shikhanayar commented 1 year ago

Sorry, when I run the above function using the results dataframe, the only plots generated are boxplot and credible_intervals_1D. In your vignette, I also see the credible_intervals_2D plot but I'm not seeing that here.

stemangiola commented 11 months ago

I am refactoring the plots in a new release. 1d vs 2d depends on how you model the variability.

I will keep you posted.

stemangiola commented 9 months ago

Can you please reinstall from github and let me know?