theMILOlab / SPATA2

A Toolbox for Spatial Transcriptomics Analysis
https://themilolab.github.io/SPATA2/
105 stars 17 forks source link

PlotSurface smoothing works for individual genes, but not gene sets #89

Open wlwang20 opened 1 year ago

wlwang20 commented 1 year ago

Hi All,

I am hoping to plot some gene sets using PlotSurface and use the smooth_span parameter to smooth the expression levels of the gene sets. However, it does not seem like the smoothing parameter is working in this use case. I have tried using individual genes (the smoothing works there), and plotSurfaceInteractive (which smoothes the expression correctly), but plotSurface does not seem to able to smooth the expression of gene sets. Please let me know if there is something I am omitting for gene_sets.

object_t275 <- downloadSpataObject("275_T", file = NULL)
plotSurface(object_t275, 
              color_by = "HM_HYPOXIA",
              display_image = FALSE,
              smooth = TRUE,
              smooth_span = 1.0)

image

Plotting individual genes and smoothing does seem to work...

plotSurface(object_t275, 
              color_by = "VEGFA",
              display_image = FALSE,
              smooth = TRUE,
              smooth_span = 1.0)

image

kueckelj commented 1 year ago

Hello wlwang20, thanks for mentioning this bug. I have fixed the code. Can you install the master branch again and see if it works now for you?

Best regards

Jan

wlwang20 commented 1 year ago

Yes thank you. It is working now. As a follow-up, I do notice that the 'gsea' method for plotting gene sets doesn't seem to recapitulate expected outputs. For example, in sample #UFK275_T, the Hypoxia region plotted with the code below doesn't match that which was published.

plotSurface(object_t275, 
             color_by = "HM_HYPOXIA",
             method_gs = 'ssgsea',
             display_image = FALSE,
             smooth = TRUE,
             smooth_span = 4.0)
Screenshot 2023-10-03 at 5 53 16 PM
wlwang20 commented 8 months ago

Wanted to follow up to see if the implementation of the ssgsea has been fixed? Thanks!

WeimengYuu commented 3 months ago

hello Jan, If i add methods_gs in the code:

plotSurface(object, color_by = "HM_HYPOXIA", display_image = T, smooth = TRUE, smooth_span = 1.0,methods_gs="ssgsea")

There will some errors: I would like to know how to apply the ssgsea method: Error in continuous_scale(aesthetics, name = name, palette = pal_gradient_n(pal_viridis(alpha, : unused argument (methods_gs = "ssgsea")

kueckelj commented 2 months ago

Hello all, sorry for the late reply. Do the problems persist in SPATA2 v3.0.0?