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

LabWorksheet not imported correctly when all mask IDs are number-like strings. #57

Open mgrout81 opened 10 months ago

mgrout81 commented 10 months ago

My OME-TIFF mask text fields are all number-like strings, e.g., "001", "002", "003". The LabWorksheet.txt file has the correct values in the "segment" field, "001", "002", "003", etc. However, when the LabWorksheet is read in using readLabWorkshet(), https://github.com/Nanostring-Biostats/SpatialOmicsOverlay/blob/bcff923c03a3bd3d7460e327ea3f7f02e72081a5/R/utils.R#L57, the column is imported as fully numerical, e.g., "1", "2", "3". This makes the string matching within annotMatching() fail. This only happens when all "segment" values in the LabWorkseet file are number-like strings. If I add in a dummy string "forcestring" for an NTC, the entire column is read in as type character. This way, the "001", etc., format is maintained and the annotMatching() function returns a non-empty data structure.