PlotGraphWithModules: Plot a graph with nodes in modules indicated by colors

View source: R/PlotGraphWithModules.R

PlotGraphWithModulesR Documentation

Plot a graph with nodes in modules indicated by colors

Description

Visualization of a graph with nodes in modules inferred from the clustering dendrogram by PlotDendrogram.

Usage

PlotGraphWithModules(Adj_directed, PlotDendrogramObj, 
                     GV, node.size = 8, arrow.size = 5,
                     label.size = 3,alpha = 1,...)

Arguments

Adj_directed

Adjacency matrix of a graph.

PlotDendrogramObj

The graphical objects from PlotDendrogram.

GV

The number of genetic variants (SNPs/indels/CNVs/eQTL) in the input data matrix. For example, if the data has one SNPs/indels/CNV/eQTL in the first column, then GV = 1, if 2 SNPs/indels/CNVs/eQTL in the 1st and 2nd Column, then GV = 2, and so on. If no GV then GV = 0.

node.size

The size of the nodes in the graph. Defaults to 8.

arrow.size

The size of the arrows for directed network edges, in points. Defaults to 5.

label.size

The size of the node labels in points, as a numeric value, a vector of numeric values, or as a vertex attribute containing numeric values. Defaults to 3.

alpha

The level of transparency of the edges and nodes. Defaults to 1 (no transparency).

...

Other arguments passed to ggnet2.

Value

  • PlotGraphWithModulesObj: An object of class "graph" of the graph.

Author(s)

Md Bahadur Badsha (mbbadshar@gmail.com)

References

1. Badsha MB, Martin EA and Fu AQ (2021). MRPC: An R package for inference of causal graphs. Frontiers in Genetics, 10:651812.

See Also

PlotDendrogram

Examples

## Not run: 
# Adjacency matrix from a graph in the example
Adj_directed <- as(data_examples$complex$cont$withGV$graph,
                   "matrix")

# A clustering dendrogram with nodes grouped in colored modules
PlotDendrogramObj <- PlotDendrogram(Adj_directed,
                                    minModuleSize = 5)
                  
# A graph object with nodes in modules
PlotGraphWithModulesObj <- PlotGraphWithModules(Adj_directed,
                                                PlotDendrogramObj,
                                                GV = 14,
                                                node.size = 8,
                                                arrow.size = 5,
                                                label.size = 3,
                                                alpha = 1) 

# Plot the graph with nodes in different colors
plot(PlotGraphWithModulesObj) 

## End(Not run)

audreyqyfu/mrpc2 documentation built on April 17, 2022, 7:36 a.m.