upweightSummit {csaw} | R Documentation

## Upweight summits

### Description

Upweight the highest-abudance window(s) in a cluster.

### Usage

    upweightSummit(ids, summits)

### Arguments

`ids` | an integer vector or factor of cluster IDs
`summits` | a logical vector indicating whether each window is a summit, or an integer vector containing the indices of summit windows

### Details

This function computes weights for each window in a cluster, where the highest-abundance windows are upweighted. These weights are intended for use in `combineTests`, such that the summits of a cluster have a greater influence on the combined p-value. This is more graduated than simply using the summits alone, as potential DB between summits can still be detected. Summits can be obtained through `findMaxima` or by running `getBestTest` with `by.pval=FALSE`.

The exact value of the weight is arbitrary. Greater weight represents a stronger belief that DB occurs at the most abundant window. Here, the weighting scheme is designed such that the maximum Simes correction is not more than twice that without weighting. It will also be no more than twice that from applying Simes' method on the summits alone. This (restrained) conservativeness is an acceptable cost for considering DB events elsewhere in the cluster, while still focusing on the most abundant site.

### Value

A numeric vector of weights, where the highest-abundance window in each cluster is assigned a greater weight. Any windows with `NA` values for `ids` or `summits` will have a weight of zero.

### Author(s)

Aaron Lun

### References

Benjamini Y and Hochberg Y (1997). Multiple hypotheses testing with weights. Scand. J. Stat. 24, 407-418.

### See Also

`combineTests`, `findMaxima`, `getBestTest`

### Examples

    nwin <- 20
    set.seed(20)
    ids <- sample(5, nwin, replace=TRUE)
    summits <- sample(5, nwin, replace=TRUE)==1L
    weights <- upweightSummit(ids, summits)

    # Checking that the summit is upweighted in each cluster.
    split(data.frame(summits, weights), ids)

[Package csaw version 1.14.1 Index]