zktuong / ktplots

Some tools for plotting single-cell data
https://zktuong.github.io/ktplots/
MIT License
162 stars 31 forks source link

proble Please check your options for splitby_key and your celltypes. #91

Open dd123456000 opened 9 months ago

dd123456000 commented 9 months ago

I encountered the following issue while using plotcb.

image

image

I've tried changing many things, but I'm still getting the same error.

dd123456000 commented 9 months ago

image

dd123456000 commented 9 months ago

image

image

dd123456000 commented 9 months ago

"I changed 'celltype' to 'cell_type,' and now I'm encountering the error 'Error in c_type1[[i]]: subscript out of bounds.'"

zktuong commented 9 months ago

Does the "celltype" or "cell_type" exist in your seurat@meta.data? Also remove the the split.by argument - don't provide NA to it.

luostrowski commented 9 months ago

I'm having the same problem. The "predicted" column exists in the object (ad is a SingleCellExperiment object).

plot_cpdb2(
    scdata = ad,
    cell_type1 = "HSC",
    cell_type2 = ".",
    celltype_key = "predicted", # column name where the cell ids are located in the metadata
    means = means,
    pvals = pvals,
    deconvoluted = HD_deconv 
)

Error in plot_cpdb(scdata = scdata, cell_type1 = cell_type1, cell_type2 = cell_type2, : Please check your options for splitby_key and your celltypes.

zktuong commented 9 months ago

hi @luostrowski, just in case, can you check if the means and pvals are the correct ones that match to your ad object. when library(ktplots) is called, it will also load the internal data (also called means and pvals). this may overwrite your actual objects.

luostrowski commented 9 months ago

Hi! Thank you for the prompt reply! I changed the names of the data frames to make sure it was not being overwritten, but I got the same error :(

plot_cpdb2(
    scdata = ad,
    cell_type1 = "HSC",
    cell_type2 = ".",
    celltype_key = "predicted", # column name where the cell ids are located in the metadata
    means = HD_means,
    pvals = HD_pvals,
    deconvoluted = HD_deconv
)

Error in plot_cpdb(scdata = scdata, cell_type1 = cell_type1, cell_type2 = cell_type2, : Please check your options for splitby_key and your celltypes.

zktuong commented 9 months ago

would you be able to share your files (ad, HD_means, HD_pvals, HD_deconv) so that i can do some testing? I just sent you the secure voucher link via filesender (to your gmail)

zktuong commented 9 months ago

issue may be related to https://github.com/zktuong/ktplotspy/issues/51

zktuong commented 7 months ago

seems like the fix introduces further bugs (e.g. plotting non-significant interactions). need to think of a different solution

stale[bot] commented 5 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.