theMILOlab / SPATA2

A Toolbox for Spatial Gene Expression Analysis
77 stars 15 forks source link

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

Open wlwang20 opened 9 months ago

wlwang20 commented 9 months 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 9 months 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 9 months 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 3 months ago

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