structural: Create adjacency matrix based on m/z (molecular weight)...

Description Usage Arguments Details Value Author(s) Examples

View source: R/structural.R

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 the unweighted 'numeric' 'matrix' together with a 'character' 'matrix' with the type of loss/addition as a list at the specific positions.

Usage

1
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 an undirected adjacency matrix will be returned, if 'FALSE' a directed adjacency matrix will be returned with links reported that match the transformations defined in 'transformation' (respecting the sign of 'mass')

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').

Value

'list' containing two matrices. The first entry stores the 'numeric' 'matrix' with edges inferred from mass differences. The second entry stores the 'character' 'matrix' with the type (corresponding to the '"group"' column in 'transformation') is stored

Author(s)

Thomas Naake, thomasnaake@googlemail.com

Examples

1
2
3
4
5
6
7
8
9
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]))
struct_adj <- structural(x_test, transformation, ppm = 5, directed = TRUE)

MetNet documentation built on Nov. 8, 2020, 7:34 p.m.