Skip to contents

Convenience wrapper around SOMAExperimentAxisQuery, to build and execute a query, and return it as a Seurat object.

Usage

get_seurat(
  census,
  organism,
  measurement_name = "RNA",
  X_layers = c(counts = "raw", data = NULL),
  obs_value_filter = NULL,
  obs_coords = NULL,
  obs_column_names = NULL,
  obsm_layers = FALSE,
  var_value_filter = NULL,
  var_coords = NULL,
  var_column_names = NULL,
  var_index = "feature_id"
)

Arguments

census

The census object, usually returned by cellxgene.census::open_soma().

organism

The organism to query, usually one of Homo sapiens or Mus musculus

measurement_name

The measurement object to query. Defaults to RNA.

X_layers

A named character of X layers to add to the Seurat assay, where the names are the names of Seurat slots (counts or data) and the values are the names of layers within X.

obs_value_filter

A SOMA value_filter across columns in the obs dataframe, expressed as string.

obs_coords

A set of coordinates on the obs dataframe index, expressed in any type or format supported by SOMADataFrame's read() method.

obs_column_names

Columns to fetch for the obs data frame.

obsm_layers

Names of arrays in obsm to add as the cell embeddings; pass FALSE to suppress loading in any dimensional reductions.

var_value_filter

Same as obs_value_filter but for var.

var_coords

Same as obs_coords but for var.

var_column_names

Columns to fetch for the var data frame.

var_index

Name of column in ‘var’ to add as feature names.

Value

A Seurat object containing the sensus slice.

Examples

if (FALSE) {
census <- open_soma()
seurat_obj <- get_seurat(
  census,
  organism = "Homo sapiens",
  obs_value_filter = "cell_type == 'leptomeningeal cell'",
  var_value_filter = "feature_id %in% c('ENSG00000107317', 'ENSG00000106034')"
)

seurat_obj

census$close()
}