Changes in response to the Bioconductor review.
w = N_ij / (n_i + n_j + N_ij), where
n_i, n_j are the unambiguous alleles on the pair's two populations
and N_ij its ambiguous heterozygotes. It previously divided by the
variant's total evidence over all populations and pairs, so carriers of
an unrelated population shrank an i/j split less than its own data
warranted. Two-population results are unchanged (split_diploid() and
every ancestry_split() call with two populations).split_diploid() and split_diploid_multi(): the gla and arm_id
arguments are replaced by shrink = FALSE. shrink = TRUE applies the
same shrinkage toward 1/2 as ancestry_split(); the target is always 1/2,
so a target matrix is no longer needed.ancestry_split(verbose = TRUE) now logs the mode and what it does, the
ancestries detected in the MSP file, the number of ambiguous
heterozygotes split fractionally (dosage mode), the VCF reader used, and
how the alternate alleles were divided among the ancestries.ancestry_split_dosage(gt_matrix, pt_matrix). The VCF/MSP input and ancestry_split() were not affected.
pt_matrix gave wrong results."chr:pos" within "chr:start-end") now allows
several variants per region, which previously gave an error.counts are now per variant, as documented (they were per sample).split_diploid_multi() defaults to the two-population codes
of split_diploid(); read_bed_file() finds the .bim and .fam files
next to the .bed file; ancestry_split_phased() needs out_path only
when write_vcf = TRUE.ancestry_smmat() now requires ancestry_counts and variant_info
together (previously one without the other was silently ignored).ancestry_smmat() works right after installing lantern. SeqVarTools is
needed because GMMAT::SMMAT() reads GDS files with it, but GMMAT only
Suggests it.centromeres_hg38 table.vignettes/. The Getting started vignette now
explains the method's motivation with figures from the LANTERN preprint.citation("lantern") for the preprint (Wang et al. 2026, medRxiv).Each reviewer comment (in italics), the response, and where to find the change (paths relative to the package root; line numbers as of 0.99.1).
README.md:558.vignettes/lantern.Rmd, vignettes/toy-vcf-msp-example.Rmd,
vignettes/split-intuition.Rmd, vignettes/real-data-chr19.Rmd.vignettes/lantern.Rmd:18-97 (introduction and figures in
vignettes/figures/) and vignettes/toy-vcf-msp-example.Rmd:15-155.vignettes/lantern.Rmd:231 (GENE2's variants), :257 (its results)
and :266 (the comparison). All in all, GENE2 is a good example to show
LANTERN's utilitiy, which from the toy_genes.tsv.vignettes/real-data-chr19.Rmd:35
and :67.genes_small paragraph belongs in the next section.
Moved to where genes_small is first used.
See vignettes/real-data-chr19.Rmd:81.tests and
p_col, the raw per-ancestry SMMAT output, and a three-population sketch
(not evaluated, as the cohort has two ancestries).
See vignettes/real-data-chr19.Rmd:183 (all genes), :212 (SKAT-O and
raw output) and :261 (three populations).vignettes/split-intuition.Rmd:90 (table),
:121 and :132 (two populations), :262 and :270 (K populations),
:389 and :396 (shrinkage).cat() calls are not needed. Removed from all vignettes;
results are shown by printing objects, with the explanation in the text.
See vignettes/toy-vcf-msp-example.Rmd (no cat() remains in any
vignette).R/sysdata.rda and R/global_ancestry.R.message(), warning(), stop() should not use paste0().
Removed; pieces are passed as separate arguments, or with toString() /
sprintf() for vectors. See for example R/ancestry_split.R:1031,
:1258 and R/ancestry_smmat.R:35.ancestry_split_dosage() at 320 lines; the longest is now 73 lines, and
four are above 50, mostly argument checks and progress messages. Outputs
were compared bit for bit before and after the refactor. This uncovered
the ancestry_split_dosage() matrix-input bugs listed above.
See the helpers at R/ancestry_split.R:769-815 (VCF and MSP parsing),
:1001-1051 (ancestry codes), :1195-1309 (ancestry_split_dosage())
and R/ancestry_smmat.R:227-322 (ancestry_smmat()), and the regression
tests at tests/testthat/test-ancestry_split.R:1112 and :1128.split_diploid_multi() codes, read_bed_file()
.bim/.fam paths, ancestry_split_phased() out_path, and
shrink = FALSE in split_diploid()/split_diploid_multi()). The
arguments still without defaults are data inputs (file paths, genotype and
ancestry matrices, phenotype table, kinship matrix, formula).
See R/ancestry_split.R:111 (split_diploid()), :188
(split_diploid_multi()), :365 (read_bed_file()) and :1376
(ancestry_split_phased()).ancestry_smmat() inputs before the null model
is fitted). See R/checks.R:10-63 (shared checks),
R/ancestry_smmat.R:227 (ancestry_smmat() inputs) and the tests in
tests/testthat/test-checks.R.for loops. No for loops remain in the R
code: loops over samples, variants and tracts are vectorized, and the
short loops over populations use lapply()/vapply().
See R/ancestry_split.R:431 (MSP parsing), :743 (ancestry per
variant), :827 (variant-to-tract mapping), :1321 (coordinate
matching) and R/ancestry_smmat.R:55 (gene weights).R_ToplevelExec() so it can close its file first.
See src/ancestry.c:10-20 (helpers) and the checks at :66, :113,
:276 (BED reader), :382, :540 and :616..orig files in vignettes/. Removed. The
real-data vignette needs cohort data that cannot be shared, so the
package keeps only its pre-computed .Rmd; its source is kept outside
the package, in the analysis repository. See vignettes/ (four .Rmd
files and figures/ only).ancestry_split() splits a phased VCF into per-ancestry dosages using
RFMix local ancestry, in "haplotype" (phased) or "dosage" (unphased)
mode, for any number of populations. Dosage mode shrinks ambiguous
mixed-ancestry splits toward 1/2, in proportion to the share of the
variant's evidence that is ambiguous. (An earlier development version
shrank toward each chromosome arm's global local ancestry; that target and
the use_gla argument were removed.)write_ancestry_gds() / write_dosage_gds() write SeqArray GDS files.ancestry_smmat() runs ancestry-stratified GMMAT SMMAT gene tests and
Cauchy-combines the per-ancestry p-values (cauchy_combine()).bcftools when it is on PATH, otherwise with
SeqArray. Choose one explicitly with options(lantern.vcf_reader = ...).inst/extdata (simulated; see inst/scripts/make_toy_data.R).