Description Usage Arguments Value Slots Author(s) Examples
The VisiumExperiment class is designed to represent 10x Visium spatial Gene Expression data. It inherits from the SpatialExperiment class and is used in the same manner. In addition, the class supports the integration with 10x Visium spatial coordinates and its scale factors.
1 | VisiumExperiment(..., scaleFactors = list(), imagePaths = list())
|
... |
arguments to be passed to the |
scaleFactors |
the 10x Visium image scale factors. |
imagePaths |
the list of the paths for the 10x Visium images. |
none
scaleFactors
list
imagePaths
list
Dario Righelli
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | barcodesFile <- system.file(file.path("extdata", "10x_visium",
"barcodes.tsv"),
package="SpatialExperiment")
barcodesEx <- read.csv(barcodesFile, sep="\t",
header=FALSE, col.names=c("Barcodes"))
featuresFile <- system.file(file.path("extdata", "10x_visium",
"features.tsv"), package="SpatialExperiment")
featuresEx <- read.csv(featuresFile, sep="\t",
header=FALSE, col.names=c("Barcodes", "Feature_name",
"Feature_type"))
countsFile <- system.file(file.path("extdata", "10x_visium",
"matrix.mtx"), package="SpatialExperiment")
countsEx <- Matrix::readMM(file=countsFile)
posFile <- system.file(file.path("extdata", "10x_visium",
"tissue_positions_list.tsv"),
package="SpatialExperiment")
tissPosEx <- read.csv(posFile,
sep="\t", header=FALSE,
col.names=c("Barcodes", "in_tissue",
"array_row", "array_col",
"pxl_col_in_fullres", "pxl_row_in_fullres"))
scaleFile <- system.file(file.path("extdata", "10x_visium",
"scalefactors_json.json"),
package="SpatialExperiment")
scalefactors <- rjson::fromJSON(file=scaleFile)
imagePaths <- list.files(system.file(file.path("extdata", "10x_visium",
"images"),
package="SpatialExperiment"), full.names=TRUE)
ve <- VisiumExperiment(rowData=featuresEx, colData=barcodesEx,
assays=c(counts=countsEx),
spatialCoords=tissPosEx,
scaleFactors=scalefactors,
imagePaths=imagePaths)
ve
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.