rtCorrection {MetNet} | R Documentation |
The function rtCorrection
corrects the adjacency matrix
infered from structural data based on shifts in the retention time. For
known chemical modifications (e.g. addition of glycosyl groups) molecules
with the moiety should elue at a different time (in the case of glycosyl
groups the metabolite should elute earlier in a reverse-phase
liquid chromatography system). If the connection for the metabolite does not
fit the expected behaviour, the connection will be removed (otherwise
sustained).
rtCorrection(struct_adj, x, transformation)
struct_adj |
list returned by the function
|
x |
matrix, where columns are the samples and the rows are features
(metabolites), cell entries are intensity values, |
transformation |
data.frame, containing the columns |
rtCorrection
is used to correct the adjacency matrix
returned by createStructuralAdjacency
when information is available
about the retention time and shifts when certain transformation occur
(it is meant to filter out connections that were created by
m/z differences that have by chance the same m/z difference but
different/unexpected retention time behaviour). #'
rtCorrection
accesses the second list element of
struct_adj
and matches the elements in the 'group'
column
against the character matrix. In case of matches, rtCorrection
accesses the 'rt'
column of x
and calculates the retention
time difference between the features. rtCorrection
then checks
if the observed retention time difference matches the expected behaviour
(indicated by '+'
for a higher retention time of the feature with
the putative group, '-'
for a lower retention time of the feature
with the putative group or '?'
when there is no information
available or features with that group should not be checked). In case
several transformation were assigned to a feature/feature pair connections
will always be removed if there is an inconsistency with any of the given
transformation.
list containing two matrices, in the first list entry the
matrix with edges inferred mass differences corrected by retention time
shifts is stored, in the second list entry the matrix with the type
(corresponding to the 'group'
column
in transformation
) is stored
Thomas Naake, thomasnaake@googlemail.com
data("x_test", package="MetNet") transformation <- rbind( c("Hydroxylation (-H)", "O", "15.9949146221", "-"), c("Malonyl group (-H2O)", "C3H2O3", "86.0003939305", "?"), c("C6H10O6", "C6H10O6", "178.0477380536", "-"), c("D-ribose (-H2O) (ribosylation)", "C5H8O4", "132.0422587452", "-"), c("Disaccharide (-H2O)", "C12H20O11", "340.1005614851", "-"), c("Glucuronic acid (-H2O)", "C6H8O6", "176.0320879894", "?"), c("Monosaccharide (-H2O)", "C6H10O5", "162.0528234315", "-"), c("Trisaccharide (-H2O)", "C18H30O15", "486.1584702945", "-")) transformation <- data.frame(group=transformation[,1], formula=transformation[,2], mass=as.numeric(transformation[,3]), rt=transformation[,4]) struct_adj <- createStructuralAdjacency(x_test, transformation, ppm=5) struct_adj_rt <- rtCorrection(struct_adj, x_test, transformation)