| ras_box_calibrate | R Documentation |
Turns a set of null scan profiles into the threshold that
ras_box_detect needs. Null profiles are obtained by running
the same scan (ras_scan or
ras_scan_external, with the same settings) on the same
genotypes with the phenotype permuted, or with a phenotype simulated
under the null.
ras_box_calibrate(
null_profiles,
alpha = 0.05,
widths = .ras_box_default_widths(),
gamma = 0.5,
length_ratio = 1,
calib = NULL,
edge = c("open", "strict"),
method = c("order", "gumbel")
)
null_profiles |
A list of numeric vectors, or a matrix with one null
profile per row. All profiles should have the length of the profile
that will be analysed, or the length that |
alpha |
Numeric. Target family-wise error rate. Default |
widths |
Integer vector. Window widths in grid points. Default
|
gamma |
Numeric. Exponent of the level factor. Default |
length_ratio |
Numeric. If the profile to be analysed is
|
calib |
Integer vector. Indices of the profiles used to set the
threshold; the remaining profiles, if any, give a held-out error rate
( |
edge |
|
method |
Character. |
level0 is the median of the null profiles' medians. Both thresholds
are always computed and returned (threshold_order,
threshold_gumbel); threshold is the one selected by
method.
An object of class "ras_box_calibration": a list with
level0, threshold, threshold_order,
threshold_gumbel, threshold_scaled, method,
length_ratio, maxT (the maximum score of every null
profile), calib, alpha, gumbel (fitted location and
scale), null_exceed_scaled, fwer_holdout (NA when no
profile was held out), widths, gamma, edge.
ras_box_detect, which consumes the result.
## 60 short synthetic null profiles (a real calibration uses several
## hundred profiles from the actual scan on permuted phenotypes)
set.seed(2)
nulls <- lapply(1:60, function(k) 0.7 + abs(rnorm(200, sd = 0.3)))
cal <- ras_box_calibrate(nulls, alpha = 0.05, calib = 1:40)
cal$threshold
cal$fwer_holdout # error rate on the 20 held-out profiles
y <- nulls[[41]]; y[91:110] <- y[91:110] + 6
ras_box_detect(seq_along(y), y, calibration = cal)$regions
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.