Skip to contents

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

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