Learn R Programming

mixOmics (version 4.1-4)

network: Relevance Network for (r)CCA and (s)PLS regression

Description

Display relevance associations network for (regularized) canonical correlation analysis and (sparse) PLS regression.

Usage

## S3 method for class 'default':
network(mat, threshold = 0.5, X.names = NULL, Y.names = NULL,
        color.node = c("white", "white"), 
        shape.node = c("circle", "rectangle"), 
        color.edge = c("blue", "red"), 
        lty.edge = c("solid", "solid"), 
        lwd.edge = c(1, 1), show.edge.labels = FALSE, 
        show.color.key = TRUE, symkey = TRUE, keysize = 1, 
        breaks, interactive = FALSE, alpha = 1, ...)

## S3 method for class 'rcc':
network(object, comp = 1, X.names = NULL, Y.names = NULL, \ldots)

## S3 method for class 'pls':
network(object, comp = 1, X.names = NULL, Y.names = NULL, 
        keep.var = TRUE, \ldots)

## S3 method for class 'spls':
network(object, comp = 1, X.names = NULL, Y.names = NULL, 
        keep.var = TRUE, \ldots)

Arguments

mat
numeric matrix of values to be represented.
object
object of class inheriting from "rcc", "pls" or "spls".
comp
atomic or vector of positive integers. The components to adequately account for the data association. Defaults to comp = 1.
threshold
numeric value between 0 and 1. The tuning threshold for the relevant associations network (see Details).
X.names, Y.names
character vector containing the names of $X$- and $Y$-variables.
keep.var
boolean. If TRUE only the variables with loadings not zero are plotted (as selected by spls). Defaults to TRUE.
color.node
vector of length two, the colors of the $X$ and $Y$ nodes (see Details).
shape.node
character vector of length two, the shape of the $X$ and $Y$ nodes (see Details).
color.edge
vector of colors or character string specifying the colors function to using to color the edges (see Details).
lty.edge
character vector of length two, the line type for the edges (see Details).
lwd.edge
vector of length two, the line width of the edges (see Details).
show.edge.labels
logical. If TRUE, plot association values as edge labels (defaults to FALSE).
show.color.key
boolean. If TRUE a color key should be plotted.
symkey
boolean indicating whether the color key should be made symmetric about 0. Defaults to TRUE.
keysize
numeric value indicating the size of the color key.
breaks
(optional) either a numeric vector indicating the splitting points for binning mat into colors, or a integer number of break points to be used, in which case the break points will be spaced equally between min(mat) an
interactive
logical. If TRUE, a scrollbar is created to change the threshold value interactively (defaults to FALSE). See Details.
alpha
numeric value. Tuning parameter to enhance the differences between edges corresponding to low and high correlations. Defaults to alpha = 1.
...
arguments passed to network.default.

Value

  • network return a list containing the following components:
  • simMatthe similarity (adjacent) matrix used by network.
  • gRa graph object (see the igraph R package).

encoding

latin1

Warning

If the number of variables is high, the generation of the network can take some seconds.

Details

network allows to infer large-scale association networks between the $X$ and $Y$ datasets in rcc or spls. The output is a graph where each $X$- and $Y$-variable corresponds to a node and the edges included in the graph portray associations between them. In rcc, to identify $X$-$Y$ pairs showing relevant associations, network calculate a similarity measure between $X$ and $Y$ variables in a pair-wise manner: the scalar product value between every pairs of vectors in dimension length(comp) representing the variables $X$ and $Y$ on the axis defined by $Z_i$ with $i$ in comp, where $Z_i$ is the equiangular vector between the $i$-th $X$ and $Y$ canonical variate. In spls, if object$mode is regression, the similarity measure between $X$ and $Y$ variables is given by the scalar product value between every pairs of vectors in dimension length(comp) representing the variables $X$ and $Y$ on the axis defined by $U_i$ with $i$ in comp, where $U_i$ is the $i$-th $X$ variate. If object$mode is canonical then $X$ and $Y$ are represented on the axis defined by $U_i$ and $V_i$ respectively. Variable pairs with a high similarity measure (in absolute value) are considered as relevant. By changing the threshold, one can tune the relevance of the associations to include or exclude relationships in the network. interactive=TRUE open two device, one for association network, one for scrollbar, and define an interactive process: by clicking either at each end (`$-$' or `$+$') of the scrollbar or at middle portion of this. The position of the slider indicate which is the `threshold' value associated to the display network. The interactive process is terminated by clicking the second button and selecting `Stop' from the menu, or from the `Stop' menu on the graphics window. The color.node is a vector of length two, of any of the three kind of R colors, i.e., either a color name (an element of colors()), a hexadecimal string of the form "#rrggbb", or an integer i meaning palette()[i]. color.node[1] and color.node[2] give the color for filled nodes of the $X$- and $Y$-variables respectively. Defaults to c("white", "white"). color.edge give the color to edges with colors corresponding to the values in mat. Defaults to c("blue", "red") for low and high weight respectively. shape.node[1] and shape.node[2] provide the shape of the nodes associate to $X$- and $Y$-variables respectively. Current acceptable values are "circle" and "rectangle". Defaults to c("circle", "rectangle"). lty.edge[1] and lty.egde[2] give the line type to edges with positive and negative weight respectively. Can be one of "solid", "dashed", "dotted", "dotdash", "longdash" and "twodash". Defaults to c("solid", "solid"). lwd.edge[1] and lwd.edge[2] provide the line width to edges with positive and negative weight respectively. This attribute is of type double with a default of c(1, 1).

References

Butte, A. J., Tamayo, P., Slonim, D., Golub, T. R. and Kohane, I. S. (2000). Discovering functional relationships between RNA expression and chemotherapeutic susceptibility using relevance networks. Proceedings of the National Academy of Sciences of the USA 97, 12182-12186. Moriyama, M., Hoshida, Y., Otsuka, M., Nishimura, S., Kato, N., Goto, T., Taniguchi, H., Shiratori, Y., Seki, N. and Omata, M. (2003). Relevance Network between Chemosensitivity and Transcriptome in Human Hepatoma Cells. Molecular Cancer Therapeutics 2, 199-205.

See Also

plotVar, plot3dVar, cim.

Examples

Run this code
require(igraph)

## network representation for objects of class 'rcc'
data(nutrimouse)
X <- nutrimouse$lipid
Y <- nutrimouse$gene
nutri.res <- rcc(X, Y, ncomp = 3, lambda1 = 0.064, lambda2 = 0.008)

# may not work on the Linux version, use Windows instead
network(nutri.res, comp = 1:3, threshold = 0.6)

## Changing the attributes of the network
network(nutri.res, comp = 1:3, threshold = 0.45,
        color.node = c("mistyrose", "lightcyan"),,
        shape.node = c("circle", "rectangle"), 
        color.edge = jet.colors(8),
        lty.edge = c("solid", "solid"), lwd.edge = c(2, 2), 
        show.edge.labels = FALSE)

## interactive 'threshold' 
network(nutri.res, comp = 1:3, threshold = 0.55, interactive = TRUE)
## select the 'threshold' and "see" the new network

## network representation for objects of class 'spls'
data(liver.toxicity)
X <- liver.toxicity$gene
Y <- liver.toxicity$clinic
toxicity.spls <- spls(X, Y, ncomp = 3, keepX = c(50, 50, 50), 
                      keepY = c(10, 10, 10))
network(toxicity.spls, comp = 1:3, threshold = 0.8, 
        X.names = NULL, Y.names = NULL, keep.var = TRUE,
        color.node = c("mistyrose", "lightcyan"),
        shape.node = c("rectangle", "circle"),
        color.edge = c("red", "blue"),
        lty.edge = c("solid", "solid"), lwd.edge = c(1, 1), 
        show.edge.labels = FALSE, interactive = FALSE)

Run the code above in your browser using DataLab