barplot_cluster_abundance: Plot Abundance Comparison Across Sample Clusters

View source: R/visualization.R

barplot_cluster_abundanceR Documentation

Plot Abundance Comparison Across Sample Clusters

Description

Plot Abundance Comparison Across Sample Clusters

Usage

barplot_cluster_abundance(x, ...)

## S3 method for class 'data.frame'
barplot_cluster_abundance(df, position = c("stack", "dodge"))

## S3 method for class 'SingleCellExperiment'
barplot_cluster_abundance(sce, ...)

## S3 method for class 'Seurat'
barplot_cluster_abundance(srt, ...)

Arguments

...

Args passed to muscat::aggregateData

df

Data frame to plot, must contains columns:

frequency

the proportion of cells in a cluster in a sample

sample_id

IDs of samples

cluster_id

IDs of clusters

group_id

IDs of sample groups

position

Specify the way to display the bar chart

sce

A SingleCellExperiment object. The following cell metadata (colData) columns have to be provided:

sample_id

unique sample identifiers

cluster_id

subpopulation (cluster) assignments

group_id

experimental group/condition

srt

Seurat object. The sample and group infromation must exist in seurat_object@meta.data slot.

Value

A ggplot2 object

Methods (by class)

  • data.frame: Plot abundance comparison across sample clusters from a formatted data.frame

  • SingleCellExperiment: Calculate the proportion of cells from object SingleCellExperiment

  • Seurat: Calculate the proportion of cells from Seurat object.


altairwei/rhapsodykit documentation built on Feb. 1, 2023, 8:52 a.m.