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.
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
Methods and functions:
Lesestimatethresholdregionscichi2exportplotweighting
Examples
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")
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(les)
Loading required package: fdrtool
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/les/chi2.Rd_%03d_medium.png", width=480, height=480)
> ### Name: chi2,Les-method
> ### Title: chi2
> ### Aliases: chi2 chi2-methods chi2,Les-method
> ### Keywords: htest methods
>
> ### ** Examples
>
> 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")
>
>
>
>
>
> dev.off()
null device
1
>