combine {MetNet}R Documentation

Combine structural and statistical 'AdjacencyMatrix' objects

Description

The function 'combine' takes as input the structural and statistical 'AdjacencyMatrix' objects, created in former steps. It will access the assays 'binary' and 'consensus', adds them together and will report a connection between metabolites if the edge is present in both matrices.

'combine' returns an 'AdjacencyMatrix' containing this consensus matrix supported by the structural and statistical adjacency matrices (assays 'combine_binary', 'combine_transformation', and 'combine_mass_difference'.

Usage

combine(am_structural, am_statistical)

Arguments

am_structural

'AdjacencyMatrix' containing 'numeric' structural adjacency matrices (assays 'binary', 'transformation', and 'mass_difference').

am_statistical

'AdjacencyMatrix' containing the assay 'consensus'

Details

The matrices from the assays 'binary' and 'consensus' will be added and an unweighted connection will be reported when the edges are respectively present in both 'binary' and 'consensus'.

Value

'AdjacencyMatrix' object containing the assays 'combine_binary' ('numeric' adjacency matrix), 'combine_transformation' ('character' adjacency matrix), and 'combine_mass_difference' ('character' adjacency matrix).

The 'AdjacencyMatrix' object will also contain all other assays contained in 'am_structural' and 'am_statistical'.

Author(s)

Thomas Naake, thomasnaake@googlemail.com

Examples

data("x_test", package = "MetNet")
x_test <- as.matrix(x_test)
transformation <- rbind(
    c("Monosaccharide (-H2O)", "C6H10O5", "162.0528234315"),
    c("Disaccharide (-H2O)", "C12H20O11", "340.1005614851"),
    c("Trisaccharide (-H2O)", "C18H30O15", "486.1584702945"))
transformation <- data.frame(group = transformation[, 1],
     formula = transformation[, 2],
     mass = as.numeric(transformation[, 3]))
     
am_struct <- structural(x_test, transformation, ppm = 5)
x_test_cut <- as.matrix(x_test[, -c(1:2)])
am_stat <- statistical(x_test_cut, model = c("pearson", "spearman"),
    correlation_adjust = "bonferroni")
am_stat <- threshold(am_stat, type = "top2", args = list(n = 10))

## combine
combine(am_structural = am_struct, am_statistical = am_stat)


[Package MetNet version 1.10.0 Index]