Computes the minimum sample size necessary (MSSN) for a model-based
case-control sequencing trend design. It evaluates the same independent
sequencing-only, phenotype, heterogeneity, and post-call genotype-error
scenarios as cc_ngs_power.
cc_ngs_mssn(
power,
alpha,
prev,
pd,
R2,
coverage = NULL,
seq_error = NULL,
MOI = c("M", "D", "Rec"),
k = 1,
verbose = TRUE,
locus_het = FALSE,
pi = 1,
case_coverage = coverage,
ctrl_coverage = coverage,
case_seq_error = seq_error,
ctrl_seq_error = seq_error,
pheno_misclass = FALSE,
theta = 0,
phi = 0,
geno_misclass = c("none", "1p", "2p", "3p", "diff3p"),
e = 0,
e1 = 0,
e2 = 0,
e01 = 0,
e02 = 0,
e03 = 0,
case_e01 = 0,
case_e02 = 0,
case_e03 = 0,
ctrl_e01 = 0,
ctrl_e02 = 0,
ctrl_e03 = 0,
diff_source = c("explicit", "case", "ctrl"),
diff_multiplier = 1
)Numeric in \((0,1)\). Requested power.
Numeric in \((0,1)\). Significance level.
Numeric in \((0,1)\). Disease prevalence.
Numeric in \((0,1)\). Disease-allele frequency.
Numeric \(> 0\). Homozygote relative risk.
Common positive integer fixed sequencing depth. May be omitted when both group-specific depths are supplied.
Symmetric per-read sequencing-error probability in \([0,0.5)\). Common shorthand; may be omitted when both group-specific errors are supplied.
Character mode of inheritance: "M" for multiplicative,
"D" for dominant, or "Rec" for recessive.
Numeric \(> 0\). Planned control-to-case sample-size ratio.
Logical. If TRUE, print a concise result summary.
Logical. If TRUE, apply the canonical PAWEH
case-control locus-heterogeneity mixture before sequencing observation.
Numeric in \([0,1]\). Locus-homogeneity fraction used when
locus_het = TRUE. One retains the original associated-case
distribution; zero makes the case distribution equal to controls. When
locus_het = FALSE, pi must remain at its default value of 1.
Case/control fixed depths, respectively.
Each defaults to coverage; an explicit value overrides it.
Case/control per-read error probabilities.
Each defaults to seq_error; an explicit value overrides it.
Effective depths and errors obey the common parameter constraints.
Logical. If TRUE, apply the ordinary PAWEH
case-control phenotype-misclassification model before sequencing.
Numeric in \([0,1)\). Probability that a truly affected individual is classified as a control.
Numeric in \([0,1)\). Probability that a truly unaffected individual is classified as a case.
Character genotype-misclassification model:
"none", "1p", "2p", "3p", or
"diff3p". The selected model is applied after sequencing calls.
Numeric in \([0,0.5]\). One-parameter symmetric error rate.
Numeric two-parameter homozygote-to-heterozygote and heterozygote-to-homozygote error rates.
Numeric non-differential three-parameter error rates.
Case-specific three-parameter error rates.
Control-specific three-parameter error rates.
Character source for differential three-parameter errors:
"explicit", "case", or "ctrl".
Nonnegative multiplier used to derive the other
group's rates when diff_source is "case" or "ctrl".
Invisibly, an object of class "cc_ngs_mssn" containing a
scenario-first scenarios list. Each scenario records target NCP,
D/Q, continuous and integer sample sizes, achieved NCP and
power, rounding metadata, staged frequencies, and sequencing/error
matrices. Legacy fields follow the compatibility_scenario
convention documented for cc_ngs_power.
Locus heterogeneity uses
\(g_{case,H}=\pi g_{case}+(1-\pi)g_{control}\) in its independent branch.
The prevalence-weighted phenotype transformation from
cc_mssn is applied directly to the common biological baseline
in its branch. Case and control sequencing settings are then applied to the
corresponding pre-sequencing groups. Conventional genotype
misclassification is applied after sequencing only in its own branch. See
cc_ngs_power for the scenario paths and matrix convention.
When \(\pi=0\) and sequencing mechanisms are equal, no finite MSSN exists
for target power greater than alpha if the observed contrast is zero.
Differential mechanisms may create an observed contrast even under a
biological null. MSSN is a nominal asymptotic calculation using the existing
chi-square critical value, without separate null-distribution or Type I error
recalibration.
The function numerically inverts the one-degree-of-freedom noncentral
chi-square distribution only to obtain the target NCP. It then solves the
Ahn/Chapman-Nam trend-test sample-size equation analytically. Planned cases
are the ceiling of the continuous requirement and planned controls are
ceiling(k * MSSN_case), following the PAWEH convention. Achieved NCP
and power are recomputed using these actual integer sample sizes, with a
local boundary adjustment if required to ensure target attainment and
integer minimality.
Scores are c(0,1,2) for "M", c(0,1,1) for
"D", and c(0,0,1) for "Rec". Finite depth can cause
genotype-call uncertainty even when seq_error = 0, because a true
heterozygote can yield reads from only one allele.
This is an analytic study-design calculation, not LTTae,NGS, a raw-read latent-genotype likelihood or EM method, downstream association testing, or simulation.
Ahn, K., Haynes, C., Kim, W., St. Fleur, R., Gordon, D., & Finch, S. J. (2007). The effects of SNP genotyping errors on the power of the Cochran-Armitage linear trend test for case/control association studies. Annals of Human Genetics, 71, 249–261. doi:10.1111/j.1469-1809.2006.00318.x .
Gordon, D., Finch, S. J., & Kim, W. (2020). Heterogeneity in Statistical Genetics. Springer. doi:10.1007/978-3-030-61121-7 .
cc_ngs_mssn(
power = 0.80, alpha = 0.05,
prev = 0.05, pd = 0.30, R2 = 1.8,
coverage = 20, seq_error = 0.01,
MOI = "M", verbose = FALSE
)