Learn R Programming

SeuratObject (version 5.0.2)

CreateSeuratObject: Create a Seurat object

Description

Create a Seurat object from raw data

Usage

CreateSeuratObject(
  counts,
  assay = "RNA",
  names.field = 1,
  names.delim = "_",
  meta.data = NULL,
  project = "CreateSeuratObject",
  ...
)

# S3 method for default CreateSeuratObject( counts, assay = "RNA", names.field = 1L, names.delim = "_", meta.data = NULL, project = "SeuratProject", min.cells = 0, min.features = 0, ... )

# S3 method for Assay CreateSeuratObject( counts, assay = "RNA", names.field = 1L, names.delim = "_", meta.data = NULL, project = "SeuratProject", ... )

# S3 method for Assay5 CreateSeuratObject( counts, assay = "RNA", names.field = 1L, names.delim = "_", meta.data = NULL, project = "SeuratProject", ... )

Value

A Seurat object

Arguments

counts

Either a matrix-like object with unnormalized data with cells as columns and features as rows or an Assay-derived object

assay

Name of the initial assay

names.field

For the initial identity class for each cell, choose this field from the cell's name. E.g. If your cells are named as BARCODE_CLUSTER_CELLTYPE in the input matrix, set names.field to 3 to set the initial identities to CELLTYPE.

names.delim

For the initial identity class for each cell, choose this delimiter from the cell's column name. E.g. If your cells are named as BARCODE-CLUSTER-CELLTYPE, set this to “-” to separate the cell name into its component parts for picking the relevant field.

meta.data

Additional cell-level metadata to add to the Seurat object. Should be a data.frame where the rows are cell names and the columns are additional metadata fields. Row names in the metadata need to match the column names of the counts matrix.

project

Project name for the Seurat object

...

Arguments passed to other methods

min.cells

Include features detected in at least this many cells. Will subset the counts matrix as well. To reintroduce excluded features, create a new object with a lower cutoff

min.features

Include cells where at least this many features are detected

Examples

Run this code
if (FALSE) {
pbmc_raw <- read.table(
  file = system.file('extdata', 'pbmc_raw.txt', package = 'Seurat'),
  as.is = TRUE
)
pbmc_small <- CreateSeuratObject(counts = pbmc_raw)
pbmc_small
}

Run the code above in your browser using DataLab