Create enrichMap igraph object from enrichResult.

enrichMapJam(
  x,
  n = 50,
  vertex.label.font = 1,
  vertex.label.cex = 1,
  keyColname = "ID",
  nodeLabel = c("Name", "Description", "ID"),
  descriptionColname = "Description",
  nodeLabelFunc = NULL,
  overlapThreshold = 0.2,
  msigdbGmtT = NULL,
  verbose = FALSE,
  ...
)

Arguments

x

either enrichResult or data.frame containing enrichment results, specifically expecting colnames to contain one of c("ID","Description","Name") to represent the node name, and c("Description") to represent the description, if present.

n

numeric value indicating the maximum number of nodes to include in the final network.

vertex.label.font, vertex.label.cex

attributes to define the default node label font and size.

keyColname, nodeLabel, descriptionColname

character vectors indicating the colname to use for the node name and label.

nodeLabelFunc

optional function to apply to V(g)$name in order to create V(g)$label. One suggestion is fixSetLabels() which applies word wrap, and optional max character length.

overlapThreshold

numeric value indicating the minimum Jaccard overlap, where edges with lower values are deleted from the igraph object.

...

additional arguments are passed to enrichDF2enrichResult() when the input x is a data.frame.

Value

igraph object, whose nodes represent each enriched pathway, and are sized based upon the number of genes involved in the enrichment, and are colored based upon the log10(Pvalue)

using colorjam::vals2colorLevels(), a function that applies a color gradient to a numeric range. Each edge has attributes: overlap containing Jaccard overlap, overlap_count with the number of genes in common between the two nodes, and overlap_max_pct with the maximum percent overlap between two nodes (overlap count)/(smaller node size).

Details

This function could also be called enrichResult2emap().

This function is a minor extension to the original function DOSE::enrichMap() which is now rewritten in the source package to enrichplot::emapplot(). The major differences:

  • This function returns an igraph object, which can be manipulated using network-related functions.

  • This function calculates overlap using dist(...,method="binary") which is a much faster method for calculating the Jaccard overlap.

  • This function also calculates the overlap count, another helpful measure for filtering network connections, for example to remove links with only one gene, even if they overlap is above the required threshold. Many spurious network connections are removed with this filter, and it appears to be a helpful option.