Nanostring-Biostats / SpatialOmicsOverlay

Tools for analyzing data on the image from NanoString GeoMx Digital Spatial Profiler (DSP).
MIT License
17 stars 4 forks source link

fluorLegend not working when fluor targets aren't unique #51

Open mgrout81 opened 11 months ago

mgrout81 commented 11 months ago

I am using mu_dev_E9_003 in SOO and trying to run plotSpatialOverlay() with fluorLegend=TRUE. I get this error:

Error in `[[<-.data.frame`(`*tmp*`, i, value = c(DNA = "#0000FF", Custom = "#00FFFF",  : 
  replacement has 4 rows, data has 2

I believe what is likely happening is that the code is assuming unique Target values for all rows, but I only have 2, "DNA", and "Custom":

> fluor(overlay)
        Dye DisplayName     Color WaveLength Target ExposureTime MinIntensity MaxIntensity ColorCode
1   SYTO 13        FITC      Blue      525nm    DNA     100.0 µs            0         3000   #0000FF
2 Alexa 532         Cy3      Cyan      568nm Custom     300.0 µs            0         1500   #00FFFF
3 Alexa 594   Texas Red     Green      615nm Custom     300.0 µs            0          975   #00FF00
4       Cy5         Cy5 Deeppink2      666nm Custom     300.0 µs          350         2500   #FF0054

https://github.com/Nanostring-Biostats/SpatialOmicsOverlay/blob/a78d1bb386ff16daa3f83de907e6e7868c4bb9f0/R/plottingBasics.R#L129

I assume "Custom" indicates a lack of something in particular specified by the user on the DSP instrument, so likely this is something that will not be too uncommon.