sequencing_power: Sequencing power analysis

View source: R/power-analysis.R

sequencing_powerR Documentation

Sequencing power analysis

Description

Estimates the minimum number of sequences needed to detect a lineage at a given frequency with specified precision.

Usage

sequencing_power(target_precision = 0.05, current_freq = 0.02, ci_level = 0.95)

Arguments

target_precision

Desired half-width of the frequency confidence interval. Default 0.05 (plus/minus 5 percentage points).

current_freq

True or assumed frequency of the target lineage. Can be a vector for multiple scenarios. Default 0.02 (2%).

ci_level

Confidence level. Default 0.95.

Details

Uses the normal approximation to the binomial:

n = z^2 \cdot p(1-p) / E^2

where z is the critical value, p is frequency, E is precision.

Value

A tibble with columns: current_freq, target_precision, required_n, ci_level.

Examples

# How many sequences to estimate a 2% lineage within +/-5%?
sequencing_power()

# Multiple scenarios
sequencing_power(current_freq = c(0.01, 0.02, 0.05, 0.10))


lineagefreq documentation built on April 3, 2026, 9:09 a.m.