When the ExposomeSet
object is on the study the server, the function ds.exwas
is in charge of performing the ExWAS. As an example let's present a situation where we are interested in associating each exposure with blood_pre
phenotype (e.g outcome) using the sex
as a covariate (e.g. adjusted model). This study would be done as follows
exwas_results <- ds.exwas("blood_pre ~ sex", Set = "exposome_object", family = "gaussian") head(exwas_results$exwas_results)
This previous formula will fit linear models between the exposures and phenotype as follows:
phenotype ~ exposure_1 + covar1 + ... + covarN phenotype ~ exposure_2 + covar1 + ... + covarN phenotype ~ exposure_3 + covar1 + ... + covarN ... phenotype ~ exposure_M + covar1 + ... + covarN
The model is written as a string, where the left side term is the phenotype, and the right term are the covariates (e.g. variables to be adjusted for). In the case of having more covariates proceed as: phenotype ~ cov1 + cov2 + ... + covN
. A crude model is fitted using phenotype ~ 1
.
It's important to note that if the family argument does not match with the nature of the data availalbe in the phenotype
, the ExWAS will fail (Example: family argument should be binomial
for binary outcomes and gaussian
for continuous).
To visualize the results from the ExWAS, the function ds.plotExwas()
can be used. It takes the output of ds.exwas
and creates two different visualizations depending on the argument type
.
ds.plotExwas(exwas_results, type="manhattan")
ds.plotExwas(exwas_results, type="effect")
We can also carry out an 'inverse' ExWAS where exposures are regressed on a given phenotype and some adjusting covariates. In other words, we are estimating an inverse/reverse model as in a traditional ExWAS:
exposure_1 ~ phenotype + covar1 + ... + covarN exposure_2 ~ phenotype + covar1 + ... + covarN exposure_3 ~ phenotype + covar1 + ... + covarN ... exposure_M ~ phenotype + covar1 + ... + covarN
The function to perform this analysis is ds.invExWAS()
. In that case the formula is not used and the models can be fitted by
inverse_exwas_results <- ds.invExWAS("exposome_object", phenotype = "blood_pre", covariables = "sex") head(inverse_exwas_results$exwas_results)
Crude models are obtained by removing the covariables
argument and models adjusted for more than one covariable are fitted by writing covariables = c("covar1", "covar2", ..., "covarN")
.
The same plotting functions can be used with the object returned by the inverse ExWAS analysis.
ds.plotExwas(inverse_exwas_results, "manhattan")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.