plot_pwy: Plot network diagram for a pathway

Description Usage Arguments Details Value

View source: R/plot_pwy.R

Description

Plot nodes most impacting a pathway as a network diagram with node color corresponding to z-score and shape to pathway membership. The most impactful nodes are inferred by assuming the input here is the same as was used to calculate pathway significance in pants with or without mediation.

Usage

1
2
plot_pwy(feat.tab, impact.tab, Gmat.pwy, gr, annot.v = NULL, ntop = 7,
  name = NULL, repel = FALSE, plot = TRUE, seed = 0)

Arguments

feat.tab

Matrix-like object for all analytes with rownames as analyte names, which should have some overlap with rownames(Gmat.pwy). 1st column with stats. Stats should be finite unless they are NA. Stats for all nodes are used to define color scale, for consistency across pathway visualizations. 1st column name used as stat descriptor in plot.

impact.tab

Matrix-like object with rownames as analyte names and a column named "impact" (ignoring upper vs lowercase) with top analytes for this pathway. This table can read from CSV files written by pants.

Gmat.pwy

Binary feature by pathway inclusion matrix, with this pathway as 1st column. Accessible via Gmat.pwy[, pathway_name, drop=FALSE].

gr

graph object of class igraph.

annot.v

Named character vector of annotations of all analytes to replace analyte IDs. Ignored if it is NULL; otherwise, NA annotations are ignored. Names should have some overlap with other objects' names, e.g. rownames(feat.tab).

ntop

Number of top impactful analytes to plot. Their network neighbors may also be included.

name

Name of file to plot to. If NULL, a filename is created using colnames(Gmat.pwy)[1]. Set to NA to plot to screen instead of to file.

repel

Logcal; use the repel functionality from ggrepel to avoid overlapping text?

plot

Logical; should plot be generated?

seed

Integer seed to set for reproducility if fun="mroast", since mroast uses random simulations. Ignored if fun="fry".

Details

If some ntop nodes are outside pwy, then their neighbor nodes inside pwy are also plotted. These nodes are then connected based on the interaction network.

Unmeasured nodes have stat of NA and are drawn gray.

Value

Invisibly, a tbl_graph, a subclass of igraph so every igraph method will work as expected.


jdreyf/PANTS documentation built on July 18, 2019, 10:12 a.m.