ludvigla / semla

Other
54 stars 5 forks source link

error in MapMultipleFeatures #37

Open renyzh5 opened 2 days ago

renyzh5 commented 2 days ago

hello, I have met a problem when running MapMultipleFeatures. do you have any solution? think you!

DefaultAssay(semla.data)<-'celltypeprops' semla.data <- semla.data |> LoadImages()

── Loading H&E images ──

ℹ Loading image from /var/folders/th/9q_h4z017x398y0yh73kxd4c0000gn/T//RtmpRA84mS/1.png ℹ Scaled image from 482x600 to 400x498 pixels ℹ Saving loaded H&E images as 'rasters' in Seurat object

MapMultipleFeatures(semla.data,

  • image_use='raw',
  • features = selected_celltypes,
  • scale = c("free"),pt_size = 2.5,
  • override_plot_dims = T,
  • colors = c("#E95C59", "#57C3F3", "#53A85F", "#E4C755", "lightgrey"))+
  • theme(legend.key.size = unit(10, "pt"))+
  • labs(title='225847_C_L') Error in m[i, j, drop = FALSE] : subscript out of bounds
renyzh5 commented 2 days ago

even though I set 'DefaultAssay(semla.data)<-'Spatial'', the tissue remains.

jemorlanes commented 1 day ago

Hello! I have tried the code you write here with the mouse brain dataset provided by semla, and the code itself should work. I suggest checking that the celltypes in selected_celltypes match exactly the names of the celltypes in the celltypeprops assay. Also check for NAs or other potentially weird values in the celltypeprops assay, to check that the deconvolution worked properly.

As a side note, if you want to plot celltypes, DefaultAssay(semla.data)<-'celltypeprops is the right way to go (as you were doing at the beginning), as the proportions are stored there and not in the Spatial assay.

Hope this helps!