Graphical outputs

  • How can I interpret the various plots provided by mixOmics?

See I. González, K-A. Lê Cao2, M.J. Davis, S. Déjean – Visualising associations between paired ‘omics’ data sets. BioData Mining 2012, 5:19 doi:10.1186/1756-0381-5-19 http://www.biodatamining.org/content/5/1/19

  • What is the difference between the cutoff used in plotVar and network?

The difference (or similarity) between these two representations is not in the number of variables represented in each graphic but in the interpretation of the same ones:
In the plotVar, variables with at least a coordinate in ‘comp’ (in absolute value) above of the cutoff are plotted. The interpretation is : strongly associated (or correlated) variables are projected in the same direction from the origin. The greater the distance from the origin the stronger the association.
In network, variables X-Y are represented 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 correlation ‘circle’ (or hyper-sphere if length(comp)>2). Variables with a similarity measure (in absolute value) above of the threshold are plotted.
That is, the cutoff (in plotVar) and the threshold (in network) have not the same interpretation.

  • Regarding cim() function, can I change the distances used?

Distances and agglomeration method can be change as following

distfun <- function(x) as.dist(1 - cor(t(as.matrix(x)), method = "pearson"))
hclustfun <- function(x) hclust(x, method = "ward")
cim(res, comp = 1:3, hclustfun = hclustfun, distfun = distfun)
  • Regarding cim() function, how can I get the identity of the objects clustered together?

This can be done using the following script:

dend = cim(...) 
hdend = as.hclust(dend$ddr) ## or dend$ddc 
plot(hdend) 
clust = identify(hdend) 
clust = lapply(clust, names) 
clust
  • Can I produce a biplot representation where individuals and variables are superimposed?

The functionality is not provided ni mixOmics but the following code enable to produce such a plot.

data(liver.toxicity)
X <- liver.toxicity$gene
Y <- as.factor(liver.toxicity$treatment[, 4])
res = splsda(X, Y, ncomp = 2, keepX = c(20, 20))
ind.coord = res$variates$X[, 1:2]
var.coord = plotVar(res, var.label = FALSE)$coord.X
biplot(ind.coord, var.coord, xlabs = Y)
abline(h = 0, v = 0, lty = 2)
  • How to export a relevance network to Cytoscape

Answer provided by Guido Hooiveld (thanks!)
I generated a ‘relevance network’ (from a multilevel experiment), essentially as described in the vignette (http://perso.math.univ-toulouse.fr/mixomics/case-studies/multilevelliver-toxicity/4/).
Next I wanted to export it for use in Cytoscape. To this end I followed the suggestion to export it in “gml” format (http://www.math.univ-toulouse.fr/~biostat/mixOmics/Graphics_Networks.html#export_network). However, i was unable to properly load the network in Cytoscape.
I got it working by exporting the network in graphml format

write.graph(network.result$gR, file = "corr_network_0.8.graphml", format = "graphml")

This network information file could then nicely be opened in Cytoscape via File -> Import -> Network (Multiple File Types).
Note: be sure that within Cytoscape the GraphML reader plugin is installed (should be available @ Plugins -> Manage Plugins; select from Network and Attribute I/O); otherwise download from: http://code.google.com/p/graphmlreader/

After importing one can set the attributes of nodes and edges in the VizMapper tab:
# Node label = label
# Node Color = color (Discrete Mapping); set lightcyan (e.g. genes; dataset X) and mistyrose (e.g. bacteria; dataset Y) to colors of interest
# Node Shape = shape (Discrete Mapping); set circle (e.g. genes; dataset X) to e.g. ELLIPSE, and rectangle (e.g. bacteria; dataset Y) to e.g. DIAMOND
# Edge color = color (Discrete Mapping); set RGB for ‘green’ (0,255,0) and ‘red’ (255,0,0).