Description Usage Arguments Details Value Author(s) See Also Examples
This function will run a basic association analysis adjusted for covariates for a given list of metabolites. Depending on the outcome, the function will choose a linear or logistic regression model. It will calculate the associations between outcome and each metabolite, merge with the metadata files, and return an organized table.
1 |
dat |
data frame containing your metabolites and covariates |
biochem |
The biochemical metadata file. Typically this is in the $biochem element of the metabolites list. You can subset this data frame any way you wish, some variables are probably unneeded. Recommend that you subset to only include COMP_ID, BIOCHEMICAL, SUPER_PATHWAY, SUB_PATHWAY. |
outcome |
Outcome for the analysis. Logistic regression must be coded [0,1]; linear regression must be continuous numeric. Function will identify which is which and will provide an error message if you code it wrong. |
compid |
Vector of COMP_IDs used for the models |
covariates |
Optional. Vector of covariate names from the dat data frame. |
normalize |
Logical. Set to TRUE if you haven't already mean-centered and glog transformed your metabolite data. Default is TRUE. |
This function will run simple association models (either linear or logistic regressions). I recommend that you use the metsModels() function which is a wrapper for all sorts of metabolomics models. It will either run metsAssoc() or metsInt() depending on the inputs.
Data frame organizing the associations and p-values for all metabolites.
Brian Carter
normalizeMets
,
metsInt
,
metsModels
,
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | breast_metabolomics <- getMetabolites("breast_metabolomics")
data(survey)
df <- left_join(survey,breast_metabolomics$metabolites,"ID")
covars<- c("AGE_INT","LASTATE")
comp.id <- names(breast_metabolomics$metabolites)[-1]
biochem <- breast_metabolomics$biochem[,c("COMP_ID","BIOCHEMICAL")]
# Linear regression models
out <- metsAssoc(dat=df,
biochem=biochem,
outcome="BMI",
compid=comp.id[1:10],
covariates=covars,
normalize=T) # normalizing data
# Logistic regression models
out <- metsAssoc(dat=df,
biochem=biochem,
outcome="BMIBIN",
compid=comp.id[1:10],
covariates=covars,
normalize=T) # normalizing data
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.