structural {MetNet}R Documentation

Create adjacency matrix based on m/z (molecular weight) difference

Description

The function 'structural' infers an unweighted adjacency matrix using differences in m/z values that are matched against a 'data.frame' of calculated theoretical differences of loss/addition of functional groups. 'structural' returns an 'AdjacencyMatrix' object containing the unweighted 'numeric' 'matrix' (assay 'binary'), together with a 'character' 'matrix' with the type of loss/addition (assay 'transformation'), and the 'character' 'matrix' with the mass differences (assay 'mass_difference').

Usage

structural(x, transformation, ppm = 5, directed = FALSE)

Arguments

x

'matrix', where columns are the samples and the rows are features (metabolites), cell entries are intensity values. 'x' contains the column '"mz"' that has the m/z information (numerical values) for the calculation of mass differences between features

transformation

'data.frame', containing the columns '"group"', and '"mass"' that will be used for detection of transformation of (functional) groups

ppm

'numeric', mass accuracy of m/z features in parts per million (ppm)

directed

'logical', if 'TRUE', absolute values of m/z differences will be taken to query against 'transformation' (irrespective the sign of 'mass') and undirected adjacency matrices will be returned as the respective assays. This means, if there is a negative mass in 'transformation[, "mass"]', this negative mass will not be reported. If 'FALSE', directed adjacency matrices will be returned with links reported that match the transformations defined in 'transformation' (respecting the sign of 'mass'). The 'directed' slot of the returned 'AdjacencyMatrix' object will contain the information on 'directed'.

Details

'structural' accesses the column '"mz"' of 'x' to infer structural topologies based on the functional groups defined by 'transformation'. To account for the mass accuracy of the dataset 'x', the user can specify the accuracy of m/z features in parts per million (ppm) by the 'ppm' argument. The m/z values in the '"mz"' column of 'x'" will be converted to m/z ranges according to the 'ppm' argument (default 'ppm = 5').

The returned 'AdjacencyMatrix' object contains the assays 'binary', 'transformation', and 'mass_difference'. The 'type' slot is set to 'structural'. The 'directed' slot is set accordingly to the 'directed' argument of the function 'structural'. The 'thresholded' slot is set to 'FALSE'

Value

'AdjacencyMatrix' object. The object will store the adjacency matrices in the assay slots. The first entry stores the 'numeric' 'matrix' with binary edges inferred from mass differences. The second entry stores the 'character' 'matrix' with the type (corresponding to the '"group"' column in 'transformation') is stored. The third entry stores the 'character' 'matrix' with the 'mass_difference' information (corresponding to the '"mass"' column in 'transformation').

Author(s)

Thomas Naake, thomasnaake@googlemail.com and Liesa Salzer liesa.salzer@helmholtz-muenchen.de

Examples

data("x_test", package = "MetNet")
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, directed = TRUE)


[Package MetNet version 1.10.0 Index]