make_TF_barplot: Plot g:profileR Barplot (TF)

View source: R/make_TF_barplot.R

make_TF_barplotR Documentation

Plot g:profileR Barplot (TF)

Description

Make a barplot of the top transcription factors enriched by gprofileR.

Usage

make_TF_barplot(ordered_back_all_tf, top_tf = 5)

Arguments

ordered_back_all_tf

Output of the g:profileR function.

top_tf

The number of transcription factors to be plotted.

Details

This function takes a gprofileR output and prints the top "top_tfs" most significantly enriched fdr adjusted p-values before plotting the rank of their p-values.

Value

make_TF_barplot A barplot of the number of "top_tf" tf names (not motifs), ranked by -log10(Pfdr).

Examples


data(POA_example)
 POA_generes <- POA_example$POA_generes
 POA_OR_signature <- POA_example$POA_OR_signature
 POA_Rank_signature <- POA_example$POA_Rank_signature
Signature <- as.data.frame(POA_Rank_signature)
rowname <- get_gene_symbol(Signature)
rownames(Signature) <- rowname$rowname
ordered_back_all <- gprofiler2::gost(query = rowname$rowname[1:100], organism = "mmusculus", 
ordered_query = TRUE, significant = TRUE, exclude_iea = FALSE, multi_query = FALSE, 
measure_underrepresentation = FALSE, evcodes = FALSE, user_threshold = 0.05, 
correction_method = "fdr",   numeric_ns = "", sources = c("GO:BP", "KEGG", "REAC"))  
ordered_back_all <- ordered_back_all$result
ordered_back_all <- ordered_back_all[ordered_back_all$term_size > 15 &
 ordered_back_all$term_size < 2000 & ordered_back_all$intersection_size > 2,]
ordered_back_all_tf <- gprofiler2::gost(query = rowname$rowname[1:150], organism = "mmusculus",
 ordered_query = TRUE, significant = TRUE, exclude_iea = FALSE, multi_query = FALSE,
 measure_underrepresentation = FALSE, evcodes = FALSE, user_threshold = 0.05,
  correction_method = "fdr",  numeric_ns = "", sources = c("TF"))  
ordered_back_all_tf <- ordered_back_all_tf$result
ordered_back_all_tf <- ordered_back_all_tf[ordered_back_all_tf$term_size > 15
 & ordered_back_all_tf$term_size < 5000 & ordered_back_all_tf$intersection_size > 2,]
TF = ordered_back_all_tf
BP <- ordered_back_all
bp <- plotBP(BP)
tf <- make_TF_barplot(TF)
 

scMappR documentation built on July 9, 2023, 6:26 p.m.