MarcElosua / SPOTlight

Spatial Transcriptomics Capture Location Deconvolution
https://marcelosua.github.io/SPOTlight
GNU General Public License v3.0
164 stars 25 forks source link

Issue plotSpatialScatterpie with a SpatialExperiment object #70

Closed Zifeng-L closed 1 year ago

Zifeng-L commented 2 years ago

Hi there, I just want to plot a scatterpie with the axis from the mirror img.

plotSpatialScatterpie(
        x = spe,
        y = mat,
        cell_types = colnames(mat),
        img = TRUE,
        slice = SpatialExperiment::imgData(spe)[1, "sample_id"],
        scatterpie_alpha = 1,
        pie_scale = 0.4,
        axis = "h"
    )

I keep getting this error:

1660145062093

any help? Many thanks in advance.

MarcElosua commented 2 years ago

Hi @Zifeng-L,

For me it works well when I pass a a SpatialExperiment object. Can you please return what class spe is? You can also try passing the image object directly to the parameter img = SpatialExperiment::imgRaster(spe, sample_id = slice)

Hope this helps!

criphg commented 2 years ago

Same problem here. class(spe) = "SpatialExperiment", when use imgRaster(spe) in place of True only show part of image, and lost of pie chart information. The image looks good in plot(imgRaster(spe)).

Any help would be appreciated.

MarcElosua commented 2 years ago

Hi @criphg could you please share a reprex so I can look into this? Have you tried passing the image object directly to the img parameter - img = SpatialExperiment::imgRaster(spe, sample_id = slice) Thank you!