Changelog
Source:NEWS.md
nilHMM 0.3.1
First tagged release of the post-0.3.0 work (the caller-family and pedigree sections below were merged after the v0.3.0 tag while DESCRIPTION still read 0.3.0; they ship in a tagged release for the first time here).
Breeding-design priors computed from the scheme (breaking)
-
design_prior()/design_priors()and their hardcoded lookup table are removed. The design prior is now computed from the breeding scheme:breeding_prior(design)is the public design-prior contract (thecall_gt(prior = )vector and the engine state frequencies),single_locus_expectation(design, f1)propagates genotype frequencies through the backcross/selfing transition matrices for any"BCnSm"design (exact for a non-inbred F1 too), andparse_design()parses the design string. Migration:design_prior(d)→breeding_prior(d). - New map interpolators
bp_to_cm()/cm_to_bp(): one Marey spline shared bycm_to_mb()andbuild_marker_grid().
Caller family renamed to match the paper grid (breaking)
The named callers are now the explicit coordinates of the engine’s (emission × duration) grid, matching the paper’s Fig. 1 / caller table:
-
nnilis now the categoricalgtcaller (gt + geometric), Holland’s original on hard genotype calls. The old count-emission behaviour moved to the newbbnilcaller (count/BetaBinomial + geometric) — the low-coverage count extension. Migration:call_ancestry(counts, caller = "nnil")→caller = "bbnil"; hard-call/GTinputs stay oncaller = "nnil". -
nnil/catigerrequire called genotypes (agcolumn) and no longer threshold read counts. The earlier build silently hard-called raw counts with a 1/3–2/3 allele-fraction cutoff — an incidental behaviour, not part of nNIL (which only ever ingests called genotypes,ncsumaize/nNIL). Hard-calling is now the user’s explicit step:nnil/catigeron read counts errors with a pointer to hard-call first (e.g.call_gt()) or usebbnil/rtiger.googa/atlasare unaffected — GOOGA fraction-thresholding of competitive counts is their defined, explicit behaviour. - New
catigercaller: categoricalgtemission + rigidity duration (thegt-side counterpart ofrtiger). - Removed the
emission = c("count", "gt")override oncall_ancestry()/call_states(). Each grid caller now pins its own emission, so the override is redundant — choose the caller instead. - The no-HMM per-site genotype baseline (the paper’s het-excess “control”) is
call_gt(), a genotype caller — not an ancestry caller. It is deliberately not dispatchable throughcall_ancestry(), keeping the terminology wall between the ancestry mosaic and per-site genotypes:call_gt(prior = "flat")is the maximum-likelihood call,call_gt(prior = "hwe")the HWE MAP (het-excess). A consumer that wants it in an ancestry comparison converts it (to_segments()) itself; the package provides no genotype→mosaic shortcut. -
caller_sweep()renamed its count option"nnil"→"bbnil"(the sweptrrategrid is the count/geometric caller). -
GOOGA transcript callers split into
googaandatlas. The GOOGA source and the Flagel 2019 / Veltsos 2024 methods use a recombination-fraction (geometric) F2 HMM with no rigidity, so the faithful reproduction is nowgooga(gt + geometric). Theatlasname is retained for this work’s transcript caller — the same GOOGA competitive-alignment thresholding decoded with the rigidity duration. Migration: the oldcaller = "atlas"(gt + geometric) is nowcaller = "googa";caller = "atlas"now means gt + rigidity.
Pedigree-aware ancestry calling
- New
call_ancestry(caller = "pedigree", pedigree = ...): a family-coupled caller that couples relatives by loopy belief propagation over the (pedigree × genome) grid (kernelsrc/pedigree_bp.cpp). It shares the engine’s emission axis — read counts give a depth-aware count/BetaBinomial de novo call (missing = zero depth → flat), while a hard-callstate/gcolumn gives the categorical gt path. Requiresdesign; groups byfamilyfrom the pedigree and dispatches per family (likefsfhap). New args:pedigree,ped_format,ped_maxiter/ped_tol/ped_lambda. Benchmark: on a ZEAL-structured simulated cohort (82 founders, ~17 lines/founder, skim depth) the caller reaches parity with the single-chain callers and fills the fully-uncovered marker grid, but does not beatrtiger— the per-marker transmission factor pools siblings only marginally, not over inherited blocks (design/PEDIGREE_HMM.md§2). A block-coherent accuracy gain awaits the phased copy-switch kernel (§18); this is correct/principled infrastructure, not an accuracy improvement. -
refine_ancestry()is now a thin wrapper over the same shared.pedigree_states()kernel for the hard-call refinement use — unchanged behaviour, return shape, andemission = c("gt", "count")modes.
Other changes
-
Viterbi incumbent tie-break for categorical (gt) callers.
decode()now breaks structural ties (missing and uninformative-het positions) in favour of the incumbent state for gt emissions, matching Holland’s hmmlearn nNIL caller. This changesnniloutput at tied positions: on the Zhong et al. nNIL population, mismatches vs Holland’s File S11 drop from 3,152 to 2. Count emissions never tie, sobbnil/rtigerare unchanged. -
refine_ancestry()(pedigree-aware refinement of hard calls) andsimulate_family()(tracked-family simulator) are new since 0.3.0. -
caller_sweep()supports the categoricalnnilcaller alongsidebbnil;nnilrequires only the called genotype columng, not read counts (it warns if counts are present). - The
enginevignette usesbreeding_prior(); the overview and callers vignettes are rewritten around the genotype-vs-ancestry distinction; the README / pkgdown landing page gains the engine schematic; caller names follow a lowercase caller-casing convention in prose; the nilHMM methods paper (in preparation) is added to the citation. - pkgdown reference index fixed: the removed
design_prior/design_priorstopics are replaced bybreeding_prior,single_locus_expectation,parse_designandmap_interpolators, so the site builds and deploys again.
nilHMM 0.3.0
Genotype calling — clean break (breaking)
- Removed the
call_glalias entirely. Usecall_gt. (Consumers must migrate; there is no longer a soft-deprecated fallback.) - Removed the
prior = "breeding"+fdeprecation shim and thefformal.priornow accepts only"flat","hwe"(+af), or a length-3 numeric vectorc(f_REF, f_HET, f_ALT). Build design priors withdesign_prior().
nilHMM 0.2.0
Genotype calling
-
call_gtreplacescall_glas the per-site genotype caller. The old name was tied to the GL emission stage shared with every caller, not to what it does (call a per-site genotype);call_glremains as a soft-deprecated alias. -
call_gt(prior = )is now polymorphic —"flat"(argmax-GL / ML),"hwe"(+af), or a fixedc(f_REF, f_HET, f_ALT)vector (renormalized, covering both design and custom priors). The oldprior = "breeding"+fAPI folds into the numeric-vector path via a deprecation shim (still warns); thefformal is removed. -
design_prior(design)returns the design’s single-locus frequencies as thec(f_REF, f_HET, f_ALT)vectorcall_gt()consumes as itsprior, so the design prior is derived rather than typed (e.g.call_gt(n_ref, n_alt, prior = design_prior("BC2S3"))).
Documentation
-
R CMD checkis clean (Status OK): documentedcall_states()’srtiger_fitargument, fixed “Lost braces” in thefsfhap_*/read_hapmapman pages, and re-attached the.fsfhap_biparental_callroxygen block (was landing on the.FSFHAP_BHF_WINDOWconstant).
nilHMM 0.1.0
First development release: a unified R + Rcpp reimplementation of the nilHMM ancestry-calling family for Near-Isogenic Lines and related backcross / full-sib populations.
Engine
- A single duration-aware 3-state (REF / HET / ALT) HMM with two swappable axes — emission (
emission_count,emission_gt) and duration (duration_geometric,duration_rigidity,duration_hsmm) — plus breeding-design priors (design_priors). - One-verb API
call_ancestry()(and the coordinate-freecall_states()/to_segments()pair) returning a common segment schema (source, donor, name, chr, start_bp, end_bp, state). - Data-agnostic throughout: functions take
(data, params); paths and sample lists stay in pipeline scripts.
Callers
-
nnil— Holland’s nNIL count/genotype caller (BetaBinomial or categorical genotype-error emission). -
rtiger— a Julia-free port of the RTIGER rigidity HMM (EM + Viterbi + border re-placement). -
binhmm— per-bin calling with an anchored 3-state Gaussian-emission HMM (GMM / k-means / rebmix backends available). -
atlas— a GOOGA-style caller for competitive-alignment RNA-seq counts. -
lbimpute— a native port of LB-Impute (Fragoso et al. 2014) for very low-coverage data: coverage-aware emission + distance-dependent transition, bp or cM units;caller_sweep()calibratesrecombdist(exact per value). -
fsfhap— a native port of TASSEL’s FSFHap (Swarts et al. 2014) for full-sib families. Both parent-calling routes (backcross andBiparentalHaplotypeFinder) feed a 5-state Viterbi-training EM imputation + gap-fill. Bit-exact vs TASSEL on backcross and RIL/inbred populations. Cross-family/chromosome parallelism viathreads=(bit-identical to serial); on real TeoNAM it runs 4.9x (single family) to 7.6x (five families) faster than TASSEL, and faster even single-threaded. Seedesign/FSFHAP_PORT.md.
Input / output
- Readers that normalise formats to the observation table:
read_counts(TSV / GATK table / VCFAD),read_vcf_gt,read_hapmap(TASSEL HapMap),read_plink(.bed/.bim/.fam),read_pedigree(FSFHap TSV or PLINK.fam). - Writers:
write_common_schemaandwrite_vcf_impute(LB-Impute-style imputed VCF).
Genotype calling & downstream utilities
-
call_gl— a linkage-free per-site GATK-style genotype-likelihood caller. -
interpolate_genotype— genotype densification onto a target marker grid. -
pairwise_distance+select_independent— LD-based marker thinning (FastIndep port).
Documentation
- Four vignettes: Getting started with nilHMM, The callers, The engine, and Full-sib families with the fsfhap caller.
- A pkgdown site at https://sawers-rellan-labs.github.io/nilhmm/.