Learn R Programming

Platypus (version 3.5.0)

GEX_proportions_barplot: Plots proportions of a group of cells within a secondary group of cells. E.g. The proportions of samples in seurat clusters, or the proportions of samples in defined cell subtypes

Description

Plots proportions of a group of cells within a secondary group of cells. E.g. The proportions of samples in seurat clusters, or the proportions of samples in defined cell subtypes

Usage

GEX_proportions_barplot(GEX, source.group, target.group, stacked.plot)

Value

Returns a ggplot barplot showing cell proportions by source and target group.

Arguments

GEX

GEX Seurat object generated with VDJ_GEX_matrix (VDJ_GEX_matrix.output[[2]])

source.group

Character. A column name of the GEX@meta.data with the group of which proportions should be plotted

target.group

Character. A column name of the GEX@meta.data with the group to calculate proportions within. If unsure, see examples for clarification

stacked.plot

Boolean. Defaults to FALSE. Whether to return a stacked barplot, with the y axis representing the % of cells of the target group. If set to FALSE a normal barplot (position = "dodge") will be returned with the y axis representing the % of cells of the source group

Examples

Run this code
# \donttest{
try({
GEX_proportions_barplot(GEX = Platypus::small_vgm[[2]], source.group = "sample_id"
, target.group = "seurat_clusters",stacked.plot = FALSE)
GEX_proportions_barplot(GEX = Platypus::small_vgm[[2]],
source.group = "seurat_clusters", target.group = "sample_id"
,stacked.plot = TRUE)
})
# }

Run the code above in your browser using DataLab