LieberInstitute / spatialLIBD

Code for the spatialLIBD R/Bioconductor package and shiny app
http://LieberInstitute.github.io/spatialLIBD/
83 stars 17 forks source link

Spot diameter enhancements #28

Closed lcolladotor closed 2 years ago

lcolladotor commented 2 years ago

It'd be nice if we:

(a) made the point diameter use the actual spot diameter info from SpaceRanger See https://github.com/LieberInstitute/HumanPilot/blob/master/10X/151507/scalefactors_json.json for example where we have the fullres diameter, and when taking into account the scaling factor, we should get the right say lowres diameter.

(b) update the plotly code such that the interactive plots allow you to Zoom in and rescale the spot diameters. This seems to be quite tricky based on threads like https://stackoverflow.com/questions/53217404/specifying-marker-size-in-data-unit-for-plotly, https://community.plotly.com/t/point-size-based-on-zoom/6788/2 and https://pretagteam.com/question/plotly-bubble-map-resize-markers-on-zoom.

lcolladotor commented 2 years ago

https://github.com/drighelli/SpatialExperiment/issues/25 is related since that's where the scalefactors_json.json info would be stored at

lcolladotor commented 2 years ago

@jvelezmagic @roramirezf maybe you have some ideas about this

lcolladotor commented 2 years ago

I added options for controlling the point size (so the spot size) in the plots. Check it out at https://libd.shinyapps.io/spatialLIBD_Human_Lymph_Node_10x/ which so far is the only updated shiny app (requires spatialLIBD versions 1.6.4 or 1.7.6).

Here’s the default point size of 1.25

Screen Shot 2021-12-08 at 6 37 49 PM

which we know looks quite bad when you zoom in

Screen Shot 2021-12-08 at 6 38 53 PM

if you increase the point size to say 5 then without zooming in, it looks huge (almost like pop art)

Screen Shot 2021-12-08 at 6 38 12 PM

but now it looks better when you zoom in

Screen Shot 2021-12-08 at 6 38 29 PM

This issue isn't solved, but well, at least now we have a workaround available.

For the grids with Sang Ho @shkwon17, we found that point_size = 2 worked well for visualization when printing with the default height and width when using vis_grid_gene() or vis_grid_clus(). For example at https://github.com/LieberInstitute/Visium_IF_AD/blob/master/plots/initial_exploration/wholegenome_graph_based.pdf (private link right now).

lcolladotor commented 2 years ago

The workaround has been working well, so I'll close this issue for now.