filterResult-methods {podkat} | R Documentation

## Filter Association Test Results According to p-Values or Variants' Contributions

### Description

Given an `AssocTestResultRanges` object, this method filters regions according to p-values or variants' contributions.

### Usage

    ## S4 method for signature 'AssocTestResultRanges'
    filterResult(object, cutoff=0.05,
                 filterBy=c("p.value", "p.value.adj", "p.value.resampled",
                 "p.value.resampled.adj"))
    ## S4 method for signature 'GRanges'
    filterResult(object, cutoff=0.1)
    ## S4 method for signature 'GRangesList'
    filterResult(object, cutoff=0.1)

### Arguments

`object` | object of class `AssocTestResultRanges`, `GRanges`, or `GRangesList`
`cutoff` | threshold
`filterBy` | according to which p-value column filtering should be done; the default is “p.value”.

### Details

If called for an `AssocTestResultRanges` object as first argument, this method strips off all regions the p-values of which exceed the threshold `cutoff`. By default, this filtering is applied to raw p-values (metadata column “p.value”). The `filterBy` argument allows for performing filtering on any of the other three p-value metadata columns (if available, otherwise the method quits with an error).

If called for a `GRanges` object as first argument, this method checks if the first argument `object` has a metadata column named “weight.contribution”. If it exists, it returns a `GRanges` object with the elements of `object` that have a value greater than `cutoff` in the “weight.contribution” metadata column. If this metadata column does not exist, the method quits with an error.

If called for a `GRangesList` object as first argument `object`, this method applies the `filterResult` method for each of its list components and returns a `GRangesList` object. If any of the components of `object` does not have a metadata column named “weight.contribution”, the method quits with an error.

### Value

an object of class `AssocTestResultRanges`, `GRanges`, or `GRangesList` (see details above)

### Author(s)

Ulrich Bodenhofer bodenhofer@bioinf.jku.at

### References

http://www.bioinf.jku.at/software/podkat

### See Also

`AssocTestResultRanges`, `p.adjust`

### 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)
    res.adj <- p.adjust(res, method="BH")

    ## show filtered results
    res.f <- filterResult(res.adj)
    print(res.f)
    res.f <- filterResult(res.adj, filterBy="p.value.adj")
    print(res.f)

    ## compute contributions
    contrib <- weights(res.f, Z, nm.lin)
    contrib

    ## extract most indicative variants
    filterResult(contrib[[1]])
    filterResult(contrib)

[Package podkat version 1.18.0 Index]