molNetPlot {chemodiv} | R Documentation |
Plot molecular networks
Description
Function to conveniently create a basic plot of the molecular network
created by the molNet
function. Molecular networks can be
used to illustrate the biosynthetic/structural similarity of
phytochemical compounds in a sample, while simultaneously visualizing
their relative concentrations. In the network, nodes are compounds,
with node sizes or node colours representing the relative concentrations
of compounds. Edges connects nodes, with edge widths representing
compound similarity. This function exists to provide an easy way to
make basic molecular network plots. Customized network plots can be
created with e.g. the ggraph
package or the
Cytoscape software platform.
Usage
molNetPlot(
sampleData,
networkObject,
groupData = NULL,
npcTable = NULL,
plotNames = FALSE,
layout = "kk"
)
Arguments
sampleData |
Data frame with the relative concentration of each compound (column) in every sample (row). |
networkObject |
A network object, as created by the
|
groupData |
Grouping data (e.g. population, species etc.). If supplied, a separate network will be created for each group. Should be either a vector, or a data frame with a single column. |
npcTable |
It is optional but recommended to supply an
|
plotNames |
Indicates if compounds names should be included in the molecular network plot. |
layout |
Layout used by |
Details
The network object from molNet
and sampleData
have to
be supplied. In addition, groupData
and/or an NPCTable
can be supplied. If an NPCTable is supplied, which is recommended,
node colours will represent NPC pathways, and node sizes the relative
concentration of the compounds. Edge widths represent compound similarity,
and only edges with similarity values above the cutOff
value
in the molNet
function will be plotted.
If groupData
is supplied, one network will be created for each group.
When groupData
but not an NPCTable
is supplied,
compounds missing (i.e. having a mean of 0) from
specific groups are plotted as triangles. When groupData
and an NPCTable
is supplied, compounds missing from
specific groups have a white fill. Additionally, in both cases, edges
connecting to missing compounds are lighter coloured. These graphical
styles are done so that networks are more easy to compare across groups.
Value
A plot with one or more molecular networks.
Examples
data(minimalSampData)
data(minimalNPCTable)
data(minimalMolNet)
groups <- c("A", "A", "B", "B")
molNetPlot(minimalSampData, minimalMolNet)
molNetPlot(minimalSampData, minimalMolNet, groups)
molNetPlot(minimalSampData, minimalMolNet, plotNames = TRUE)
data(alpinaSampData)
data(alpinaPopData)
data(alpinaMolNet)
data(alpinaNPCTable)
molNetPlot(sampleData = alpinaSampData, networkObject = alpinaMolNet,
npcTable = alpinaNPCTable)