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

Error: nrow(AOIattrs) < nrow(annots) #45

Open MrModenait opened 1 year ago

MrModenait commented 1 year ago

Dear developers, I have just downloaded SpatialOmicsOverlay and I am hoping to plot some gene expression data from a GeoMx object to an OME-TIFF file that I downloaded from the GeoMx DSP Control Center (which I think is hosted by my university). I am following the steps noted in this vignette. I have downloaded the OME-TIFF file and I am now trying to run readSpatialOverlay, but I get an error:

picture_220519_18PL_20291 <- readSpatialOverlay(ometiff = "../GeoMx Images/GeoMx OME-TIFF Files/220520-18PL-20291 01-02-Scan 2.ome.tiff",
                                                annots = "../GeoMx Data/GeoMx Raw Data/p2112_20220916T1419_LabWorksheetExpanded.csv",
                                                slideName = "18PL-20291 01-02",
                                                image = FALSE, saveFile = FALSE, outline = FALSE)

This is the error message that I receive:

Error in if (nrow(AOIattrs) < nrow(annots)) { :
argument is of length zero
2. parseOverlayAttrs(omexml = xml, annots = annots, labworksheet = labWorksheet)
1. readSpatialOverlay(ometiff = "../GeoMx Images/GeoMx OME-TIFF Files/220520-18PL-20291 01-02-Scan 2.ome.tiff",
annots = "../GeoMx Data/GeoMx Raw Data/p2112_20220916T1419_LabWorksheetExpanded.csv",
slideName = "18PL-20291 01-02", image = FALSE, saveFile = FALSE, outline = FALSE)

Would somebody be able to help me understand what nrow(AOIattrs) refers to? The OME-TIFF file that I downloaded should have around 19 regions of interest selected; the annotations file that I am using has annotations for 125 regions of interest (for this slide and a few others). There are also two rows for No Template Control. I have, however, tried to use an Excel worksheet with only the 19 regions of interest from this slide. For reference, these are the column names in the worksheet that I am using (p2112_20220916T1419_LabWorksheetExpanded.csv, the worksheet with annotations for all 125 regions of interest), and the first five rows. As you can see, there is both information regarding the scan, but also some metadata which I would like to carry with me. Should any column names be changed so that the above function will work?

<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40">

  | Sample_ID | slide name | scan name | panel | ROILabel | segment | aoi | area | tags | ROI_ID_1 | SlideName | ScanLabel | RawReads | AlignedReads | DeduplicatedReads | StitchedReads | TrimmedReads | AOINucleiCount | AOISurfaceArea | ScanHeight | ScanWidth | Scan_Date | ROICoordinateX | ROICoordinateY | NormalizationFactor | QCFlags | Patient | Patient_GeoMx | Tissue | Type | Type_English -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- 1 | DSP-1001660006454-G-A01 | No Template Control | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA 2 | DSP-1001660006454-G-A02 | 19PL-12941 01-02 | 220519-19PL-12941 01-02-Scan 1 | (v1.0) Human NGS Whole Transcriptome Atlas RNA | 001_I | Full ROI | Full ROI-aoi-001 | 32672.83 | NA | 001_I | 19PL-12941 01-02 | 220519-19PL-12941 01-02-Scan 1 | 5314100 | 4645056 | 923823 | 4738679 | 4748882 | 293 | 32672.83 | 51945.28 | 26117.81 | 220519 | 13860 | 30805 | 0.863753 | NA | 24 | 41 | I | I | I 3 | DSP-1001660006454-G-A03 | 19PL-12941 01-02 | 220519-19PL-12941 01-02-Scan 1 | (v1.0) Human NGS Whole Transcriptome Atlas RNA | 002_I | Full ROI | Full ROI-aoi-001 | 37725.01 | NA | 002_I | 19PL-12941 01-02 | 220519-19PL-12941 01-02-Scan 1 | 5025289 | 4377359 | 766415 | 4467791 | 4476590 | 295 | 37725.01 | 51945.28 | 26117.81 | 220519 | 14226 | 30353 | 1.046973 | NA | 24 | 41 | I | I | I 4 | DSP-1001660006454-G-A04 | 19PL-12941 01-02 | 220519-19PL-12941 01-02-Scan 1 | (v1.0) Human NGS Whole Transcriptome Atlas RNA | 003_TI | Full ROI | Full ROI-aoi-001 | 41630.05 | NA | 003_TI | 19PL-12941 01-02 | 220519-19PL-12941 01-02-Scan 1 | 5681850 | 4796496 | 878048 | 4905337 | 4915221 | 218 | 41630.05 | 51945.28 | 26117.81 | 220519 | 13014 | 31401 | 0.50809 | NA | 24 | 41 | T | TI | TE 5 | DSP-1001660006454-G-A05 | 19PL-12941 01-02 | 220519-19PL-12941 01-02-Scan 1 | (v1.0) Human NGS Whole Transcriptome Atlas RNA | 004_TI | Full ROI | Full ROI-aoi-001 | 35196.62 | NA | 004_TI | 19PL-12941 01-02 | 220519-19PL-12941 01-02-Scan 1 | 3691514 | 3121196 | 636215 | 3192486 | 3199437 | 162 | 35196.62 | 51945.28 | 26117.81 | 220519 | 13003 | 32921 | 0.677453 | NA | 24 | 41 | T | TI | TE

This is the session info:

R version 4.2.2 (2022-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045)
Matrix products: default
locale:
[1] LC_COLLATE=English_United Kingdom.utf8  LC_CTYPE=English_United Kingdom.utf8    LC_MONETARY=English_United Kingdom.utf8
[4] LC_NUMERIC=C                            LC_TIME=English_United Kingdom.utf8    
attached base packages:
[1] stats4    stats     graphics  grDevices utils     datasets  methods   base     
other attached packages:
[1] SpatialOmicsOverlay_0.99.23 GeoMxWorkflows_1.4.0        GeomxTools_3.2.0            NanoStringNCTools_1.6.1     ggplot2_3.4.2              
[6] S4Vectors_0.36.2            Biobase_2.58.0              BiocGenerics_0.44.0    

Thank you very much in advance for your help!

Best Regards, Gustav Christensson

maddygriz commented 1 year ago

Hi Gustav,

Thank you for reaching out. Our customer support team will be able to help you with this. Please email support@nanostring.com with your issue.

Thanks, Maddy