plotEmbeddings {phemd} | R Documentation

## Plots Monocle2 cell embedding plots

### Description

Takes as input a Phemd object containing either a Monocle2 object or Seurat object (already embedded and ordered) and plots cell embedding plots side by side. Optionally saves to specified folder.

### Usage

    plotEmbeddings(obj, cell_model = c("monocle2", "seurat"), cmap = NULL,
      w = 4, h = 5, pt_sz = 1, ndims = NULL)

### Arguments

`obj` | 'Phemd' object containing Monocle 2 object
`cell_model` | Method by which cell state was modeled (either "monocle2" or "seurat")
`cmap` | User-specified colormap to use to color cell state embedding (optional)
`w` | Width of plot in inches
`h` | Height of plot in inches
`pt_sz` | Scalar factor for point size
`ndims` | Number of dimensions to use for dimensionality reduction in case it hasn't been performed yet (only relevant when using Seurat data as input)

### Details

`embedCells` and `orderCellsMonocle` need to be called before calling this function. Required additional packages: 'RColorBrewer', 'cowplot'

### Value

Colormap (vector of colors) used to color Monocle2 cell state embedding

### Examples

    my_phemdObj <- createDataObj(all_expn_data, all_genes, as.character(snames_data))
    my_phemdObj_lg <- removeTinySamples(my_phemdObj, 10)
    my_phemdObj_lg <- aggregateSamples(my_phemdObj_lg, max_cells=1000)
    my_phemdObj_monocle <- embedCells(my_phemdObj_lg, data_model='gaussianff', sigma=0.02, maxIter=2)
    my_phemdObj_monocle <- orderCellsMonocle(my_phemdObj_monocle)
    cmap <- plotEmbeddings(my_phemdObj_monocle)

[Package phemd version 1.0.1 Index]