exportFromSeurat: Export Seurat object to Cerebro.

Description Usage Arguments Value Examples

View source: R/exportFromSeurat.R

Description

This function allows to export a Seurat object to visualize in Cerebro.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
exportFromSeurat(
  object,
  assay = "RNA",
  slot = "data",
  file,
  experiment_name,
  organism,
  groups,
  cell_cycle = NULL,
  nUMI = "nUMI",
  nGene = "nGene",
  add_all_meta_data = TRUE,
  use_delayed_array = FALSE,
  verbose = FALSE
)

Arguments

object

Seurat object.

assay

Assay to pull expression values from; defaults to RNA.

slot

Slot to pull expression values from; defaults to data. It is recommended to use sparse data (such as log-transformed or raw counts) instead of dense data (such as the scaled slot) to avoid performance bottlenecks in the Cerebro interface.

file

Where to save the output.

experiment_name

Experiment name.

organism

Organism, e.g. hg (human), mm (mouse), etc.

groups

Names of grouping variables in meta data (object@meta.data), e.g. c("sample","cluster"); at least one must be provided; defaults to NULL.

cell_cycle

Names of columns in meta data (object@meta.data) that contain cell cycle information, e.g. c("Phase"); defaults to NULL.

nUMI

Column in object@meta.data that contains information about number of transcripts per cell; defaults to nUMI.

nGene

Column in object@meta.data that contains information about number of expressed genes per cell; defaults to nGene.

add_all_meta_data

If set to TRUE, all further meta data columns will be extracted as well.

use_delayed_array

When set to TRUE, the expression matrix will be stored as an RleMatrix (see DelayedArray package). This can be useful for very large data sets, as the matrix won't be loaded into memory and instead values will be read from the disk directly, at the cost of performance. Note that it is necessary to install the DelayedArray package. If set to FALSE (default), the expression matrix will be copied from the input object as is. It is recommended to use a sparse format, such as dgCMatrix from the Matrix package.

verbose

Set this to TRUE if you want additional log messages; defaults to FALSE.

Value

No data returned.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
pbmc <- readRDS(system.file("extdata/v1.3/pbmc_seurat.rds",
  package = "cerebroApp"))
exportFromSeurat(
  object = pbmc,
  file = 'pbmc_Seurat.crb',
  experiment_name = 'PBMC',
  organism = 'hg',
  groups = c('sample','seurat_clusters'),
  nUMI = 'nCount_RNA',
  nGene = 'nFeature_RNA',
  use_delayed_array = FALSE,
  verbose = TRUE
)

romanhaa/cerebroApp documentation built on Nov. 25, 2021, 5:29 p.m.