chi2: chi2

Description Usage Arguments Details Value Author(s) See Also Examples

Description

The 'chi2' method can be used to optimize the window size for defined regions of interest. It computes chi^2(w) for window sizes w based on the estimates of Lambda and the false-discovery rate.

Usage

1
2
3
4
5
6
chi2(object, winSize, regions, offset, fdr = "lfdr", method,
scaling = les:::scaleNorm, nCores = NULL,  verbose = FALSE, ...)

## S4 method for signature 'Les'
chi2(object, winSize, regions, offset, fdr = "lfdr",
method, scaling = les:::scaleNorm, nCores = NULL,  verbose = FALSE, ...)

Arguments

object

Object of class 'Les' as returned by 'estimate' or a subsequent step.

winSize

Integer vector specifying the window sizes w for which chi^2(w) should be computed. For each value of 'winSize' and each region a computation as for 'estimate' is run. For details please see the 'win' argument in 'estimate'.

regions

Data frame containing the regions of interest. It has to contain the columns 'start', 'end' and 'chr' specifying the start and end position for each region, as well the chromosome if more than one chromosome is present. The structure is related to the 'regions' output of the 'regions' method. If missing the data frame from the 'regions' slot will be used if available. For details please see the 'regions' method.

offset

Integer or vector of integers specifying the offset for the regions given by the 'regions' input argument. If missing the regions will be taken as specified. If present start and end of each regions will be taken as 'start - offset' and 'end + offset'.

fdr

Character string specifying the fdr method to use for chi^2 computation (default: 'lfdr'). Possible values are 'lfdr' for local fdr and 'qval' for q-values. For details see the 'Details' section below and the 'fdrtool' package.

method

Character string specifying the method used for linear regression. It is equivalent to the 'method' argument in the 'estimate' method. If missing the value set in the 'estimate' method will be used.

scaling

Function specifying the scaling of Lambda and fdr (default: les:::scaleNorm). By default both will be scaled to the range [0,1].

nCores

Integer indicating the number of cores to use for computation. This feature requires the 'parallel' package which is only available for certain platforms. The package is used only if 'library(parallel)' has been called manually by the user before and if 'nCores' is an integer unequal NULL specifying the number of cores to use. The value is passed directly to 'mclapply' as argument 'n.cores'. For details and benefits please see the 'Details' section.

verbose

Logical indicating whether the progress of the computation should be printed on screen (default: FALSE).

...

Further arguments passed to subsequent functions.

Details

The 'chi2' method can be used to optimize the window size for defined regions of interest. It computes chi^2(w) for each window size w based on the estimates of false-discovery rate (fdr) and Lambda(w) with a Leave-One-Out Cross Validation (LOOCV). The shape of the chi^2(w) landscape can constrain suitable values for w.

Value

Object of class 'Les' with additionally filled slots: winSize, chi2

Author(s)

Julian Gehring

Maintainer: Julian Gehring <julian.gehring@fdm.uni-freiburg.de>

See Also

Package: les-package fdrtool

Class: Les

Methods and functions: Les estimate threshold regions ci chi2 export plot weighting

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data(spikeInStat)

x <- Les(pos, pval)
x <- estimate(x, 200, weighting=rectangWeight)
x <- threshold(x)
x <- regions(x)

regions <- x["regions"]
winsize <- seq(100, 300, by=20)
x <- chi2(x, winsize, regions, offset=2500)

plot(winsize, x["chi2"], type="b")

Example output

Loading required package: fdrtool

les documentation built on Nov. 8, 2020, 5:17 p.m.