View source: R/plotPlatePosition.R
plotPlatePosition | R Documentation |
Plots cells in their position on a plate, coloured by metadata variables or feature expression values from a SingleCellExperiment object.
plotPlatePosition(
object,
plate_position = NULL,
colour_by = color_by,
size_by = NULL,
shape_by = NULL,
order_by = NULL,
by_exprs_values = "logcounts",
add_legend = TRUE,
theme_size = 24,
point_alpha = 0.6,
point_size = 24,
point_shape = 19,
other_fields = list(),
swap_rownames = NULL,
color_by = NULL,
by.assay.type = by_exprs_values
)
object |
A SingleCellExperiment object. |
plate_position |
A character vector specifying the plate position for each cell (e.g., A01, B12, and so on, where letter indicates row and number indicates column).
If |
colour_by |
Specification of a column metadata field or a feature to colour by, see the |
size_by |
Specification of a column metadata field or a feature to size by, see the |
shape_by |
Specification of a column metadata field or a feature to shape by, see the |
order_by |
Specification of a column metadata field or a feature to order points by, see the |
by_exprs_values |
Alias for |
add_legend |
Logical scalar specifying whether a legend should be shown. |
theme_size |
Numeric scalar, see |
point_alpha |
Numeric scalar specifying the transparency of the points, see |
point_size |
Numeric scalar specifying the size of the points, see |
point_shape |
An integer, or a string specifying the shape
of the points. See |
other_fields |
Additional cell-based fields to include in the data.frame, see |
swap_rownames |
Column name of |
color_by |
Alias to |
by.assay.type |
A string or integer scalar specifying which assay to obtain expression values from,
for use in point aesthetics - see the |
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.
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.
Alternatively, the row and column identities can be directly supplied by setting plate_position
as a list of two factors.
A ggplot object.
Davis McCarthy, with modifications by Aaron Lun
example_sce <- mockSCE()
example_sce <- logNormCounts(example_sce)
## define plate positions
example_sce$plate_position <- paste0(
rep(LETTERS[1:5], each = 8),
rep(formatC(1:8, width = 2, flag = "0"), 5)
)
## plot plate positions
plotPlatePosition(example_sce, colour_by = "Mutation_Status")
plotPlatePosition(example_sce, shape_by = "Treatment",
colour_by = "Gene_0004")
plotPlatePosition(example_sce, shape_by = "Treatment", size_by = "Gene_0001",
colour_by = "Cell_Cycle")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.