rich_forest: Barplot for GSEA results

Description Usage Arguments

Description

This function creates a compact way of visualising GSEA results by creating multiple tree-like plots, or 'forests' (silva in Latin). Each tree represents a pairwise comparison between one particular cell type with all other cell types. This pattern is repeated for other cell types as well. Each cell pair comparison is marked by an arrow (sagitta in Latin) on top

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
rich_forest(
  plot_data,
  markers,
  organism_db,
  show_num = 4,
  show_gene_labels = 3,
  category_col = "category",
  pval_col = "p.adjust",
  enrich_col = "value",
  term_col = "termID",
  group1 = "cluster",
  group2 = "compare_group",
  simplification = T,
  sim_dict = NULL,
  append_default_dict = T,
  compare_group_col_marker = "compare_group",
  AP = NULL,
  ...
)

Arguments

plot_data

a dataframe generated from run_GSEA_all_types. NB: if the input data frame is from other functions, make sure you apply some p value cut off. It must have the following columns:

markers

a dataframe generated from find_DE_genes that contain the log fold change of gene expression. This information is used to order the appearance of genes in the plot labels. It must contain the columns: group (group1), logFC (used to rate which genes to show), feature (genes), and compare_group (group2). You can change compare_group via:

organism_db

a gene database

show_num

how many terms to show per pairwise comparison

show_gene_labels

how many genes to show after each term

category_col

the GSEA terms

pval_col

the (adjusted) p value

enrich_col

the enrichment value

term_col

the ID for each gene in the format of A.B.entrez where A and B can be of anything and entrez means entrez ID

group1

comparison group1. Each group in cluster will be in a

group2

comparison group2. Each group here will be in the same tree.

simplification

whether to simplify the GO/KEGG/Reactome terms

sim_dict

a data frame with 2 columns: 'ori' for the original terms, 'sub' for the strings that will replace the original terms. The default is a a limited data frame built into this package.

append_default_dict

append default dictionary to simplify the terms not exist.

compare_group_col_marker

which column in markers contain the group2 information.

AP

aesthetic parameters for plotting

...

other parameters to pass onto gg_silva and sagittae.

separate

tree. You may change it by specifying group=...'


Yutong441/TBdev documentation built on Dec. 18, 2021, 8:22 p.m.