Package 'FAMetA'

Title: Fatty Acid Metabolic Analysis
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.
Authors: Maribel Alcoriza-Balaguer [aut, cre], Juan Carlos Garcia-Cañaveras [ctb], Agustin Lahoz [ths]
Maintainer: Maribel Alcoriza-Balaguer <[email protected]>
License: GPL (>= 2)
Version: 0.1.6
Built: 2025-03-01 05:22:26 UTC
Source: https://github.com/maialba3/fameta

Help Index


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 <[email protected]>


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 <[email protected]>

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 <[email protected]>


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 <[email protected]>


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 <[email protected]>

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 <[email protected]>

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 <[email protected]>

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")

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 <[email protected]>

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 <[email protected]>

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)

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 <[email protected]>


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)

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 <[email protected]>


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 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 <[email protected]>

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)

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 <[email protected]>

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 <[email protected]>


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 <[email protected]>

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 <[email protected]>


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 <[email protected]>

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 <[email protected]>

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)