Import GeoMX DSP data into a saptial experiment object from file paths

readGeoMx(
  countFile,
  sampleAnnoFile,
  featureAnnoFile = NA,
  hasNegProbe = TRUE,
  NegProbeName = "NegProbe-WTX",
  colnames.as.rownames = c("TargetName", "SegmentDisplayName", "TargetName"),
  coord.colnames = c("ROICoordinateX", "ROICoordinateY")
)

Arguments

countFile

tsv file or a dataframe object. Count matrix, with samples in columns and features/genes in rows. The first column is gene names/ids.

sampleAnnoFile

tsv file or a dataframe object. Sample annotations.

featureAnnoFile

tsv file or a dataframe object. Feature/Gene annotations.

hasNegProbe

Logical. Default is TRUE, indicating there are negative probe genes in the data.

NegProbeName

Character. Name of negative probe genes, default is NegProbe-WTX.

colnames.as.rownames

Vector of characters, length of 3. Column names used to capture gene names, sample names and gene names in countFile, sampleAnnoFile and featureAnnoFile, respectively.

coord.colnames

Vector of characters, length of 2. Column names used to capture ROI coordinates.

Value

A SpatialExperiment object.

Examples

library(ExperimentHub)
#> Loading required package: AnnotationHub
#> Loading required package: BiocFileCache
#> Loading required package: dbplyr
#> 
#> Attaching package: ‘AnnotationHub’
#> The following object is masked from ‘package:Biobase’:
#> 
#>     cache

eh <- ExperimentHub()
#> snapshotDate(): 2022-04-06
query(eh, "standR")
#> ExperimentHub with 3 records
#> # snapshotDate(): 2022-04-06
#> # $dataprovider: Nanostring
#> # $species: NA
#> # $rdataclass: data.frame
#> # additional mcols(): taxonomyid, genome, description,
#> #   coordinate_1_based, maintainer, rdatadateadded, preparerclass, tags,
#> #   rdatapath, sourceurl, sourcetype 
#> # retrieve records with, e.g., 'object[["EH7364"]]' 
#> 
#>            title                   
#>   EH7364 | GeomxDKDdata_count      
#>   EH7365 | GeomxDKDdata_sampleAnno 
#>   EH7366 | GeomxDKDdata_featureAnno
countFile <- eh[["EH7364"]]
#> see ?standR and browseVignettes('standR') for documentation
#> loading from cache
sampleAnnoFile <- eh[["EH7365"]]
#> see ?standR and browseVignettes('standR') for documentation
#> loading from cache

spe <- readGeoMx(countFile, sampleAnnoFile, hasNegProbe = FALSE)
#> Rows: 18504 Columns: 232
#> ── Column specification ────────────────────────────────────────────────────────
#> Delimiter: "\t"
#> chr   (1): TargetName
#> dbl (231): disease3_scan | 001 | PanCK, disease3_scan | 001 | neg, disease3_...
#> 
#>  Use `spec()` to retrieve the full column specification for this data.
#>  Specify the column types or set `show_col_types = FALSE` to quiet this message.
#> Rows: 231 Columns: 25
#> ── Column specification ────────────────────────────────────────────────────────
#> Delimiter: "\t"
#> chr  (8): SlideName, ScanName, SegmentLabel, SegmentDisplayName, Sample_ID, ...
#> dbl (17): ROILabel, AOISurfaceArea, AOINucleiCount, ROICoordinateX, ROICoord...
#> 
#>  Use `spec()` to retrieve the full column specification for this data.
#>  Specify the column types or set `show_col_types = FALSE` to quiet this message.