makeVariogram {BiSeq} | R Documentation

## Variogram estimator.

### Description

A function which estimates the variogram of the z-scores in the given data frame.

### Usage

    makeVariogram(test.out, make.variogram, sample.clusters, max.dist)

### Arguments

`test.out` | A `data.frame`. Usually the output of `betaRegression`. Must contain columns chr, pos, p.val and cluster.id.
`make.variogram` | A `logical`. Default is `TRUE`.
`sample.clusters` | Can speed up variogram estimation significantly. Default is `NULL`, and all data is used to estimate the variogram. If set to `numeric`, the variogram will be estimated on the basis of the data of randomly selected `sample.clusters` only. Especially useful if there are many clusters.
`max.dist` | Can speed up variogram estimation significantly. The variogram is estimated for distances until this threshold. Default is 500 base pairs, since the variogram usually does not change for distances larger than 100 base pairs, because methylation of CpG sites further away are not correlated anymore. Especially useful if there are large clusters.

### Details

For each CpG site the z-score is determined by `qnorm`(1 - P value). The variogram of the z-scores of locations k and l within one cluster is estimated robustly by

2 \hat{γ}(h) = [median{(Z_{k}-Z_{l})^2: (s_{k}, s_{l}) \in N(h)}] / .455

.

### Value

A list:

`variogram` | A `list` of two: A `matrix`, called `v` with columns `h` and `v`, and a `numeric`, called `h.est`. `v` comprises the data that was used to estimate the variogram. `h.est` comprises the distances seen in the data. If `sample.clusters=NULL`, `h.est` is identical to `v$h`.
`pValsList` | A `list` of data frames. Each data frame corresponds to a CpG cluster and contains same information as `test.out` plus the columns z.score and pos.new (position corresponding to the respective CpG cluster).

### Author(s)

Katja Hebestreit

### References

Yoav Benjamini and Ruth Heller (2007): False Discovery Rates for Spatial Signals. American Statistical Association, 102 (480): 1272-81.

### See Also

`betaRegression`

### Examples

    data(betaResults)

    vario <- makeVariogram(betaResults)

    plot(vario$variogram$v)

[Package BiSeq version 1.24.0 Index]