plot_string: Plot STRING network of genes colored by enriched pathways

View source: R/plot_string.R

plot_stringR Documentation

Plot STRING network of genes colored by enriched pathways

Description

To be used in conjunction with map_string

Usage

plot_string(
  map,
  layout = "fr",
  edge_min = 0,
  edge_max = Inf,
  enriched_only = FALSE,
  enrichment = NULL,
  overlap = 2,
  fdr_cutoff = 0.2,
  colors = NULL,
  text_size = 2,
  node_size = 1
)

Arguments

map

List output by map_string

layout

Character string for network layout algorithm. See options in igraph::layout_with_

edge_min

Numeric minimum edges a node must have to be displayed. Default is 0 meaning orphan nodes are included

edge_max

Numeric maximum edges a node must have to be displayed. Default in Inf. Set to 0 to see only orphan nodes

enriched_only

Logical if should include only genes in significantly enriched terms. Default FALSE

enrichment

Data frame output by BIGprofiler, BIGenrichr, or BIGsea. For use in coloring nodes

overlap

Numeric minimum of total significant genes in a enrichment term to be used as colors (BIGprofiler, BIGenrichr)

fdr_cutoff

Numeric maximum FDR of enrichment terms to be used as colors (BIGprofiler, BIGenrichr, BIGsea)

colors

Character vector of custom colors to use. Must be at least a long as total significant terms plus 1 for the "none" group

text_size

Numeric size of gene labels on network nodes. Default of 2

node_size

Numeric size of network nodes. Default of 1

Value

ggplot STRING network object

Examples

#NOT RUN
# map <- map_string(genes = c("MTHFD2","ISOC1","IL2RB","SAMHD1","NAMPT","NOD1",
#                            "NFKB1","IFIT3","ZBP1","IL15RA","SP110","ITGB7",
#                            "SERPING1","B2M","CXCL11","USP18","MAPKAPK2","DKK1"),
#                version = 12, score_threshold = 400)
# plot_string(map)
#
# Add enrichment colors
# library(dplyr)
# library(SEARchways)
# genes.OI <- example.model$lmerel %>%
#             filter(variable == "virus" & FDR < 0.2) %>%
#             select(variable, gene)
# example_enrich <- SEARchways::BIGprofiler(gene_df = genes.OI,
#                                           category = "H", ID = "ENSEMBL")
#
# map2 <- map_string(genes = genes.OI$gene,
#                  version = 11.5, score_threshold = 400)
# plot_string(map2, enrichment = example_enrich, fdr_cutoff=0.2)
# plot_string(map2, enrichment = example_enrich, fdr_cutoff=0.2, enriched_only=TRUE)
#
# Add GSEA colors
# genes.FC <- example.model$lmerel %>%
#             filter(variable == "virus") %>%
#             select(variable, gene, estimate)
# example_gsea <- BIGsea(gene_df = genes.FC, category = "H", ID = "ENSEMBL")
#
# plot_string(map2, enrichment = example_gsea, fdr_cutoff = 0.3,
#             edge_max = 0, enriched_only=TRUE)

BIGslu/BIGpicture documentation built on Oct. 14, 2024, 9:30 p.m.