CellBrowser: Export 'Seurat' objects for UCSC cell browser and stop open...

CellBrowserR Documentation

Export Seurat objects for UCSC cell browser and stop open cell browser instances from R

Description

Export Seurat objects for UCSC cell browser and stop open cell browser instances from R

Usage

ExportToCellbrowser(
  object,
  dir,
  dataset.name = Project(object = object),
  reductions = NULL,
  markers.file = NULL,
  cluster.field = NULL,
  cb.dir = NULL,
  port = NULL,
  use.mtx = FALSE,
  meta.fields = NULL,
  meta.fields.names = NULL,
  matrix.slot = "counts",
  markers.n = 100,
  skip.markers = FALSE,
  skip.expr.matrix = FALSE,
  skip.metadata = FALSE,
  skip.reductions = FALSE
)

Arguments

object

Seurat object

dir

path to directory where to save exported files. These are: exprMatrix.tsv, tsne.coords.tsv, meta.tsv, markers.tsv and a default cellbrowser.conf

dataset.name

name of the dataset. Defaults to Seurat project name

reductions

vector of reduction names to export, defaults to all reductions.

markers.file

path to file with marker genes. By defaults, marker are searched in the object itself as misc$markers. If none are supplied in object or via this argument, they are recalculated with FindAllMarkers

cluster.field

name of the metadata field containing cell cluster

cb.dir

path to directory where to create UCSC cellbrowser static website content root, e.g. an index.html, .json files, etc. These files can be copied to any webserver. If this is specified, the cellbrowser package has to be accessible from R via reticulate.

port

on which port to run UCSC cellbrowser webserver after export

use.mtx

export the matrix in .mtx.gz format. Default is False, unless the matrix is bigger than R's maximum matrix size.

meta.fields

vector of meta fields to export, default is all.

meta.fields.names

vector meta field names to show in UI. Must have same length as meta.fields. Default is meta.fields.

matrix.slot

matrix to use, default is 'counts'

markers.n

if no markers were supplied, FindAllMarkers is run. This parameter indicates how many markers to calculate, default is 100

skip.markers

whether to skip exporting markers

skip.expr.matrix

whether to skip exporting expression matrix

skip.metadata

whether to skip exporting metadata

skip.reductions

whether to skip exporting reductions

...

specifies the metadata fields to export. To supply a field and its human readable name, pass name as field="name" parameter.

Value

This function exports Seurat object as a set of tsv files to dir directory, copying the markers.file if it is passed. It also creates the default cellbrowser.conf in the directory. This directory could be read by cbBuild to create a static website viewer for the dataset. If cb.dir parameter is passed, the function runs cbBuild (if it is installed) to create this static website in cb.dir directory. If port parameter is passed, it also runs the webserver for that directory and opens a browser.

Author(s)

Maximilian Haeussler, Nikolay Markov

Examples

## Not run: 
ExportToCellbrowser(pbmc_small, dataset.name = "PBMC", dir = "out")

## End(Not run)


satijalab/seurat-wrappers documentation built on April 10, 2024, 3:25 p.m.