plevritis-lab / CELESTA

Automate unsupervised machine learning cell type identification using both protein expressions and cell spatial neighborhood information for multiplexed in situ imaging data. No training dataset with cell type labels is required.
Apache License 2.0
29 stars 10 forks source link

Fix bug related to subsetting columns from dataframe #24

Open DanInci opened 6 months ago

DanInci commented 6 months ago

With current code, whenever a single cell type column is subset from the current_cell_prob data frame, the result is no longer a data frame. This leads to incorrect number of dimensions error downstream during which.max.

To replicate, have only one cell type on a level in the nested lineage hierarchy. E.g. FOXP3+ T cell

cell_types | Lineage_level
-- | --
Stroma | 1_0_1
Tumor | 1_0_2
pDC | 2_0_3
Macrophage | 2_0_4
Neutrophil | 2_0_5
CD4+ T cell | 2_0_6
CD8+ T cell | 2_0_7
B cell | 2_0_8
FOXP3+ T cell | 3_6_9