Why Sample Genotypes?
A virtual population needs a genotype for each simulated subject, not only a table of population frequencies. Those frequencies describe the intended population distribution; sampling turns them into individual assignments that can be connected to genotype-dependent PBPK parameters. Because a finite cohort is a realization of a population distribution, its observed category counts will usually differ from their expected counts.
The central design choice is whether to let those counts vary naturally under random sampling or to impose a specified number of subjects in each genotype category. These approaches answer different questions. Random sampling represents variation in cohort composition under a frequency model. Fixed-proportion construction ensures a chosen composition, but removes that source of variation from the constructed cohort.
The frequencies may be supplied directly as diplotype or genotype frequencies. Alternatively, allele frequencies can be used to construct genotype probabilities if the required assumptions are appropriate. For a biallelic locus, let \(f_A\) and \(f_a\) be the frequencies of alleles \(A\) and \(a\). If the two alleles forming each subject’s genotype are sampled independently from the same allele-frequency distribution, the genotype probabilities are \(f_A^2\), \(2f_Af_a\), and \(f_a^2\). This is the random-union-of-alleles assumption underlying Hardy-Weinberg genotype frequencies; it should not be applied automatically when the source frequencies or population structure do not support it. The earlier material on deriving genotype frequencies under Hardy-Weinberg equilibrium establishes this frequency calculation.
From Frequencies to Individual Assignments
When genotype or diplotype frequencies are already available, sample directly from those categories. For each subject, draw one category using its frequency as the probability. A computational implementation can form cumulative probabilities and draw a uniform random number \(U\) between 0 and 1: assign category 1 if \(U\leq f_1\), category 2 if \(f_1<U\leq f_1+f_2\), and continue through the final category. The categories must be ordered consistently with the cumulative intervals, and the final cumulative probability must equal 1.
For a biallelic genotype constructed from allele frequencies, the corresponding procedure is to draw two alleles per subject, independently, with probabilities \(f_A\) and \(f_a\), then record the resulting genotype. Sampling genotypes directly from the three probabilities is equivalent for the unordered genotype categories under the random-union assumption. Direct genotype sampling is often simpler; allele-level sampling can be useful when the subject-level alleles themselves are needed.
Worked Example: Sampling Diplotypes From Supplied Frequencies
Suppose a hypothetical PBPK cohort has \(n=400\) subjects and three diplotype categories with frequencies 0.70, 0.25, and 0.05. Assume these frequencies are the target probabilities for every independently sampled subject. Find the expected count and standard deviation for each category, and describe one possible random realization.
For category \(k\), the count \(N_k\) has expected value \(E(N_k)=nf_k\). Its standard deviation is \(\sqrt{nf_k(1-f_k)}\). Thus the expected counts are \(400(0.70)=280\), \(400(0.25)=100\), and \(400(0.05)=20\) subjects.
The corresponding standard deviations are \(\sqrt{400(0.70)(0.30)}=\sqrt{84}=9.165\), \(\sqrt{400(0.25)(0.75)}=\sqrt{75}=8.660\), and \(\sqrt{400(0.05)(0.95)}=\sqrt{19}=4.359\) subjects. These quantify the marginal sampling variability of each count; they do not imply that the three counts vary independently, since they must sum to 400.
One possible random realization is 276, 103, and 21 subjects. The counts sum to \(276+103+21=400\), and the realized proportions are 0.690, 0.2575, and 0.0525. These are close to, but not required to equal, the target frequencies. The expected counts are averages over repeated cohorts generated by the model, not quotas that every cohort must match.
Expected Counts and Their Sampling Variability
The count results follow from indicator variables. Define \(I_{ik}=1\) if subject \(i\) is assigned to category \(k\), and \(I_{ik}=0\) otherwise. Then \(N_k=\sum_{i=1}^n I_{ik}\). Each indicator has probability \(f_k\) of equaling 1, so its expectation is \(f_k\). By linearity of expectation, \(E(N_k)=nf_k\).
For an indicator with success probability \(f_k\), the variance is \(f_k(1-f_k)\). Under independent subject sampling, the indicators for different subjects have zero covariance. Therefore the variance of the sum is the sum of their variances:
Counts in different categories are not independent. For \(j\ne k\), a single subject cannot belong to both categories, so \(I_{ij}I_{ik}=0\). Their covariance for that subject is \(0-f_jf_k=-f_jf_k\). Summing across independent subjects gives \(\operatorname{Cov}(N_j,N_k)=-nf_jf_k\). This negative covariance reflects the fixed total cohort size: an assignment to one category leaves one fewer assignment available for the others.
The vector of counts has a multinomial distribution with sample size \(n\) and category probabilities \(f_1,\ldots,f_K\). The probability of any count vector \(N_1,\ldots,N_K\), where the counts are nonnegative integers summing to \(n\), is
This result makes an important distinction: expected counts can be fractional, while realized counts are integers. A non-integer expectation is not an instruction to round each category independently. Independent rounding can change the total and does not reproduce the multinomial sampling distribution.
Worked Example: Deriving Genotype Probabilities From Allele Frequency
In a hypothetical population, the frequency of a variant allele \(a\) is 0.20, so the frequency of the reference allele \(A\) is \(1-0.20=0.80\). Assume random union of alleles and sample \(n=1{,}000\) subjects independently. Calculate the genotype probabilities and expected counts.
Under the stated assumption, \(P(AA)=0.80^2=0.64\), \(P(Aa)=2(0.80)(0.20)=0.32\), and \(P(aa)=0.20^2=0.04\). The probabilities sum to \(0.64+0.32+0.04=1.00\), as required.
The expected counts are \(1{,}000(0.64)=640\) \(AA\) subjects, \(1{,}000(0.32)=320\) \(Aa\) subjects, and \(1{,}000(0.04)=40\) \(aa\) subjects. For example, the standard deviation of the \(aa\) count is \(\sqrt{1{,}000(0.04)(0.96)}=\sqrt{38.4}=6.197\) subjects. The expected value of 40 does not guarantee that exactly 40 subjects will be \(aa\).
If the source information instead supplied valid diplotype frequencies that did not arise from this assumption, those supplied frequencies should be sampled directly rather than replaced by these Hardy-Weinberg calculations. The calculation is conditional on the stated allele-sampling model.
Random Sampling Versus Fixed-Proportion Construction
A fixed-proportion cohort assigns prespecified integer counts to categories, rather than drawing each subject independently. For example, a researcher might choose the nearest feasible allocation to target frequencies, or deliberately choose a cohort with an exact number in each genotype category. This can be useful when the aim is to ensure representation of a rare category or to compare genotype groups with chosen sizes. It is not equivalent to an independent random sample from the frequencies.
| Feature | Independent categorical sampling | Fixed-proportion construction |
|---|---|---|
| Category counts | Random; fluctuate around \(nf_k\) | Set in advance as integer quotas |
| Rare categories | May be represented by few or no subjects | Can be assigned a guaranteed quota |
| Interpretation | Represents cohort-composition variability under the frequency model | Represents a designed composition, not a random cohort draw |
| Expected counts | \(nf_k\) under the stated sampling model | Equal to the fixed counts for the constructed cohort |
Worked Example: Chance of Missing a Rare Genotype
Suppose a hypothetical genotype category has frequency 0.02, and \(n=100\) subjects are sampled independently. Find its expected count and the probability that the cohort contains no subjects in this category. Compare this with a fixed allocation of two subjects to the category.
The expected count under random sampling is \(100(0.02)=2\). Each subject has probability \(1-0.02=0.98\) of not belonging to the category. By independence, the probability that all 100 subjects miss it is \(0.98^{100}=0.1326\), approximately 13.3%.
Thus a random cohort can contain zero rare-category subjects even though the expected count is two. A fixed allocation of two guarantees that the category is represented, but it does not have the same distribution of counts as independent sampling. In particular, the fixed cohort has no chance of zero subjects in that category, whereas the random design has a 13.3% chance under the assumed frequency model.
Implementation Checks and Common Pitfalls
Before using sampled genotypes in a PBPK simulation, verify that the frequency inputs and the sampling procedure match the intended population model. Sampling errors can create biologically implausible category assignments or make the resulting cohort represent a different design than intended.
- Check the probability vector. Every frequency must be between 0 and 1, and the frequencies must sum to 1 within an explicitly chosen numerical tolerance. Do not silently normalize a badly specified vector; first determine whether categories are missing, duplicated, or drawn from inconsistent sources.
- Check category definitions. Categories must be mutually exclusive and collectively exhaustive. If a genotype category is counted twice under different labels, or a possible category is omitted, the sampling probabilities no longer describe the intended set of outcomes.
- Check the frequency assumptions. Do not infer genotype frequencies from allele frequencies without the required random-union assumption. If using supplied genotype or diplotype frequencies, preserve the frequencies relevant to the target population.
- Check the realized cohort without demanding exact agreement. Compare observed counts with \(nf_k\) and their sampling variability. A moderate deviation is expected under random sampling; a substantial discrepancy may indicate a coding or input problem, but a single difference from the expectation is not by itself proof of an error.
A common mistake is to say, “The expected count for the rare genotype is two, so I must assign exactly two subjects.” That reasoning confuses a mean with a quota. Under random sampling, the count is a random integer with mean two; under fixed construction, two is imposed by design. The correction is to choose the procedure according to the scientific purpose and describe it accurately.
Another limitation is that ordinary categorical sampling represents only the specified category distribution and independence assumptions. It does not automatically reproduce unmodeled population structure or relationships among subjects. Fixed quotas also affect interpretation: they may be useful for balanced genotype comparisons, but their cohort proportions should not be presented as a random realization of population prevalence.
Specify the genotype or diplotype categories and confirm that they are exhaustive and nonoverlapping.
Use supplied category frequencies directly, or derive genotype probabilities from allele frequencies only under an appropriate allele-sampling assumption.
Use independent categorical draws when cohort composition should vary; use fixed integer quotas when a designed composition is required.
Check probabilities, realized counts, and the interpretation of the cohort before mapping genotypes to PBPK parameters.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions below.
- A category has frequency 0.10 in a cohort sampled independently with \(n=200\). What is its expected count and standard deviation?
- For a variant allele frequency of 0.30, what are the three genotype probabilities under random union of alleles?
- Why can a category with expected count three be absent from a randomly sampled cohort?
- What is the main interpretive difference between sampling 50 subjects independently and assigning fixed quotas of 35, 12, and 3 to three categories?
Solutions. (1) The expected count is \(200(0.10)=20\). The standard deviation is \(\sqrt{200(0.10)(0.90)}=\sqrt{18}=4.243\) subjects. (2) The reference allele frequency is 0.70, so the probabilities are \(0.70^2=0.49\), \(2(0.70)(0.30)=0.42\), and \(0.30^2=0.09\); these sum to 1. (3) Expected count is a mean, not a guaranteed minimum. Under independent sampling, the probability of no members in a category of frequency \(f\) is \((1-f)^n\), which is positive when \(f<1\). (4) Independent sampling allows category counts to vary around their expectations; fixed quotas force the counts to be exactly 35, 12, and 3 and therefore describe a designed composition.