Learn R Programming

Seurat (version 4.3.0.1)

ReadVitessce: Read Data From Vitessce

Description

Read in data from Vitessce-formatted JSON files

Usage

ReadVitessce(
  counts = NULL,
  coords = NULL,
  molecules = NULL,
  type = c("segmentations", "centroids"),
  filter = NA_character_
)

LoadHuBMAPCODEX(data.dir, fov, assay = "CODEX")

Value

ReadVitessce: A list with some combination of the following values:

  • counts”: if counts is not NULL, an expression matrix with cells as columns and features as rows

  • centroids”: if coords is not NULL and type is contains“centroids”, a data frame with cell centroids in three columns: “x”, “y”, and “cell”

  • segmentations”: if coords is not NULL and type contains “centroids”, a data frame with cell segmentations in three columns: “x”, “y” and “cell”

  • molecules”: if molecules is not NULL, a data frame with molecule spatial coordinates in three columns: “x”, “y”, and “gene”

LoadHuBMAPCODEX: A Seurat object

Arguments

counts

Path or URL to a Vitessce-formatted JSON file with expression data; should end in “.genes.json” or “.clusters.json”; pass NULL to skip

coords

Path or URL to a Vitessce-formatted JSON file with cell/spot spatial coordinates; should end in “.cells.json”; pass NULL to skip

molecules

Path or URL to a Vitessce-formatted JSON file with molecule spatial coordinates; should end in “.molecules.json”; pass NULL to skip

type

Type of cell/spot spatial coordinates to return, choose one or more from:

  • “segmentations” cell/spot segmentations

  • “centroids” cell/spot centroids

filter

A character to filter molecules by, pass NA to skip molecule filtering

data.dir

Path to a directory containing Vitessce cells and clusters JSONs

fov

Name to store FOV as

assay

Name to store expression matrix as

Progress Updates with <span class="pkg">progressr</span>

This function uses progressr to render status updates and progress bars. To enable progress updates, wrap the function call in with_progress or run handlers(global = TRUE) before running this function. For more details about progressr, please read vignette("progressr-intro")

Examples

Run this code
if (FALSE) {
coords <- ReadVitessce(
  counts =
     "https://s3.amazonaws.com/vitessce-data/0.0.31/master_release/wang/wang.genes.json",
  coords =
     "https://s3.amazonaws.com/vitessce-data/0.0.31/master_release/wang/wang.cells.json",
  molecules =
     "https://s3.amazonaws.com/vitessce-data/0.0.31/master_release/wang/wang.molecules.json"
)
names(coords)
coords$counts[1:10, 1:10]
head(coords$centroids)
head(coords$segmentations)
head(coords$molecules)
}

Run the code above in your browser using DataLab