affiXcanBs {AffiXcan}R Documentation

Fit a linear model and compute ANOVA p value

Description

Fit a linear model and compute ANOVA p value

Usage

affiXcanBs(exprMatrix, assay, regionAssoc, pca, cov, BPPARAM = bpparam())

Arguments

exprMatrix

A SummarizedExperiment object containing expression data

assay

A string with the name of the object in SummarizedExperiment::assays(exprMatrix) that contains expression values

regionAssoc

A data.frame with the associations between regulatory regions and expressed genes, and with colnames = c("REGULATORY_REGION", "EXPRESSED_REGION")

pca

A list, which is the returningObject$pca from affiXcanPca()

cov

A data.frame with covariates values for the population structure

BPPARAM

A BiocParallelParam object. Default is bpparam(). For details on BiocParallelParam virtual base class see browseVignettes("BiocParallel")

Value

A list containing lists named as the REGULATORY_REGIONS found in the param regionAssoc that have a correspondent name in the param pca. Each of these lists contains three objects:

coefficients: An object containing the coefficients of the principal components used in the model, completely similar to the "coefficients" from the results of lm()

pval: The uncorrected anova pvalue of the model, retrieved from anova(model, modelReduced, test="F")$'Pr(>F)'[2]

r.sq: The coefficient of determination between the real total expression values and the imputed GReX, retrived from summary(model)$r.squared

correctedP: The p value after the benjamini-hochberg correction for multiple testing, retrived using p.adjust(pvalues, method="BH")

Examples

if (interactive()) {
trainingTbaPaths <- system.file("extdata","training.tba.toydata.rds",
package="AffiXcan")

data(exprMatrix)
data(regionAssoc)
data(trainingCovariates)

assay <- "values"

training <- affiXcanTrain(exprMatrix=exprMatrix, assay=assay,
tbaPaths=trainingTbaPaths, regionAssoc=regionAssoc, cov=trainingCovariates,
varExplained=80, scale=TRUE)

pca <- training$pca 

bs <- affiXcanBs(exprMatrix=exprMatrix, assay=assay, regionAssoc=regionAssoc,
pca=pca, cov=trainingCovariates)
}

[Package AffiXcan version 1.0.0 Index]