Description Usage Arguments Value Examples
Fit linear models and compute ANOVA p-values
1 2 3 4 5 6 7 8 9 | affiXcanBs(
exprMatrix,
assay,
regionAssoc,
pca,
cov = NULL,
BPPARAM = bpparam(),
trainingSamples
)
|
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 |
Optional; a data.frame with covariates values for the population structure where the columns are the PCs and the rows are the individual IDs; default is NULL |
BPPARAM |
A BiocParallelParam object. Default is bpparam(). For details on BiocParallelParam virtual base class see browseVignettes("BiocParallel") |
trainingSamples |
A vector of strings. The identifiers (e.g. row names of MultiAssayExperiment objects from tbaPaths) of the samples that have to be considered in the training phase, and not used for the cross-validation |
A list containing lists named as the EXPRESSED_REGIONS found in the param regionAssoc. Each of these lists contain 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()
p.val: The uncorrected anova p-value of the model
r.sq: The coefficient of determination between the real total expression values and the imputed GReX, retrived from summary(model)$r.squared
corrected.p.val: The p-value of the model, corrected for multiple testing with benjamini-hochberg procedure
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | if (interactive()) {
data(exprMatrix)
data(trainingCovariates)
data(regionAssoc)
tbaPaths <- system.file("extdata","training.tba.toydata.rds",
package="AffiXcan")
regionsCount <- overlookRegions(tbaPaths)
assay <- "values"
sampleNames <- colnames(exprMatrix)
nSamples <- length(sampleNames)
sampGroups <- subsetKFold(k=5, n=nSamples)
for (i in seq(length(sampGroups))) {
sampGroups[[i]] <- colnames(exprMatrix)[sampGroups[[i]]]
}
testingSamples <- sampGroups[[1]]
trainingSamples <- sampleNames[!sampleNames %in% testingSamples]
pca <- affiXcanPca(tbaPaths=tbaPaths, varExplained=80, scale=TRUE,
regionsCount=regionsCount, trainingSamples=trainingSamples)
bs <- affiXcanBs(exprMatrix=exprMatrix, assay=assay, regionAssoc=regionAssoc,
pca=pca, cov=trainingCovariates, trainingSamples=trainingSamples)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.