Fit the emission once (rtiger: the joint EM; bbnil: per-sample means, or nothing
when fit_means = FALSE) and sweep values, fanning the decodes over
threads. refit controls the accuracy/speed trade (see details).
Usage
caller_sweep(
data,
caller = c("nnil", "bbnil", "rtiger", "lbimpute"),
values,
refit = c("none", "cold"),
design = NULL,
f_1 = NULL,
f_2 = NULL,
threads = 1L,
ref = NULL,
min_reads = 1L,
err = 0.01,
conc = 20,
fit_means = FALSE,
seed = 1L,
postprocess = TRUE,
unit = c("bp", "cm"),
genotypeerr = 0.05,
drp = FALSE,
source = "nilHMM",
donor = NA_character_
)Arguments
- data
Common columns
name, chr, pos, plus the caller's emission input, which differs by caller:bbnil,rtiger,lbimputeconsume the allelic read countsn_ref, n_alt(+ optionaldonor;lbimputewithunit = "cm"also needs acmmap-position column).nnilis categorical: it consumes hard genotype calls in an integergcolumn (0/1/2/3,3= missing) produced bycall_gt(), and does not threshold read counts itself.nnilrequires onlyg–n_ref/n_altare not needed, and if present they are ignored (with a warning).min_readsis likewise a no-op fornnil(a categorical caller has no read depth).
- caller
"rtiger"(sweepsrigidity),"bbnil"or"nnil"(both sweeprrate;bbnil= count/BetaBinomial emission on read counts,nnil= categorical genotype emission on a hard-calledgcolumn), or"lbimpute"(sweepsrecombdist).- values
Parameter grid to sweep.
- refit
"none"(fit once atrefand reuse – exact atref, a close approximation elsewhere; recommended for calibration, as it isolates the segmentation prior) or"cold"(fit each value from scratch – exact per value, the baseline). For bbnil withfit_means = FALSEthe emission isrrate-independent, so both are identical (and exact). This sweep finds the best value; for the exact final calls, refit once withcall_ancestry()at the chosen value. Ignored forlbimpute:recombdisttouches only the transition, never the emission, so every swept value is already EXACT – identical to a coldcall_ancestry(caller = "lbimpute", recombdist = v)(the emission is computed once per run and only the Viterbi transition is re-run over the grid, batched in C++).- design, f_1, f_2
Population priors (a design name, or explicit
f_1,f_2). Forlbimputethese only seed the start distribution (flat if absent).- threads
Fan-out width (
parallel::mclapplyon unix; serial otherwise).- ref
Reference value for the shared fit (default
median(values), rounded for rtiger). Unused forlbimpute(no shared fit).- min_reads
Minimum read depth to keep a marker before decoding (default
1L);0Lkeeps all. No-op forlbimpute, which keeps zero-read markers (flat emission) so the distance transition sees true marker spacing.- err, conc, fit_means
bbnil count-emission parameters (fixed across the grid).
erris also LB-Impute's per-read error (readerr).- seed, postprocess
rtiger fit seed and border post-processing.
- unit, genotypeerr, drp
lbimputeonly:unitis the transition coordinate ("bp"physical /"cm"genetic map; output stays bp),genotypeerrthe emission floor/ceiling,drpthe single-vs-double homozygous-switch cost. Same validation/mismatch warnings ascall_states().- source, donor
Output labels.