-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Hello,
I have hit an unexpected issue when trying to use SICs to model sparsely labeled cell-types:
cts <- unique(adata$obs$Immune_func)
cts
[1] tumorcells othercells granulocytecells cd4tcells fibroblastcells cd4tcells_ICOS
[7] endothilialcells myofibroblastcells cd4tregcells immunenoscells myeloidnoscells macrophagecells
[13] bcells plasmacells cd8tcells cd4tcells_PD1 cd8tcells_Granzymeb cd4tregcells_ICOS
[19] cd4tcells_PDL1 cd8tcells_PD1 cd4tregcells_PD1 cd4tregcells_PD1_ICOS cd4tcells_PD1_ICOS macrophagecells_PDL1
[25] cd4tcells_PD1_PDL1 cd8tcells_PD1_PDL1 immunenoscells_IDO1_IDO1 macrophagecells_IDO1_IDO1 cd8tcells_PD1_Granzymeb fibroblastcells_IDO1
[31] fibroblastcells_IDO1_IDO1 cd4tcells_IDO1 macrophagecells_IDO1 cd4tcells_IDO1_IDO1 macrophagecells_PDL1_IDO1 immunenoscells_IDO1
36 Levels: bcells cd4tcells cd4tcells_ICOS cd4tcells_IDO1 cd4tcells_IDO1_IDO1 cd4tcells_PD1 cd4tcells_PD1_ICOS cd4tcells_PD1_PDL1 cd4tcells_PDL1 ... tumorcells
prep <- prepare_spatial_model_data(
x = adata$obs$x,
y = adata$obs$y,
cell_type = adata$obs$Immune_func,
image_id = adata$obs$patientid,
patient_metadata = patient_metadata,
n_dummy = 500,
type_idx = 1,
#n_basis_functions = 4,
max_dist = 150
)
fit <- run_SHADE_model(
prep$stan_data,
method = "variational",
seed = 123,
)
sics_group <- extract_group_sics(
fit = fit,
prep = prep,
bands = "simultaneous",
alpha = 0.1,
)
Error in mul.tensor(x_tensor, 3, y_tensor, 2, by = 1) :
mul.tensor: i incompatible to j
In addition: Warning message:
In .extract_group_sics(draws, x_des, distance_seq, source_types, :
Expected 3 coefficients for cd4tcells -> bcells, found 24
This seems to work when I use a coarser cell-type definition that only has 12 classes (adata$obs$celltypes).
Thank you!