R/geomx_import_data.R
readGeoMx.Rd
Import GeoMX DSP data into a saptial experiment object from file paths
tsv file or a dataframe object. Count matrix, with samples in columns and features/genes in rows. The first column is gene names/ids.
tsv file or a dataframe object. Sample annotations.
tsv file or a dataframe object. Feature/Gene annotations.
Logical. Default is TRUE, indicating there are negative probe genes in the data.
Character. Name of negative probe genes, default is NegProbe-WTX.
Vector of characters, length of 3. Column names used to capture gene names, sample names and gene names in countFile, sampleAnnoFile and featureAnnoFile, respectively.
Vector of characters, length of 2. Column names used to capture ROI coordinates.
A SpatialExperiment object.
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.