plotPlatePosition: Plot cells in plate positions

Description Usage Arguments Details Value Examples

View source: R/plotting.R

Description

Plots cells in their position on a plate, coloured by phenotype data or feature expression.

Usage

1
2
3
plotPlatePosition(object, plate_position = NULL, colour_by = NULL,
  x_position = NULL, y_position = NULL, exprs_values = "exprs",
  theme_size = 24, legend = "auto")

Arguments

object

an SCESet object. If object$plate_position is not NULL, then this will be used to define each cell's position on the plate, unless the plate_position argument is specified.

plate_position

optional character vector providing a position on the plate for each cell (e.g. A01, B12, etc, where letter indicates row and number indicates column). Specifying this argument overrides any plate position information extracted from the SCESet object.

colour_by

character string defining the column of pData(object) to be used as a factor by which to colour the points in the plot. Alternatively, a data frame with one column containing values to map to colours for all cells.

x_position

numeric vector providing x-axis positions for the cells (ignored if plate_position is not NULL)

y_position

numeric vector providing y-axis positions for the cells (ignored if plate_position is not NULL)

exprs_values

a string specifying the expression values to use for colouring the points, if colour_by is set as a feature name.

theme_size

numeric scalar giving default font size for plotting theme (default is 10).

legend

character, specifying how the legend(s) be shown? Default is "auto", which hides legends that have only one level and shows others. Alternatives are "all" (show all legends) or "none" (hide all legends).

Details

This function expects plate positions to be given in a charcter format where a letter indicates the row on the plate and a numeric value indicates the column. So each cell has a plate position such as "A01", "B12", "K24" and so on. From these plate positions, the row is extracted as the letter, and the column as the numeric part. If object$plate_position or the plate_position argument are used to define plate positions, then positions should be provided in this format. Alternatively, numeric values to be used as x- and y-coordinates by supplying both the x_position and y_position arguments to the function.

Value

A ggplot object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## prepare data
data("sc_example_counts")
data("sc_example_cell_info")
pd <- new("AnnotatedDataFrame", data = sc_example_cell_info)
example_sceset <- newSCESet(countData = sc_example_counts, phenoData = pd)
example_sceset <- calculateQCMetrics(example_sceset)

## define plate positions
example_sceset$plate_position <- paste0(
rep(LETTERS[1:5], each = 8), rep(formatC(1:8, width = 2, flag = "0"), 5))

## plot plate positions
plotPlatePosition(example_sceset, colour_by = "Mutation_Status")

plotPlatePosition(example_sceset, colour_by = "Gene_0004")

dynverse/scaterlegacy documentation built on Feb. 17, 2020, 5:07 a.m.