@description Accepts a subset cell_data_set and the parameter
group_cells_by
, used for dividing cells into groups. Returns one or
more bar graphs (one graph for each gene in the cell_data_set). Each graph
shows the percentage (or number) of cells that express a gene in each
sub-group in the cell_data_set.
plot_percent_cells_positive(cds_subset, group_cells_by = NULL,
min_expr = 0, nrow = NULL, ncol = 1, panel_order = NULL,
plot_as_count = FALSE, label_by_short_name = TRUE,
normalize = TRUE, plot_limits = NULL, bootstrap_samples = 100,
conf_int_alpha = 0.95)
Subset cell_data_set to be plotted.
the cell attribute (e.g. the column of colData(cds)) to group cells by on the horizontal axis. If NULL, all cells plotted as one group.
the minimum (untransformed) expression level to consider the gene 'expressed'. Default is 0.
the number of panels per row in the figure.
the number of panels per column in the figure.
the order in which genes should be laid out
(left-to-right, top-to-bottom). Should be gene_short_name if
label_by_short_name = TRUE
or feature ID if
label_by_short_name = FALSE
.
Logical, whether to plot as a count of cells rather than a percent. Default is FALSE.
label figure panels by gene_short_name (TRUE) or feature id (FALSE). Default is TRUE.
Logical, whether or not to normalize expression by size factor. Default is TRUE.
A pair of number specifying the limits of the y axis. If
NULL
, scale to the range of the data. Example c(0,100)
.
The number of bootstrap replicates to generate when plotting error bars. Default is 100.
The size of the confidence interval to use when plotting error bars. Default is 0.95.
a ggplot2 plot object
# NOT RUN {
cds <- load_a549()
cds_subset <- cds[row.names(subset(rowData(cds),
gene_short_name %in% c("NDRG4", "HBG2"))),]
plot_percent_cells_positive(cds_subset, group_cells_by="culture_plate")
# }
Run the code above in your browser using DataLab