spatial_create_seurat_object: Create Seurat object based on spatial sample metadata.

View source: R/spatial_analysis.R

spatial_create_seurat_objectR Documentation

Create Seurat object based on spatial sample metadata.

Description

This function creates Seurat object for each spatial (e.g. Visium) sample in the metadata file.

Usage

spatial_create_seurat_object(
  data_dir,
  sample_meta = NULL,
  sample_meta_filename = NULL,
  meta_colnames = c("donor", "condition", "pass_qc"),
  tenx_dir = "outs",
  ...
)

Arguments

data_dir

Parent directory where all sample 10x files are stored. Think of it as project directory.

sample_meta

Sample metadata information in a Data.frame like object. Columns should at least contain 'sample', 'donor', 'condition' and 'pass_qc'.

sample_meta_filename

Filename of sample metadata information, same as 'meta' parameter above. User should provide one of 'meta' or 'meta_filename'.

meta_colnames

Sample metadata column names to store in Seurat metadata.

tenx_dir

Name of 10x base directory, e.g. with outputs after running cellranger. Default 'premrna_outs', i.e. assumes single-nuclei RNA-seq.

...

Additional named parameters passed to Seurat.

Value

List of Seurat objects equal the number of samples in the sample metadata file. If a single sample, returns a Seurat object.

Author(s)

C.A.Kapourani C.A.Kapourani@ed.ac.uk


andreaskapou/SeuratPipe documentation built on Nov. 22, 2022, 4:16 p.m.