ludvigla / semla

Other
47 stars 6 forks source link

Calculate a P-value for correlation generated by the CorSpatialFeatures function #22

Open diala-ar opened 6 months ago

diala-ar commented 6 months ago

Thanks for the amazing package. I was wondering whether we can calculate a P-value for the spatial auto-correlation (cor column) produced by the CorSpatialFeatures function and if so how?

lfranzen commented 5 months ago

Hi @diala-ar and thank you for your question!

I'm sorry it took a while to address this and we've just pushed a few updates to the dev version of semla (no new release yet, but we're working on it) that contains an update to CorSpatialFeatures. You should now be able to set calculate_pvalue = TRUE when running CorSpatialFeatures() and you'll get an additional column in the results containing the p-values. I also added a column with BH-adjusted p-values using the p.adjust() function, but if you want another method for the corrections you should be able to do this easily by yourself using the same function on the raw p-values.

Please let me know if there's any issue with it or if it runs according to your wishes.

Cheers, Lovisa

diala-ar commented 5 months ago

Thanks @lfranzen , I will download the development version, try it and let you know if there is any issue! Do the updates include the spots size problem when zooming in that was reported in #19 ? Thanks for this great package!

lfranzen commented 5 months ago

Hi – Perfect, hope it works out! We've currently not done any update to tackle the issue raised around spot sizes, mainly because this is not necessarily an issue per se. As our plotting functions are currently written, you will always need to adjust the spot sizes manually for the plots to appear in a way you find visually pleasing. By plotting the Visium spots over the tissue section and adding the scale bar, it is possible to quite easily identify the pt_size needed for the spot to appear ~55µm in diameter. For now, we hope this should be enough.