plotCluster: Plot cluster network

Description Usage Arguments Examples

View source: R/edgefinder.R

Description

Plot a cluster network with all the nodes and edges - the central node is marked by a black circle. The radius of each point corresponds to its degree. The opacity corresponds to the percentage of edges from the node that is in the cluster (the darker it is, the larger the percentage of edges is within the cluster.) The distance from the center corresponds to the relative dissimilarity with the central node. This is computed as the number of neighbors the node and the central node do not have in common.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
plotCluster(
  AdjMat,
  clustNo,
  clusterInfo = NULL,
  labels = FALSE,
  nodecol = "blue",
  labelsize = 1,
  figtitle = NULL,
  negcor = NULL,
  edgecols = "grey88"
)

Arguments

AdjMat

An adjacency Matrix (0/1).

clustNo

The chosen cluster.

clusterInfo

Obtained from graphComponents.

labels

If set to TRUE, show node names (default=FALSE).

nodecol

The color(s) of the nodes. Can be a single value or a vector of length equal to the number of rows in AdjMat

labelsize

Text size of node labels.

figtitle

The title of the plot (default=NULL).

negcor

The pairs which are negatively correlated, to be drawn as red edges (default=NULL). If set to null, all edges will have the same color.

edgecols

The colors to be used for edges. Default="grey88". If one value is given, all edges will be drawn using this color. If negcor is used to specify which edges are negatively correlated and edgecol contains two valid colors, the first is used for positive correlations, and the second for negative ones.

Examples

1
2
3
4
5
   data(WT)
   WTres <- edgefinder(WT, ttl = "Wild Type")
   WTComp <- graphComponents(WTres$AdjMat)
   plotCluster(WTres$AdjMat, 5, WTComp)
   # plotCluster(WTres$AdjMat, 5, WTComp, negcor = WTres$lt, edgecols = c("grey88","orange"))

haimbar/edgefinder documentation built on Dec. 20, 2021, 2:45 p.m.