Skip to contents

A function to generate a barlot as `tagtango' does.

Usage

bar_diff(
  norm,
  data,
  first_selection,
  second_selection,
  n_bars = 10,
  valley = NULL,
  palette = "BrBG",
  quant = NULL
)

Arguments

norm

normalized expression data with cells as rows and columns as markers/genes (i.e. function `process_data()' should provide this under the attribute `data')

data

data.frame with the different annotations, where each row represent a cell. The rownames should match those of `norm' (i.e. function `process_data()' should provide this under the attribute `network').

first_selection

boolean array with first selection cells as TRUE values, for all cells in `data'.

second_selection

boolean array with second selection cells as TRUE values, for all cells in `data'.

n_bars

if an integer value, it defines the number of bars of the plot, selecting those that are most "relevant". If an array with marker names, it uses those.

valley

the value in `norm' corresponding to the valley separating positive and negative peak for CITE-seq data.

palette

color palette, default "BrBG"

quant

position of positive and negative peak for normalized data.

Value

returns a list containing a ggplot object and the list of markers selected and used.