Type: Package
Title: Fatty Acid Metabolic Analysis
Version: 0.1.6
Description: Fatty acid metabolic analysis aimed to the estimation of FA import (I), de novo synthesis (S), fractional contribution of the 13C-tracers (D0, D1, D2), elongation (E) and desaturation (Des) based on mass isotopologue data.
Encoding: UTF-8
Depends: R (≥ 4.0), LipidMS (≥ 3.0.4), rmarkdown, knitr
Imports: accucor, scales, gtools, minpack.lm, tidyr, plyr, gplots, grDevices
RoxygenNote: 7.3.1
License: GPL-2 | GPL-3 [expanded from: GPL (≥ 2)]
LazyData: TRUE
VignetteBuilder: knitr
NeedsCompilation: no
Packaged: 2024-02-19 12:14:33 UTC; 73581298C
Author: Maribel Alcoriza-Balaguer [aut, cre], Juan Carlos Garcia-Cañaveras [ctb], Agustin Lahoz [ths]
Maintainer: Maribel Alcoriza-Balaguer <maribel_alcoriza@iislafe.es>
Repository: CRAN
Date/Publication: 2024-02-20 08:40:02 UTC

Add missing FA annotations

Description

Add missing FA annotations

Usage

addFA(msbatch, dmz = 5, faid, adducts = "M-H", mz, from, to)

Arguments

msbatch

annotated msbatch.

dmz

mz tolerance in ppm.

faid

character vector specifying FA names (i.e. "FA(16:1)").

adducts

character vector specifying adducts.

mz

numeric vector specifying FA mz.

from

numeric vector specifying the peak start.

to

numeric vector specifying the peak end.

Value

annotated msbatch.

Author(s)

M Isabel Alcoriza-Balaguer <maribel_alcoriza@iislafe.es>


FA annotation

Description

FA annotation

Usage

annotateFA(msbatch, dmz = 5, rt, adducts = c("M-H"), db)

Arguments

msbatch

msbatch obtained from LipidMS package.

dmz

mz tolerance in ppm.

rt

Optional. Numeric vector of length two specifying the rt range to search for FA.

adducts

character vector specifying adducts.

db

FA database. Data frame with three columns: formula, total (number of carbons and double bounds, i.e. "18:1") and Mass.

Value

annotated msbatch.

Author(s)

M Isabel Alcoriza-Balaguer <maribel_alcoriza@iislafe.es>

Examples

## Not run: 
msbatch <- annotateFA(msbatch, dmz = 5)

## End(Not run)


substract blank samples.

Description

substract blank samples.

Usage

blankSubstraction(fadata, blankgroup = "blank", verbose = TRUE)

Arguments

fadata

fadata.

blankgroup

name used to define blank samples group.

verbose

print information messages.

Value

blank substracted fadata.

Author(s)

M Isabel Alcoriza-Balaguer <maribel_alcoriza@iislafe.es>


Modify rt peak limits of annotated FAs

Description

Modify rt peak limits of annotated FAs

Usage

changeFArt(msbatch, id, from, to)

Arguments

msbatch

annotated msbatch.

id

integer vector specifying FA ids to be modified.

from

numeric vector specifying the peak start.

to

numeric vector specifying the peak end.

Value

annotated msbatch.

Author(s)

M Isabel Alcoriza-Balaguer <maribel_alcoriza@iislafe.es>


check S and E steps based on isotopologue distribution.

Description

check S and E steps based on isotopologue distribution.

Usage

checkparameters(resp, M, n, SE, imported, D2)

Arguments

resp

isotopologue distribution

M

total number of carbons of the fatty acid.

n

maximum number of elongation steps.

SE

list with S and E parameters. NA indicates they must be estimated while 0 indicates it does not occur.

imported

logical. TRUE if S16 is predefined as 0 (n3 or n6 series).

D2

numeric between 0 and 1. Only if D2 >= 0.4 parameters are checked based on distribution.

Value

SE list corrected.

Author(s)

M Isabel Alcoriza-Balaguer <maribel_alcoriza@iislafe.es>


acetate combinations for M+0, M+1 and M+2.

Description

acetate combinations for M+0, M+1 and M+2.

Usage

combAcetate(M)

Arguments

M

total number of carbons for the FA.

Value

acetate combination for M carbon atoms.

Author(s)

M Isabel Alcoriza-Balaguer <maribel_alcoriza@iislafe.es>


correct data for natural abundance of 13C using accucor algorithm.

Description

correct data for natural abundance of 13C using accucor algorithm.

Usage

correctNatAb13C(fadata, resolution = 140000, purity = 0.99)

Arguments

fadata

fadata.

resolution

resolution of the mass spectrometer.

purity

purity of the tracer employed.

Value

corrected fadata.

Author(s)

M Isabel Alcoriza-Balaguer <maribel_alcoriza@iislafe.es>

References

Su X, Lu W, Rabinowitz J (2017). “Metabolite Spectral Accuracy on Orbitraps.” Analytical Chemistry, 89(11), 5940-5948, PMID: 28471646, R package version 0.2.4 (2021), <https://doi.org/10.1021/acs.analchem.7b00396>.


Modify FA annotations

Description

after FA annotation using annotateFA, the resulting data frame can be modified to remove rows with unwanted annotation, iniRT and endRT can be changed to redefine peak limits and extra rows may be written to add new annotations. FAid should also be modified to contain unique names such as "FA(16:1)n7" and "FA(16:1)n10" instead of generic "FA(16:1)". For unknown fatty acids use FA(16:1)nx (nx, ny and nz are availables for all FA).

Internal standards can also be added to normalize data later. Leave ID and Adducts columns empty, write "IS" at the FAid column and add mz, RT, iniRT and endRT information.

Usage

curateFAannotations(msbatch, faid, dmz = 10)

Arguments

msbatch

annotated msbatch.

faid

data frame with 7 columns (ID, FAid, Adducts, mz, RT, iniRT and endRT) containing curated FAs.

dmz

mz tolerance in ppm.

Details

Modify FA annotations

Value

annotated msbatch.

Author(s)

M Isabel Alcoriza-Balaguer <maribel_alcoriza@iislafe.es>

Examples

## Not run: 
msbatch <- annotateFA(msbatch, dmz = 5)

plots <- plotFA(msbatch, dmz = 10)

pdf("FAs.pdf")
for (p in 1:length(plots)){
  print(plots[[p]])
}
dev.off()

write.csv(msbatch$fas, file="faid.csv", row.names=FALSE)

faid <- read.csv("faid_curated.csv", sep=",", dec=".")

msbatch <- curateFAannotations(msbatch, faid)

## End(Not run)


Data correction for natural abundance of 13C and data normalization using internal standards followed by blank substraction.

Description

Data correction for natural abundance of 13C and data normalization using internal standards followed by blank substraction.

Usage

dataCorrection(
  fadata,
  correct13C = TRUE,
  blankgroup = "blank",
  externalnormalization = c(),
  resolution = 140000,
  purity13C = 0.99,
  verbose = TRUE
)

Arguments

fadata

fadata list.

correct13C

logical. If TRUE, data is corrected for natural abundance of 13C. Set to FALSE if data has been already been corrected.

blankgroup

name used to define blank samples group.

externalnormalization

column name at the metadata data frame of any additional measure that must be used to normalize data (i.e. protein).

resolution

resolution of the mass spectrometer.

purity13C

purity of the tracer employed.

verbose

print information messages.

Value

corrected fadata.

Author(s)

M Isabel Alcoriza-Balaguer <maribel_alcoriza@iislafe.es>

References

Su X, Lu W, Rabinowitz J (2017). Metabolite Spectral Accuracy on Orbitraps. Analytical Chemistry, 89(11), 5940-5948, PMID: 28471646, R package version 0.2.4 (2021), <https://doi.org/10.1021/acs.analchem.7b00396>.

Examples


ssdata <- dataCorrection(ssexamplefadata, blankgroup="Blank")



data list for elongation analysis.

Description

data list for elongation analysis.

Usage

dataElong(S16, D1, D2, P, E1, E2, E3, E4, E5, M, vcomb16, mcombe)

Arguments

S16

fraction of newly synthesized C16 FA. If different to NULL it is included in the data list.

D1

positive numeric between 0 and 1 specifying the contribution of acetate M+1.

D2

positive numeric between 0 and 1 specifying the contribution of acetate M+2.

P

overdispersion parameter.

E1

fraction of elongated C18 FA from C16. If different to NULL it is included in the data list.

E2

fraction of elongated C20 FA from C18. If different to NULL it is included in the data list.

E3

fraction of elongated C22 FA from C20. If different to NULL it is included in the data list.

E4

fraction of elongated C24 FA from C22. If different to NULL it is included in the data list.

E5

fraction of elongated C26 FA from C124. If different to NULL it is included in the data list.

M

total number of carbons for the FA.

vcomb16

list of acetate combinations for C16 synthesis.

mcombe

list of acetate combinations for each elongation step.

Value

data list for elongation analysis.

Author(s)

M Isabel Alcoriza-Balaguer <maribel_alcoriza@iislafe.es>


data list for synthesis analysis.

Description

data list for synthesis analysis.

Usage

dataSynth(D1, D2, P, M, vcomb)

Arguments

D1

positive numeric between 0 and 1 specifying the contribution of acetate M+1. If different to NULL it is included in the data list.

D2

positive numeric between 0 and 1 specifying the contribution of acetate M+2. If different to NULL it is included in the data list.

P

overdispersion parameter. If different to NULL it is included in the data list.

M

total number of carbons for the FA.

vcomb

list of acetate combinations for C16 synthesis.

Value

Data list for synthesis analysis.

Author(s)

M Isabel Alcoriza-Balaguer <maribel_alcoriza@iislafe.es>


Desaturation analysis of fatty acids.

Description

Desaturation analysis of fatty acids.

Usage

desaturationAnalysis(
  fadata,
  desaturationsdb = FAMetA::desaturationsdb,
  SEThr = 0.05
)

Arguments

fadata

fadata containing synthesis and elongation results.

desaturationsdb

desaturation reactions considered. It can be modified to change them or to add new reactions.

SEThr

minimum S or E value allowed to perform estimate desaturations.

Details

Once synthesis and elongation parameters have been estimated, these results can be used to calculate the FA fraction that comes from desaturation in unsaturated FA. For a given unsaturated FA (e.g. FA(18:1n9) we can conceptually consider a one-step elongation-desaturation reaction (in this example directly from FA(16:0) to FA(18:1n9) (E1') or a two-step elongation followed by desaturation process (in this example FA(16:0) is elongated to FA(18:0) (E1) and then desaturated to FA(18:1n9) (Des). Therefore, desaturation can be estimated based on the fraction of E1', which is E1 from FA(18:1)n9, and E1, which is E1 from FA(18:0). This same model can be used for all known desaturation steps (see FAMetA::desaturationsdb) as long as precursor and product FA isomers have been correctly and uniquely identified and stationary state has been reached.

Value

fadata list. Desaturation analysis results will be saved at the desaturation element of the fa list.

Author(s)

M Isabel Alcoriza-Balaguer <maribel_alcoriza@iislafe.es>

Examples


ssdata <- dataCorrection(ssexamplefadata, blankgroup="Blank")
ssdata <- synthesisAnalysis(ssdata, R2Thr = 0.95, maxiter = 1e3,
maxconvergence = 100, startpoints = 5)
ssdata <- elongationAnalysis(ssdata, R2Thr = 0.95, maxiter = 1e4,
maxconvergence=100, startpoints = 5, D2Thr = 0.1)
ssdata <- desaturationAnalysis(ssdata, SEThr = 0.05)


## Not run: 
fadata <- dataCorrection(examplefadata, blankgroup = "Blank")
fadata <- synthesisAnalysis(fadata, R2Thr = 0.95, maxiter = 1e3,
maxconvergence = 100, startpoints = 5)
fadata <- elongationAnalysis(fadata, R2Thr = 0.95, maxiter = 1e4,
maxconvergence=100, startpoints = 5, D2Thr = 0.1)
fadata <- desaturationAnalysis(fadata, SEThr = 0.05)

## End(Not run)


Desaturation reactions database.

Description

Desaturation reactions database.

Usage

data("desaturationsdb")

Format

A data frame with 13 observations on the following 3 variables.

precursor

character vector.

product

character vector.

parameter

parameter required to estimate desaturation.

Examples

data(desaturationsdb)

Elongation analysis of fatty acids longer than 16 carbons.

Description

Elongation analysis of fatty acids longer than 16 carbons.

Usage

elongationAnalysis(
  fadata,
  R2Thr = 0.98,
  maxiter = 10000,
  maxconvergence = 100,
  startpoints = 5,
  D2Thr = 0.1,
  parameters = FAMetA::parameters,
  verbose = TRUE
)

Arguments

fadata

fadata containing synthesis results.

R2Thr

positive numeric between 0 and 1 specifying the minimum R2 allowed for fits.

maxiter

parameter passed to nls.control. Positive integer specifying the maximum number of iterations allowed.

maxconvergence

positive integer specifying the maximum number of successes before choosing the winning model.

startpoints

positive integer specifying the number of starting points for each parameter to be estimated.

D2Thr

minimum D2 value allowed to perform the elongation analysis.

parameters

parameters to be estimated for each fatty acid. It can be modified to change them or to add new fatty acids (adding new rows).

verbose

print information messages.

Details

Main route of de novo synthesis plus elongation starts at 16 carbons and then adds blocks of 2 carbons. Therefore, isotopologue distributions for FA longer than 16 carbons will be modeled taking into account de novo synthesis until FA(16:0), followed by single and independent elongation steps (E1, E2 …, En). Parameters D0, D1 and D2 are imported from FA(16:0) or FA(14:0) and thus, the only relevant parameters to be estimated in the elongation analysis are Ei and I. For n6 and n3 series, elongation is expected from FA(18:2)n6 and FA(18:3)n3 so that synthesis (S16:0) and first elongation step (E1) are set to 0.

Value

fadata list. Elongation analysis results will be saved at the elongation element of the fa list.

Author(s)

M Isabel Alcoriza-Balaguer <maribel_alcoriza@iislafe.es>

Examples


ssdata <- dataCorrection(ssexamplefadata, blankgroup="Blank")
ssdata <- synthesisAnalysis(ssdata, R2Thr = 0.95, maxiter = 1e3,
maxconvergence = 100, startpoints = 5)
ssdata <- elongationAnalysis(ssdata, R2Thr = 0.95, maxiter = 1e4,
maxconvergence=100, startpoints = 5, D2Thr = 0.1)


## Not run: 
fadata <- dataCorrection(examplefadata, blankgroup = "Blank")
fadata <- synthesisAnalysis(fadata, R2Thr = 0.95, maxiter = 1e3,
maxconvergence = 100, startpoints = 5)
fadata <- elongationAnalysis(fadata, R2Thr = 0.95, maxiter = 1e4,
maxconvergence=100, startpoints = 5, D2Thr = 0.1)

## End(Not run)


calculate FA isotope distribution for elongated FAs using the quasi multinomial distribution.

Description

calculate FA isotope distribution for elongated FAs using the quasi multinomial distribution.

Usage

elongationqmult(S16, D1, D2, P, E1, E2, E3, E4, E5, M, vcomb16, mcombe)

Arguments

S16

fraction of newly synthesized palmitate.

D1

tracer contribution to M+1 acetate pool.

D2

tracer contribution to M+2 acetate pool.

P

overdispersion parameter. If different to 0, quasi-multinomial distribution is obtained, while if set to 0, it is simplified to a multinomial distribution.

E1

fraction of elongated C18 FA from C16.

E2

fraction of elongated C20 FA from C18.

E3

fraction of elongated C22 FA from C20.

E4

fraction of elongated C24 FA from C22.

E5

fraction of elongated C26 FA from C24.

M

total number of carbons for the FA.

vcomb16

list of acetate combinations for C16 synthesis obtained with combAcetate(16) function.

mcombe

list of acetate combinations for each elongation step obtained with combAcetate(2) function.

Value

FA isotope distribution.

Author(s)

M Isabel Alcoriza-Balaguer <maribel_alcoriza@iislafe.es>


Fit FA isotope distribution with non-linear regression using multiple starting points to find the best fit.

Description

Fit FA isotope distribution with non-linear regression using multiple starting points to find the best fit.

Usage

estimatePars(
  formula,
  gridStart,
  datanls,
  maxiter,
  maxconvergence,
  limitPhi = 0.1
)

Arguments

formula

formula.

gridStart

starting points grid.

datanls

data list.

maxiter

parameter passed to nls.control. Positive integer specifying the maximum number of iterations allowed.

maxconvergence

positive integer specifying the maximum number of successes before choosing the winning model.

limitPhi

upper bound for overdispersion parameter.

Value

model.

Author(s)

M Isabel Alcoriza-Balaguer <maribel_alcoriza@iislafe.es>

References

Daniel Padfield and Granville Matheson (2020). nls.multstart: Robust Non-Linear Regression using AIC Scores. R package version 1.2.0. <https://CRAN.R-project.org/package=nls.multstart>


estimate synthesis parameters.

Description

estimate synthesis parameters.

Usage

estimateSynthesis(
  fa,
  M,
  R2Thr = 0.9,
  maxiter = 1000,
  maxconvergence = 100,
  D1 = NA,
  D2 = NA,
  P = NA,
  startpoints = 5
)

Arguments

fa

data frame with isotope intensities for a FA. First two columns correspond to Compound and Label information.

M

total number of carbons for the FA.

R2Thr

positive numeric between 0 and 1 specifying the minimum R2 allowed for fits.

maxiter

parameter passed to nls.control. Positive integer specifying the maximum number of iterations allowed.

maxconvergence

positive integer specifying the maximum number of successes before choosing the winning model.

D1

positive numeric vector with values between 0 and 1 specifying the contribution of acetate M+1. If NA it is estimated.

D2

positive numeric vector with values between 0 and 1 specifying the contribution of acetate M+2. If NA it is estimated.

P

overdispersion parameter. If NA it is estimated (quasi-multinomial distribution). If set to 0, no overdispersion is assumed (multinomial distribution).

startpoints

positive integer specifying the number of starting points for each parameter to be estimated.

Value

De novo-synthesis and elongation analysis results.

Author(s)

M Isabel Alcoriza-Balaguer <maribel_alcoriza@iislafe.es>


Example fadata list.

Description

Example fadata list.

Usage

data("examplefadata")

Format

A list with 4 elements.

metadata

data frame with metadata information for samples.

fattyacids

data frame with compound name and label for each isotopologue (intensities df).

IS

data frame with IS intensities for each sample.

intensities

data frame with isotopologue intensities for each sample.

Examples

data(examplefadata)

External normalization using additional measures (i.e. protein levels).

Description

External normalization using additional measures (i.e. protein levels).

Usage

externalNormalization(fadata, externalnormalization, verbose = TRUE)

Arguments

fadata

fadata list.

externalnormalization

column names of metadata data frame used to define external measures.

verbose

print information messages.

Value

normalised fadata by external measures.

Author(s)

M Isabel Alcoriza-Balaguer <maribel_alcoriza@iislafe.es>


Fatty Acids database.

Description

Fatty Acids database.

Usage

data("fattyacidsdb")

Format

A data frame with 35 observations on the following 3 variables.

formula

a character vector.

total

a character vector. Number of carbons and double bounds.

Mass

a numeric vector.

Examples

data(fattyacidsdb)

Fit FA isotope distribution with non-linear regression and calculate the sum of squared estimate of errors.

Description

Fit FA isotope distribution with non-linear regression and calculate the sum of squared estimate of errors.

Usage

fitSSE(formula, startpars, datanls, control, limitPhi = 0.1)

Arguments

formula

formula.

startpars

starting points for parameters to estimate.

datanls

data list.

control

nls control.

Value

sum of squared estimate errors.

Author(s)

M Isabel Alcoriza-Balaguer <maribel_alcoriza@iislafe.es>

References

Daniel Padfield and Granville Matheson (2020). nls.multstart: Robust Non-Linear Regression using AIC Scores. R package version 1.2.0. <https://CRAN.R-project.org/package=nls.multstart>


Get formula and neutral mass for annotated compounds

Description

Get formula and neutral mass for annotated compounds.

Usage

getFormula(df, dbs)

Arguments

df

data frame with the input results

dbs

list of data bases required for annotation. By default, dbs contains the required data frames based on the default fragmentation rules. If these rules are modified, dbs may need to be supplied. See createLipidDB and assignDB.

Value

Data frame

Author(s)

M Isabel Alcoriza-Balaguer <maialba@alumni.uv.es>

References

M Isabel Alcoriza-Balaguer (2021). LipidMS: Lipid Annotation for LC-MS/MS DDA or DIA Data. R package version 3.0.1. <https://CRAN.R-project.org/package=LipidMS>


Obtain the final results table from synthesis, elongation and desaturation analysis.

Description

Obtain the final results table from synthesis, elongation and desaturation analysis.

Usage

getResultsTable(fadata, parameters = FAMetA::parameters)

Arguments

fadata

fadata list.

parameters

parameters to be estimated for each fatty acid. It can be modified to change them or to add new fatty acids.

Value

results data frame.

Author(s)

M Isabel Alcoriza-Balaguer <maribel_alcoriza@iislafe.es>


Obtain a summary results table.

Description

Obtain a summary results table containing means and standard deviation for each relevant parameter for each fatty acids by sample groups.

Usage

getSummaryTable(fadata, resultstable, parameters = FAMetA::parameters)

Arguments

fadata

fadata list.

resultstable

results data frame obtained with getResultsTable.

parameters

parameters to be estimated for each fatty acid. It can be modified to change them or to add new fatty acids.

Value

summary data frame.

Author(s)

M Isabel Alcoriza-Balaguer <maribel_alcoriza@iislafe.es>


generate starting points grid for elongation analysis.

Description

generate starting points grid for elongation analysis.

Usage

gridElong(S16 = NA, E1 = NA, E2 = NA, E3 = NA, E4 = NA, E5 = NA, startpoints)

Arguments

S16

fraction of newly synthesized C16 FA. If NA it is included in the starting points grid.

E1

fraction of elongated C18 FA from C16. If NA it is included in the starting points grid.

E2

fraction of elongated C20 FA from C18. If NA it is included in the starting points grid.

E3

fraction of elongated C22 FA from C20. If NA it is included in the starting points grid.

E4

fraction of elongated C24 FA from C22. If NA it is included in the starting points grid.

E5

fraction of elongated C26 FA from C124. If NA it is included in the starting points grid.

startpoints

positive integer specifying the number of starting points for each parameter to be estimated.

Value

Starting points grid for elongation analysis.

Author(s)

M Isabel Alcoriza-Balaguer <maribel_alcoriza@iislafe.es>


generate starting points grid for synthesis analysis.

Description

generate starting points grid for synthesis analysis.

Usage

gridSynth(D1 = NA, D2 = NA, P = NA, S = NA, M, startpoints)

Arguments

D1

positive numeric between 0 and 1 specifying the contribution of acetate M+1. If NA it is included in the starting points grid.

D2

positive numeric between 0 and 1 specifying the contribution of acetate M+2. If NA it is included in the starting points grid.

P

overdispersion parameter. If NA, it is included in the starting points grid.

S

fraction of newly synthesized C16 FA. If NA it is included in the starting points grid.

M

total number of carbons for the FA.

startpoints

positive integer specifying the number of starting points for each parameter to be estimated.

Value

Starting points grid for synthesis analysis.

Author(s)

M Isabel Alcoriza-Balaguer <maribel_alcoriza@iislafe.es>


Plot results on a heatmap.

Description

Plot results on a heatmap.

Usage

heatmapResults(toPlot, cols, scale = "none", breaks, nacolor = "grey")

Arguments

toPlot

data frame with data to be plotted.

cols

colors for the side bar (by group).

scale

"none", "row" or "column".

breaks

numeric vector with breaks for colouring. Optional.

nacolor

color for NA values. Grey by default.

Value

heatmap.

Author(s)

M Isabel Alcoriza-Balaguer <maribel_alcoriza@iislafe.es>


Extract FA data from an annotated msbatch.

Description

Extract FA data from an annotated msbatch.

Usage

msbatch2fadata(msbatch, faid)

Arguments

msbatch

annotated msbatch.

faid

data frame with two columns (ID and Compound) specifying FA ids and FA names. FA names must be unique and omega series must be indicated (i.e. FA(20:4)n3, FA(24:1)n9, FA(16:0)). Unknown FA series can be named as nx, ny, nz to differentiate between isomers.

Value

fadata.

Author(s)

M Isabel Alcoriza-Balaguer <maribel_alcoriza@iislafe.es>


mz match withing a vector of mz values

Description

This function searches marches between a given mz and a vector of mz values with certain mass tolerance and returns the index of the matched values. It is used by identification functions to find candidates of each class of lipid based on full MS information.

Usage

mzMatch(mz, mzvector, ppm)

Arguments

mz

mz value to be matched

mzvector

vector of mz values

ppm

mass error tolerance

Value

Numeric vector indicating the index of matched mz values and ppms for each one of those matches (match1, ppm1, match2, ppm2, etc.)

Author(s)

M Isabel Alcoriza-Balaguer <maialba@alumni.uv.es>

References

M Isabel Alcoriza-Balaguer (2021). LipidMS: Lipid Annotation for LC-MS/MS DDA or DIA Data. R package version 3.0.1. <https://CRAN.R-project.org/package=LipidMS>


Data normalization using internal stardards.

Description

Data normalization using internal stardards.

Usage

normalizeIS(fadata, verbose = TRUE)

Arguments

fadata

fadata list.

verbose

print information messages.

Value

normalised fadata by IS.

Author(s)

M Isabel Alcoriza-Balaguer <maribel_alcoriza@iislafe.es>


Parameters for FA metabolic analysis.

Description

Parameters for FA metabolic analysis.

Usage

data("parameters")

Format

A data frame with 167 observations on the following 8 variables.

FattyAcid

a character vector.

M

integer vector. Number of carbons.

S16

De novo synthesis. If equal to 1 it is estimated.

E1

a numeric vector. If equal to 1 it is estimated.

E2

a numeric vector. If equal to 1 it is estimated.

E3

a numeric vector. If equal to 1 it is estimated.

E4

a numeric vector. If equal to 1 it is estimated.

E5

a numeric vector. If equal to 1 it is estimated.

Examples

data(paramters)

Plot observed and predicted isotope distributions.

Description

Plot observed and predicted isotope distributions.

Usage

plotDistributions(results, groups, title = "")

Arguments

results

results.

groups

character vector specifying sample groups.

title

title.

Value

plot.

Author(s)

M Isabel Alcoriza-Balaguer <maribel_alcoriza@iislafe.es>


Plot FA EICs

Description

Plot FA EICs

Usage

plotFA(msbatch, dmz, verbose = TRUE)

Arguments

msbatch

annotated msbatch.

dmz

mz tolerance in ppm for EIC extraction.

verbose

print information messages.

Value

annotated msbatch with saved plots.

Author(s)

M Isabel Alcoriza-Balaguer <maribel_alcoriza@iislafe.es>

Examples

## Not run: 
msbatch <- annotateFA(msbatch, dmz = 5)

plots <- plotFA(msbatch, dmz = 10)

pdf("FAs.pdf")
for (p in 1:length(plots)){
  print(plots[[p]])
}
dev.off()

## End(Not run)


Plot observed and predicted isotope distributions from the results obtained.

Description

Plot observed and predicted isotope distributions from the results obtained.

Usage

plotResults(results, groups, fas)

Arguments

results

results.

groups

character vector specifying sample groups.

fas

character vector specifying the FAs to be plotted.

Value

plot.

Author(s)

M Isabel Alcoriza-Balaguer <maribel_alcoriza@iislafe.es>


read FA data from a csv file.

Description

First rows must contain metadata information such as sample groups (row named sampletype) and any other extra information like protein levels for external normalization. Then, the following row must contain a Compound and Label columns followed by all sample names. FA names must be unique and omega series must be indicated (i.e. FA(20:4)n3, FA(24:1)n9, FA(16:0)). Unknown FA series can be named as nx, ny, nz to differentiate between isomers. Labels must be specified with integer numbers for 0 to maximum number of carbons.

Usage

readfadatafile(file, sep = ",", dec = ".")

Arguments

file

csv file name.

sep

column delimiter.

dec

character used for decimal points.

Details

read FA data from a csv file.

Value

fadata.

Author(s)

M Isabel Alcoriza-Balaguer <maribel_alcoriza@iislafe.es>

Examples

## Not run: 
fadata <- readfadatafile("externafadata.csv", sep=",", dec=".")

## End(Not run)


Remove incorrect FA annotations

Description

Remove incorrect FA annotations

Usage

removeFA(msbatch, ids)

Arguments

msbatch

annotated msbatch.

ids

integer vector specifying FA ids to be removed.

Value

annotated msbatch.

Author(s)

M Isabel Alcoriza-Balaguer <maribel_alcoriza@iislafe.es>


run the elongation analysis.

Description

run the elongation analysis.

Usage

runElongationAnalysis(
  fa,
  M,
  D1,
  D2,
  P,
  S16,
  E1,
  E2,
  E3,
  E4,
  E5,
  R2Thr = 0.9,
  maxiter = 10000,
  maxconvergence = 100,
  startpoints = 5,
  D2Thr = D2Thr
)

Arguments

fa

data frame with isotope intensities for a FA. First two columns correspond to Compound and Label information.

M

total number of carbons for the FA.

D1

positive numeric between 0 and 1 specifying the contribution of acetate M+1. Estimated with synthesisAnalysis.

D2

positive numeric between 0 and 1 specifying the contribution of acetate M+2. Estimated with synthesisAnalysis.

P

overdispersion parameter. Estimated with synthesisAnalysis.

S16

fraction of newly synthesized C16 FA. If NA it is estimated. It is set to 0 for n3 and n6 FA series.

E1

fraction of elongated C18 FA from C16. If NA it is estimated. It is set to 0 for n3 and n6 FA series.

E2

fraction of elongated C20 FA from C18. If NA it is estimated.

E3

fraction of elongated C22 FA from C20. If NA it is estimated.

E4

fraction of elongated C24 FA from C22. If NA it is estimated.

E5

fraction of elongated C26 FA from C24. If NA it is estimated.

R2Thr

positive numeric between 0 and 1 specifying the minimum R2 allowed for fits.

maxiter

parameter passed to nls.control. Positive integer specifying the maximum number of iterations allowed.

maxconvergence

positive integer specifying the maximum number of successes before choosing the winning model.

startpoints

positive integer specifying the number of starting points for each parameter to be estimated.

D2Thr

minimum D2 value allowed to perform the elongation analysis.

Value

Elongation and importation analysis results.

Author(s)

M Isabel Alcoriza-Balaguer <maribel_alcoriza@iislafe.es>


run synthesis analysis.

Description

run synthesis analysis.

Usage

runSynthesisAnalysis(
  fadata,
  toDo,
  R2Thr = R2Thr,
  maxiter = maxiter,
  maxconvergence = maxconvergence,
  D1 = D1,
  D2 = D2,
  P = P,
  startpoints = startpoints,
  parameters = FAMetA::parameters,
  verbose = TRUE
)

Arguments

fadata

fadata containing synthesis results.

toDo

fatty acids to analyse.

R2Thr

positive numeric between 0 and 1 specifying the minimum R2 allowed for fits.

maxiter

parameter passed to nls.control. Positive integer specifying the maximum number of iterations allowed.

maxconvergence

positive integer specifying the maximum number of successes before choosing the winning model.

D1

positive numeric vector with values between 0 and 1 specifying the contribution of acetate M+1. If NA it is estimated.

D2

positive numeric vector with values between 0 and 1 specifying the contribution of acetate M+2. If NA it is estimated.

P

overdispersion parameter. If NA it is estimated (quasi-multinomial distribution). If set to 0, no overdispersion is assumed (multinomial distribution).

startpoints

positive integer specifying the number of starting points for each parameter to be estimated.

parameters

parameters to be estimated for each fatty acid. It can be modified to change them or to add new fatty acids (adding new rows).

verbose

print information messages.

Value

De novo-synthesis analysis results.

Author(s)

M Isabel Alcoriza-Balaguer <maribel_alcoriza@iislafe.es>


Search FA isotopes

Description

Search FA isotopes

Usage

searchFAisotopes(msbatch, dmz = 5, coelCutoff = 0.7)

Arguments

msbatch

annotated msbatch.

dmz

mz tolerance in ppm.

coelCutoff

coelution score threshold between parent and isotope peaks.

Value

fadata list.

Author(s)

M Isabel Alcoriza-Balaguer <maribel_alcoriza@iislafe.es>

Examples

## Not run: 
fadata <- searchFAisotopes(msbatch, dmz = 10, coelCutoff = 0.4)

## End(Not run)


Search internal stardards.

Description

Search internal stardards.

Usage

searchIS(msbatch, mz, rt, minRT, maxRT, dmz = 10)

Arguments

msbatch

annotated msbatch.

mz

numeric vector specifying IS mz.

rt

numeric vector specifying IS rt.

minRT

numeric vector specifying lower limits for IS rt.

maxRT

numeric vector specifying upper limits for IS rt.

dmz

mz tolerance in ppm.

Value

annotated msbatch.

Author(s)

M Isabel Alcoriza-Balaguer <maribel_alcoriza@iislafe.es>


Toy example fadata list.

Description

Toy example fadata list.

Usage

data("ssexamplefadata")

Format

A list with 4 elements.

metadata

data frame with metadata information for samples.

fattyacids

data frame with compound name and label for each isotopologue (intensities df).

IS

data frame with IS intensities for each sample.

intensities

data frame with isotopologue intensities for each sample.

Examples

data(ssexamplefadata)

Obtain result tables and heatmaps that help interpreting your results.

Description

Obtain result tables and heatmaps that help interpreting your results.

Usage

summarizeResults(fadata, controlgroup = NA, parameters = FAMetA::parameters)

Arguments

fadata

fadata containing synthesis, elongation and desaturation results.

controlgroup

name of the control group to compare the results.

parameters

parameters to be estimated for each fatty acid. It can be modified to change them or to add new fatty acids.

Value

fadata list with a results element which contains: results data frame (results for the main parameters for each fatty acid and sample), summary data frame (mean and sd by sample groups for each parameter and fatty acids from the results table), different heatmaps representing pool size and results (values represented are also saved in data frames) and tables summarizing all parameters values for synthesis and elongation (S16, E1, E2, E3, E4 and E5).

Author(s)

M Isabel Alcoriza-Balaguer <maribel_alcoriza@iislafe.es>

Examples


ssdata <- dataCorrection(ssexamplefadata, blankgroup="Blank")
ssdata <- synthesisAnalysis(ssdata, R2Thr = 0.95, maxiter = 1e3,
maxconvergence = 100, startpoints = 5)
ssdata <- elongationAnalysis(ssdata, R2Thr = 0.95, maxiter = 1e4,
maxconvergence=100, startpoints = 5, D2Thr = 0.1)
ssdata <- desaturationAnalysis(ssdata, SEThr = 0.05)
ssdata <- summarizeResults(ssdata)


## Not run: 
fadata <- dataCorrection(examplefadata, blankgroup = "Blank")
fadata <- synthesisAnalysis(fadata, R2Thr = 0.95, maxiter = 1e3,
maxconvergence = 100, startpoints = 5)
fadata <- elongationAnalysis(fadata, R2Thr = 0.95, maxiter = 1e4,
maxconvergence=100, startpoints = 5, D2Thr = 0.1)
fadata <- desaturationAnalysis(fadata, SEThr = 0.05)
fadata <- summarizeResults(fadata, controlgroup = "Control13Cglc")

## End(Not run)


De novo synthesis analysis of fatty acids until 16 carbons.

Description

De novo synthesis analysis of fatty acids until 16 carbons.

Usage

synthesisAnalysis(
  fadata,
  R2Thr = 0.98,
  maxiter = 1000,
  maxconvergence = 100,
  D1 = NA,
  D2 = NA,
  P = NA,
  startpoints = 5,
  parameters = FAMetA::parameters,
  propagateD = TRUE,
  verbose = TRUE
)

Arguments

fadata

fadata obtained from the msbatch with searchFAisotopes function or read from csv file with readfadatafile function.

R2Thr

positive numeric between 0 and 1 specifying the minimum R2 allowed for fits.

maxiter

parameter passed to nls.control. Positive integer specifying the maximum number of iterations allowed.

maxconvergence

positive integer specifying the maximum number of successes before choosing the winning model.

D1

positive numeric between 0 and 1 specifying the contribution of acetate M+1. If NA it is estimated.

D2

positive numeric between 0 and 1 specifying the contribution of acetate M+2. If NA it is estimated.

P

overdispersion parameter. If NA it is estimated (quasi-multinomial distribution). If set to 0, no overdispersion is assumed (multinomial distribution).

startpoints

positive integer specifying the number of starting points for each parameter to be estimated.

parameters

parameters to be estimated for each fatty acid. It can be modified to change them or to add new fatty acids.

propagateD

logical. If TRUE, unsaturated fatty acids use estimated D0, D1,D2 and P values for saturated fatty acids (14:0 for FA shorter than 16C and 16:0 for FA with 16C.).

verbose

print information messages.

Details

Synthesis analysis will model FA data for FA up to 16 carbons to estimate 13C-tracer contribution to the acetyl-CoA pool for FA synthesis (D) and the FA fraction that has been synthesized de novo. D0, D1 and D2 represent the contribution of M+0, M+1 and M+2 acetate, respectively, and P (phi) is the overdispersion parameter of the quasi-multinomial distribution. D0, D1, D2 can also be fixed if they are known. This is particularly useful in case inhibitors have been used as they could reduce S below the confidence interval and thus, S and D parameters could be misestimated.

Value

fadata list. Synthesis analysis results will be saved at the synthesis element of the fa list.

Author(s)

M Isabel Alcoriza-Balaguer <maribel_alcoriza@iislafe.es>

Examples


ssdata <- dataCorrection(ssexamplefadata, blankgroup="Blank")
ssdata <- synthesisAnalysis(ssdata, R2Thr = 0.95, maxiter = 1e3,
maxconvergence = 100, startpoints = 5)


## Not run: 
fadata <- dataCorrection(examplefadata, blankgroup = "Blank")
fadata <- synthesisAnalysis(fadata, R2Thr = 0.95, maxiter = 1e3,
maxconvergence = 100, startpoints = 5)

# If inhibitors have been used, make sure D2 has not been underestimated. If so,
# D2 could be set as the one calculated for 13-Glc Control samples to improve
# the results:

# D2 <- fadata$synthesis$results$D2[fadata$synthesis$results$FA == "FA(16:0)"]
# fadata$synthesis$results$Group[fadata$synthesis$results$FA == "FA(16:0)"]

# D2[4:12] <- rep(mean(D2[1:3]))

# relaunch synthesis analysis fixing D2
# fadata <- synthesisAnalysis(fadata, R2Thr = 0.95, maxiter = 1e3,
#                             maxconvergence = 100, startpoints = 5, D2 = D2)

## End(Not run)


calculate FA isotope distribution for newly synthesized FAs using the quasi multinomial distribution.

Description

calculate FA isotope distribution for newly synthesized FAs using the quasi multinomial distribution.

Usage

synthesisqmult(D1, D2, P, S, M, vcomb)

Arguments

D1

tracer contribution to M+1 acetate pool.

D2

tracer contribution to M+2 acetate pool.

P

overdispersion parameter. If different to 0, quasi-multinomial distribution is obtained, while if set to 0, it is simplified to a multinomial distribution.

S

fraction of newly synthesized FA.

M

total number of carbons for the FA.

vcomb

list of acetate combinations obtained with combAcetate function.

Value

numeric vector with the FA isotope distribution.

Author(s)

M Isabel Alcoriza-Balaguer <maribel_alcoriza@iislafe.es>