AssocTestResultRanges-class: Class 'AssocTestResultRanges'

AssocTestResultRanges-classR Documentation

Class AssocTestResultRanges

Description

S4 class for storing the result of an association test performed on multiple genomic regions

Objects

Objects of this class are created by calling assocTest with a non-empty ranges argument.

Slots

This class extends the class GRanges directly and therefore inherits all its slots and methods. The following slots are defined for AssocTestResultRanges objects additionally:

type:

type of null model on which the association test was based

samples:

character vector with sample names (if available, otherwise empty)

kernel:

kernel that was used for the association test

weights:

weight vector or weighting function that was used; NULL if no weighting was performed

width:

tolerance radius parameter that was used for position-dependent kernels

adj.method:

which method for multiple testing correction has been applied (if any)

vcfParams:

list of parameters that were used for reading genotypes from VCF file

sex:

factor with sex information (if any)

call:

the matched call with which the object was created

Apart from these additional slots, all AssocTestResultRanges objects have particular metadata columns (accessible via mcols or elementMetadata):

n:

number of variants tested in each region; a zero does not necessarily mean that there were no variants in this region, it only means that no variants were used for testing. Variants are omitted from the test if they do not show any variation or if they do not satisfy other filter criteria applied by assocTest. This metadata column is always present.

Q:

test statistic for each region that was tested. This metadata column is always present.

p.value:

p-value of test for each region that was tested. This metadata column is always present.

p.value.adj:

adjusted p-value of test for each region that was tested. This metadata column is only present if multiple testing correction has been applied (see p.adjust).

p.value.resampled:

estimated p-value computed as the relative frequency of p-values of sampled residuals that are at least as significant as the test's p-value in each region. This metadata column is only present if resampling has been applied, i.e. if assocTest has been called with n.resampling greater than zero.

p.value.resampled.adj:

adjusted empirical p-value (see above). This metadata column is only present if resampling and multiple testing correction has been applied.

Methods

c

signature(object="AssocTestResultRanges"): allows for concatenating two or more AssocTestResultRanges objects; this is only meaningful if the different tests have been performed on the same samples, on the same genome, with the same kernel, and with the same VCF reading parameters (in case that the association test has been performed directly on a VCF file). All these conditions are checked and if any of them is not fulfilled, the method quits with an error. Merging association test results that were computed with different sex parameters is possible, but the sex component is omitted and a warning is issued. Note that multiple testing correction (see p.adjust) should not be carried out on parts, but only on the entire set of all tests. That is why c strips off all adjusted p-values.

p.adjust

signature(object="AssocTestResultRanges"): multiple testing correction, see p.adjust.

filterResult

signature(object="AssocTestResultRanges"): apply filtering to p-values or adjusted p-values. For more details, see filterResult.

sort

signature(object="AssocTestResultRanges"): sort AssocTestResultRanges object according to specified sorting criterion. See sort for more details.

plot

signature(object="AssocTestResultRanges"): make a Manhattan plot of the association test result. See plot for more details.

qqplot

signature(object="AssocTestResultRanges"): make quantile-quantile (Q-Q) plot of association test result. See qqplot for more details.

show

signature(object="AssocTestResultRanges"): displays some general information about the result of the association test, such as, the number of samples, the number of regions tested, the number of regions without variants, the average number of variants in the tested regions, the genome, the kernel that was applied, and the type of multiple testing correction (if any).

print

signature(x="AssocTestResultRanges"): allows for displaying more information about the object than show. See print for more details.

Accessors and subsetting

As mentioned above, the AssocTestResultRanges inherits all methods from the GRanges class.

Author(s)

Ulrich Bodenhofer

References

https://github.com/UBod/podkat

See Also

assocTest

Examples

## 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 (continuous 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)

## perform multiple testing correction
res.adj <- p.adjust(res)
print(res.adj)

## show sorted results
as(sort(res.adj), "GRanges")

## show filtered result
print(filterResult(res.adj, cutoff=0.05, filterBy="p.value.adj"))

## make a Manhattan plot
plot(res.adj, which="p.value.adj")

UBod/podkat documentation built on May 5, 2024, 6:37 a.m.