PseudobulkingBarPlot: PseudobulkingBarPlot

PseudobulkingBarPlotR Documentation

PseudobulkingBarPlot

Description

This is a plotting function downstream of RunFilteredContrasts that will create a bar plot with the results of each contrast ordered by the magnitude of differentially expressed genes.

Usage

PseudobulkingBarPlot(
  filteredContrastsResults,
  metadataFilterList = NULL,
  title = "Please Title The Bar Plot",
  logFC_threshold = 1,
  FDR_threshold = 0.05,
  swapContrastDirectionality = FALSE
)

Arguments

filteredContrastsResults

A list of dataframes returned by RunFilteredContrasts.

metadataFilterList

An optional list of lists specifying further filtering to be performed. These lists must follow the format: list( list("filterDirection", "filterField", "filterValue" )) where: filterDirection determines whether the Positive, Negative, or Both sides of the contrasts should be filtered, filterField determines which metadata field (originally supplied to groupFields in PseudobulkSeurat and contrast_columns in DesignModelMatrix), filterValue corresponds to which values of the filterField should be filtered. This is useful if you passed parallel hypotheses (e.g. what genes are differentially expressed in each tissue?) in the requireIdenticalFields argument of RunFilteredContrasts, but want to plot the results of only one tissue at a time.

title

Title for the bar plot.

logFC_threshold

A passthrough argument specifying the log fold change threshold to be used by .addRegulationInformationAndFilterDEGs to filter genes and determine regulation direction.

FDR_threshold

A passthrough argument specifying the FDR threshold to be used by .addRegulationInformationAndFilterDEGs to filter genes and determine regulation direction.

swapContrastDirectionality

A boolean determining if the contrast directionality should be swapped. This is useful if you want the "control" condition in your contrasts to appear in the opposite directionality of the default.

Value

A list containing the filtered dataframe used for plotting and the bar plot itself.


bimberlabinternal/CellMembrane documentation built on Oct. 16, 2024, 6:53 a.m.