p.adjust-methods | R Documentation |
Given an AssocTestResultRanges
object,
this method adds a metadata column with adjusted p-values.
## S4 method for signature 'AssocTestResultRanges'
p.adjust(p, method=p.adjust.methods, n=length(p))
p |
object of class |
method |
correction method (see |
n |
parameter available for consistency with standard
|
This function is a wrapper around the standard
p.adjust
function from the
stats package. It takes the
p.value
metadata column from the
AssocTestResultRanges
object p
, applies
the multiple testing correction method specified as method
argument. The method returns a copy of p
with an additional
metadata column p.value.adj
that contains the adjusted
p-values. If p
already contained a metadata column
p.value.adj
, this column is overwritten with the new adjusted
p-values.
If p
also contains a metadata column p.value.resampled
,
multiple testing correction is also applied to resampled p-values.
The resulting adjusted p-values are placed in the metadata column
p.value.resampled.adj
.
Note that, for consistency with the standard
p.adjust
function, the default
correction method is “holm”.
an AssocTestResultRanges
object (see details above)
Ulrich Bodenhofer
https://github.com/UBod/podkat
AssocTestResultRanges
,
p.adjust
## load genome description
data(hgA)
## partition genome into overlapping windows
windows <- partitionRegions(hgA)
## load genotype data from VCF file
vcfFile <- system.file("examples/example1.vcf.gz", package="podkat")
Z <- readGenotypeMatrix(vcfFile)
## read phenotype data from CSV file (continous trait + covariates)
phenoFile <- system.file("examples/example1lin.csv", package="podkat")
pheno <-read.table(phenoFile, header=TRUE, sep=",")
## train null model with all covariates in data frame 'pheno'
nm.lin <- nullModel(y ~ ., pheno)
## perform association test for multiple regions
res <- assocTest(Z, nm.lin, windows)
print(res)
## perform multiple testing correction
res.adj <- p.adjust(res, method="BH")
print(res.adj)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.