Package: lineagefreq 0.6.0

lineagefreq: Lineage Frequency Dynamics from Genomic Surveillance Counts

Models pathogen lineage frequency dynamics from genomic surveillance count data. Provides a unified interface for multinomial logistic regression, hierarchical partial-pooling models, and the Piantham approximation for relative reproduction number estimation. Features include rolling-origin backtesting, standardized forecast scoring, Compositional Adaptive Prediction Sets (CAPS) for horizon-aware calibrated forecasting, lineage collapsing, emergence detection, and sequencing power analysis. Designed for real-time public health surveillance of any variant-resolved pathogen. Methods described in Abousamra, Figgins, and Bedford (2024) <doi:10.1371/journal.pcbi.1012443>.

Authors:Cuiwei Gao [aut, cre, cph]

lineagefreq_0.6.0.tar.gz
lineagefreq_0.6.0.zip(r-4.7)lineagefreq_0.6.0.zip(r-4.6)lineagefreq_0.6.0.zip(r-4.5)
lineagefreq_0.6.0.tgz(r-4.6-any)lineagefreq_0.6.0.tgz(r-4.5-any)
lineagefreq_0.6.0.tar.gz(r-4.7-any)lineagefreq_0.6.0.tar.gz(r-4.6-any)
lineagefreq_0.6.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
lineagefreq/json (API)

# Install 'lineagefreq' in R:
install.packages('lineagefreq', repos = c('https://cuiweig.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/cuiweig/lineagefreq/issues

Pkgdown/docs site:https://cuiweig.github.io

Datasets:

On CRAN:

Conda:

epidemiologyforecastinggenomic-surveillancemultinomial-logistic-regressionsars-cov-2variant-frequency

5.20 score 1 stars 1 scripts 159 downloads 48 exports 31 dependencies

Last updated from:a08fca034b. Checks:7 WARNING, 2 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64WARNING312
source / vignettesOK338
linux-release-x86_64WARNING313
macos-release-arm64WARNING210
macos-oldrel-arm64WARNING169
windows-develWARNING277
windows-releaseWARNING294
windows-oldrelWARNING264
wasm-releaseOK133

Exports:adaptive_designalert_thresholdas_lfq_dataaugment.lfq_fitautoplotbacktestcalibratecalibrate_jointcaps_forecastcollapse_lineagescompare_modelsconformal_forecastconformal_forecast_jointdetection_horizonevaluate_capsevaluate_prospectivefilter_sparsefit_dms_priorfit_modelfitness_decompositionforecastglance.lfq_fitgrowth_advantageimmune_landscapeis_lfq_datalfq_advantagelfq_datalfq_engineslfq_fitlfq_forecastlfq_scorelfq_stan_availablelfq_summarylfq_versionplot_backtestread_lineage_countsrecalibrateregister_enginescore_forecastsselective_pressuresequencing_powersimulate_dynamicssummarize_emergingsurveillance_dashboardsurveillance_valuetidy.fitness_decompositiontidy.lfq_fitunregister_engine

Dependencies:clicpp11dplyrfarvergenericsggplot2gluegtableisobandlabelinglifecyclemagrittrMASSnumDerivpillarpkgconfigpurrrR6RColorBrewerrlangS7scalesstringistringrtibbletidyrtidyselectutf8vctrsviridisLitewithr

Validation Report
Overview | 1. Forecast accuracy benchmark | Results | Comparison with published benchmarks | 2. Calibration diagnostics | Key finding | Recalibration | Conformal prediction | 3. Sequential detection | Limitation | 4. Fitness decomposition | 5. Multi-pathogen applicability | References

Last update: 2026-04-12
Started: 2026-04-12

Information-Theoretic Surveillance Optimization
The resource allocation problem | Expected Value of Information | Adaptive allocation via Thompson sampling | Detection horizon | Sequential detection with controlled false alarms | Surveillance dashboard | Comparison with existing approaches | References

Last update: 2026-04-12
Started: 2026-04-12

Immune-Aware Fitness Estimation
The confounding of transmissibility and immune escape | Constructing the immunity landscape | Fitness decomposition | DMS-informed early detection | Selective pressure as an early warning signal | Practical considerations | References

Last update: 2026-04-12
Started: 2026-04-12

Prediction Calibration and Conformal Inference
Why calibration matters | PIT diagnostics on real CDC data | Recalibration | Conformal prediction intervals | Adaptive conformal inference | Proper scoring rules | References

Last update: 2026-04-12
Started: 2026-04-12

Analyzing real CDC surveillance data
Overview | Load data | Collapse rare lineages | Fit MLR model | Growth advantages | Frequency trajectories | Forecast | Emergence detection | Sequencing power | Session info

Last update: 2026-03-27
Started: 2026-03-27

Comparing modeling engines
Overview | Setup | Engine 1: MLR | Engine 2: Piantham | Comparing fit statistics | Backtesting | Scoring | Model ranking | Visualization | When to use which engine | Hierarchical MLR

Last update: 2026-03-27
Started: 2026-03-27

Getting started with lineagefreq
Overview | Preparing data | Fitting a model | Extracting growth advantages | Visualizing the fit | Forecasting | Detecting emerging lineages | Next steps

Last update: 2026-03-27
Started: 2026-03-27

Surveillance workflow
Overview | Step 1: Load and prepare data | Step 2: Collapse rare lineages | Step 3: Fit model | Step 4: Growth advantages | Step 5: Identify emerging lineages | Step 6: Forecast | Step 7: Assess sequencing needs | Step 8: Extract tidy results | Summary

Last update: 2026-03-27
Started: 2026-03-27

Readme and manuals

Help Manual

Help pageTopics
Adaptive sequencing allocation via Thompson samplingadaptive_design
Sequential detection of emerging variantsalert_threshold
Coerce to lfq_dataas_lfq_data as_lfq_data.data.frame as_lfq_data.lfq_data
Convert lfq_data to long-format tibbleas.data.frame.lfq_data
Augment data with fitted values from an lfq_fit objectaugment.lfq_fit
Plot lineage frequency model resultsautoplot.lfq_fit
Plot a lineage frequency forecastautoplot.lfq_forecast
Rolling-origin backtesting of lineage frequency modelsbacktest
Calibration diagnostics for lineage frequency forecastscalibrate calibrate.lfq_backtest calibrate.lfq_forecast
Joint Calibration Diagnosticscalibrate_joint
CDC SARS-CoV-2 variant proportions: BA.1 to BA.2 transition (US, 2022)cdc_ba2_transition
CDC SARS-CoV-2 variant proportions: JN.1 emergence (US, 2023-2024)cdc_sarscov2_jn1
Extract coefficients from a lineage frequency modelcoef.lfq_fit
Collapse rare lineages into an aggregate groupcollapse_lineages
Compare model engines from backtest scorescompare_models
Conformal prediction intervals for lineage frequenciesconformal_forecast
Joint Conformal Prediction on the Simplexconformal_forecast_joint
Detection horizon for an emerging variantdetection_horizon
Pseudo-Prospective Evaluation of Conformal Predictionevaluate_prospective
Filter sparse time points and lineagesfilter_sparse
Fit model with Deep Mutational Scanning priorsfit_dms_prior
Fit a lineage frequency modelfit_model
Decompose variant fitness into transmissibility and immune escapefitness_decomposition
Forecast lineage frequencies (generic)forecast
Forecast lineage frequenciesforecast.lfq_fit
Glance at an lfq_fit objectglance.lfq_fit
Extract growth advantage estimatesgrowth_advantage
Construct a population immunity landscapeimmune_landscape
Simulated influenza A/H3N2 clade frequency datainfluenza_h3n2
Test if an object is an lfq_data objectis_lfq_data
Pipe-friendly growth advantage extractionlfq_advantage
Create a lineage frequency data objectlfq_data
List available modeling engineslfq_engines
Pipe-friendly model fittinglfq_fit
Pipe-friendly forecastinglfq_forecast
Pipe-friendly backtesting + scoringlfq_score
Check if 'CmdStan' backend is availablelfq_stan_available
Convert lfq_fit results to a summary tibblelfq_summary
Package version and system informationlfq_version
Plot backtest scoresplot_backtest
Plot adaptive allocationplot.adaptive_allocation
Plot calibration diagnosticsplot.calibration_report
Plot EVOI curveplot.evoi
Plot fitness decompositionplot.fitness_decomposition
Plot population immunity landscapeplot.immune_landscape
Plot Prospective Evaluation Resultsplot.lfq_prospective
Print a lineage frequency modelprint.lfq_fit
Read lineage count data from a CSV fileread_lineage_counts
Recalibrate prediction intervalsrecalibrate
Register a custom modeling engineregister_engine
Simulated SARS-CoV-2 variant frequency data (US, 2022)sarscov2_us_2022
Score backtest forecast accuracyscore_forecasts
Population-level selective pressure from variant dynamicsselective_pressure
Sequencing power analysissequencing_power
Simulate lineage frequency dynamicssimulate_dynamics
Summarize emerging lineagessummarize_emerging
Summarise a lineage frequency modelsummary.lfq_fit
Comprehensive surveillance quality dashboardsurveillance_dashboard
Expected Value of Information for genomic surveillancesurveillance_value
Tidy a fitness decompositiontidy.fitness_decomposition
Tidy an lfq_fit objecttidy.lfq_fit
Remove a registered engineunregister_engine