Plots the cells along with their trajectories.
plot_cells(
cds,
x = 1,
y = 2,
reduction_method = c("UMAP", "tSNE", "PCA", "LSI", "Aligned"),
color_cells_by = "cluster",
group_cells_by = c("cluster", "partition"),
genes = NULL,
show_trajectory_graph = TRUE,
trajectory_graph_color = "grey28",
trajectory_graph_segment_size = 0.75,
norm_method = c("log", "size_only"),
label_cell_groups = TRUE,
label_groups_by_cluster = TRUE,
group_label_size = 2,
labels_per_group = 1,
label_branch_points = TRUE,
label_roots = TRUE,
label_leaves = TRUE,
graph_label_size = 2,
cell_size = 0.35,
cell_stroke = I(cell_size/2),
alpha = 1,
min_expr = 0.1,
rasterize = FALSE,
scale_to_range = FALSE,
label_principal_points = FALSE
)
cell_data_set for the experiment
the column of reducedDims(cds) to plot on the horizontal axis
the column of reducedDims(cds) to plot on the vertical axis
The lower dimensional space in which to plot cells. Must be one of "UMAP", "tSNE", "PCA" and "LSI".
What to use for coloring the cells. Must be either the name of a column of colData(cds), or one of "clusters", "partitions", or "pseudotime".
How to group cells when labeling them. Must be either the name of a column of colData(cds), or one of "clusters" or "partitions". If a column in colData(cds), must be a categorical variable.
Facet the plot, showing the expression of each gene in a facet panel. Must be either a list of gene ids (or short names), or a dataframe with two columns that groups the genes into modules that will be aggregated prior to plotting. If the latter, the first column must be gene ids, and the second must the group for each gene.
Whether to render the principal graph for the trajectory. Requires that learn_graph() has been called on cds.
The color to be used for plotting the trajectory graph.
The size of the line segments used for plotting the trajectory graph.
How to normalize gene expression scores prior to plotting them. Must be one of "log" or "size_only".
Whether to label cells in each group (as specified by group_cells_by) according to the most frequently occurring label(s) (as specified by color_cells_by) in the group. If false, plot_cells() simply adds a traditional color legend.
Instead of labeling each cluster of cells, place each label once, at the centroid of all cells carrying that label.
Font size to be used for cell group labels.
How many labels to plot for each group of cells. Defaults to 1, which plots only the most frequent label per group.
Whether to plot a label for each branch point in the principal graph.
Whether to plot a label for each root in the principal graph.
Whether to plot a label for each leaf node in the principal graph.
How large to make the branch, root, and leaf labels.
The size of the point for each cell
The stroke used for plotting each cell - default is 1/2 of the cell_size
Alpha for the cells. Useful for reducing overplotting.
Minimum expression threshold for plotting genes
Whether to plot cells as a rastered bitmap. Requires the ggrastr package.
Logical indicating whether to scale expression to percent of maximum expression.
Logical indicating whether to label roots, leaves, and branch points with principal point names. This is useful for order_cells and choose_graph_segments in non-interactive mode.
a ggplot2 plot object
# NOT RUN {
lung <- load_A549()
plot_cells(lung)
plot_cells(lung, color_cells_by="log_dose")
plot_cells(lung, markers="GDF15")
# }
Run the code above in your browser using DataLab