Skip to main content
Advertisement
  • Loading metrics

Molecular surveillance of multiplicity of infection, haplotype frequencies, and prevalence in infectious diseases

  • Henri Christian Junior Tsoungui Obama ,

    Roles Conceptualization, Data curation, Formal analysis, Investigation, Methodology, Software, Validation, Visualization, Writing – original draft, Writing – review & editing

    christian.tsoungui@aims-cameroon.org

    Affiliations Department of Applied Computer- and Biosciences, University of Applied Sciences Mittweida, Mittweida, Germany, Department of Mathematics, Chemnitz University of Technology, Chemnitz, Germany

  • Kristan Alexander Schneider

    Roles Conceptualization, Formal analysis, Funding acquisition, Investigation, Methodology, Project administration, Resources, Software, Supervision, Validation, Visualization, Writing – original draft, Writing – review & editing

    Affiliations Department of Applied Computer- and Biosciences, University of Applied Sciences Mittweida, Mittweida, Germany, Center for Global Health, Department of Internal Medicine, University of New Mexico, Albuquerque, New Mexico, United States of America, Translational Informatics Division, Department of Internal Medicine, University of New Mexico, Albuquerque, New Mexico, United States of America

?

This is an uncorrected proof.

Abstract

Background

The presence of multiple different pathogen variants within the same infection, referred to as multiplicity of infection (MOI), confounds molecular disease surveillance in diseases such as malaria. Specifically, if molecular/genetic assays yield unphased data, MOI causes ambiguity concerning pathogen haplotypes. Hence, statistical models are required to infer haplotype frequencies and MOI from ambiguous data. Such methods must apply to a general genetic architecture (i.e., multiple, multiallelic markers), when aiming to condition secondary analyses, e.g., population genetic measures such as heterozygosity or linkage disequilibrium, on the background of variants of interest, e.g., drug-resistance associated haplotypes.

Methods and findings

A statistical method to estimate MOI and pathogen haplotype frequencies, assuming a general genetic architecture, is introduced. The statistical model is formulated and the relation between haplotype frequency, prevalence and MOI is explained. Because no closed solution exists for the maximum-likelihood estimate, the expectation-maximization (EM) algorithm is used to derive the maximum-likelihood estimate. The asymptotic variance of the estimator (inverse Fisher information) is derived. This yields a lower bound for the variance of the estimated model parameters (Cramér-Rao lower bound; CRLB). By numerical simulations, it is shown that the bias of the estimator decreases with sample size, and that its covariance is well approximated by the inverse Fisher information, suggesting that the estimator is asymptotically unbiased and efficient. Computational performance is evaluated using empirical datasets, suggesting that the method is appropriate for up to thirteen polymorphic markers. As an application, a dataset from Cameroon concerning anti-malarial drug resistance is analyzed, showing how the method can be utilized to derive population genetic measures associated with haplotypes of interest.

Conclusion

The proposed method has desirable statistical properties and is adequate for handling molecular data consisting of moderate number of multiallelic molecular markers. The EM-algorithm provides a stable iteration to numerically calculate the maximum-likelihood estimates. An implementation of the algorithm alongside a detailed documentation is provided in Supporting information S1 Data.

Author summary

Malaria annually causes 263 million infections and 596,000 deaths. Control efforts are challenged by factors like spreading drug resistance. Monitoring pathogen variants at the genetic level (molecular surveillance), especially those linked to drug resistance, is a public health priority. A major challenge is the presence of multiple, genetically distinct pathogen variants (characterized by several genetic markers) within infections (multiplicity of infection). Because genetic assays do not provide phased information in this context, ambiguity in reconstructing the actual variants present in an infection arises. This challenge is not limited to malaria. Probabilistic methods are required to phase genetic data, i.e., to reconstruct the pathogen variants present in infections. As such, we introduce a statistical method to estimate the distribution of pathogen variants at the population level from unphased molecular data obtained from disease-positive specimens. This is a combinatorially difficult task, as the number of possible genetic variants grows exponentially with the amount of genetic information included. Although the method applies to data with an arbitrary genetic architecture (i.e., multiple multiallelic markers), its application is constrained by computational limitations. The method’s adequacy is explored and used to analyze a malaria dataset from Cameroon to guide applications. A stable numerical implementation is provided.

Introduction

Epidemiological surveillance of infectious diseases is increasingly augmented by molecular/genetic methods. This facilitates a shift from symptom-based to pathogen-specific diagnostics and allows monitoring of specific pathogen variants of interest, such as variants associated with antimicrobial resistance, and their routes of transmission. Molecular surveillance has become popular for a variety of pathogens of interest [1], due to advances in molecular/genetic methods.

Pathogen variants are typically characterized by their allelic configuration at certain loci/markers, e.g., by SNP barcodes, a microsatellite (STR) profile, or microhaplotypes. The presence of several pathogen variants within an infection is common in many diseases. For instance, in malaria infections, it is well-recognized that distinct pathogen variants can be transmitted (by the same or different mosquitoes), a phenomenon commonly referred to as complexity of infection (COI) or multiplicity of infection (MOI) [2]. Especially, in malaria, MOI is recognized, because it scales with transmission intensities, however not necessarily in a linear way [3,4]. Additionally, MOI in malaria has far-reaching implications, as it mediates the amount of recombination between parasite variants and thereby changes the population genetics underlying malaria evolution, e.g., with regard to drug resistance [5]. Due to MOI in malaria, it is also important to distinguish between a variant’s frequency (its relative abundance) and its prevalence (the probability of observing it in an infection) [2]. The latter is of clinical and epidemiological relevance, the former is of relevance for molecular surveillance, e.g., when studying the spread of drug resistance.

MOI is unfortunately ambiguously defined in the literature, with discrepancies between verbal and formal definitions, and the actual quantity referred to as MOI. These differences are discussed in detail in [2]. Namely, MOI is formally defined in most statistical models as the number of super-infections with the same or different pathogen variants, assuming that exactly one variant is transmitted at each infective event (cf. [2]). In the following, this definition of MOI is used. Verbally, MOI is often referred to as the number of different pathogen variants within an infection, which is a derived quantity from the formal definition of MOI. Note that co-transmission of different pathogen variants (co-infections) is ignored in the formal definition of MOI. Estimating MOI is typically coupled with estimating the frequency spectra of pathogen variants. Several methods have been proposed, often in the context of malaria, although these methods are not specific to this disease. Ad-hoc methods, e.g., [6,7], are straightforward to apply but typically biased (cf. [2] for a detailed discussion). Specifically, in [7], all samples with evidence of multiple infections are disregarded, effectively leading to overestimation of predominant and underestimation of rare pathogen variants. In [6] samples with unambiguous information are retained, and all pathogen variants in an infection are given the same weight. Although less biased than the former method, the latter leads to overestimation of rare variants. The bias of these methods increases with MOI. Alternative methods relying on formal statistical frameworks are more or less based on the same probabilistic model (cf. [2]). Differences occur in: (i) the quantities to be estimated (whether MOI or a derived parameter is estimated; cf. [2]); (ii) the genetic architecture allowed by these approaches, (e.g., single marker [8,9], two multiallelic markers [8,10], a set of biallelic markers [11,12], or multiple multiallelic markers [13,14]); (iii) whether MOI is estimated explicitly [15,16]; (iv) whether the probabilistic model uses approximations [11,1720]; (v) the assumptions regarding the underlying distribution of MOI [2,21]; (vi) whether heuristic plug-in estimates are required for some parameters [22]; (vii) whether bias-corrections are applied [23]; (viii) the way missing data is handled [24]; and (ix) whether a Bayesian (e.g., [11,14,16]) or a frequentist approach (e.g., [8,9,12]) is being used.

Estimators for MOI and variant frequencies typically do not have an explicit form and have to be calculated numerically. In the frequentist case, this is often achieved by using the EM-algorithm [10,12,17,18,21,2426]. Importantly, the asymptotic properties of the estimators were studied in detail for some methods – mainly in the simplest cases assuming a genetic architecture consisting of a single marker [23,24,27]. In these cases it can be shown that the probabilistic models fall into the class of exponential families, proving the existence, uniqueness, asymptotic unbiasedness, efficiency, and consistency of the estimators. Such investigations were complemented by numerical simulations to study the finite-sample properties. The same approach was used for more complicated underlying genetic architectures [10,12]. For the simple genetic architectures, it was also shown that the maximum likelihood estimates of MOI and variant frequencies coincide with the moment estimator for MOI and variants prevalence [27]. Notably, Bayesian and maximum-likelihood estimators should be in agreement if an uninformative prior distribution of model parameters is assumed. In the strict sense, prior distributions need to be inferred from an independent data source in a Bayesian framework, which is not always possible. A strong discrepancy between Bayesian and maximum-likelihood-based methods indicates that the underlying dataset does not reflect the information from the prior distributions well, thereby identifying a potential problem.

Estimates of haplotype frequencies and MOI can be further utilized as plug-in estimates for population genetic inferences, such as detecting selection patterns or population structure. E.g., quantities such as heterozygosity or pattern of linkage-disequilibrium can be derived, which are informative on selection processes, such as in the case of drug resistance.

Standard population genetic analyses to mine patterns of selection are concerned with completed selective sweeps, i.e., the mutations of interest replaced the wildtypes. In the case of antimicrobial resistance, one is concerned with ongoing selective processes, i.e., not all variants of interest reached fixation in the population. Hence, signatures of selection are distorted. It is therefore necessary to condition population genetic analyses on the subpopulation which is characterized by variants of interest at certain markers (loci). Many methods to estimate MOI and variant frequencies are insufficient in this context, as they are applicable only in the case of too restrictive genetic architectures. This is true for methods that apply only to single markers or biallelic markers.

Here, the maximum likelihood methods from [10,12] to estimate MOI and haplotype frequencies are extended to be applicable to a general genetic architecture. (In this context, “general” refers to the number of genetic markers and the number of alleles per markers. However, all markers have to be present in the specimens, which excludes deletions, certain inclusions, inversions or chromosomal rearrangements.) Because the method is capable of estimating frequencies of haplotypes characterized by multiple multiallelic loci, such estimates can be utilized for further population genetic analyses.

Readers are advised to start with section Methods and then move towards the results section. The underlying statistical model is derived in Methods under the assumption that MOI follows a conditional (positive) Poisson distribution (i.e., only disease-positive samples are considered). A number of illustrations help to facilitate the understanding of the mathematical notation (which is summarized for convenience in Table 1). A notation is used which unifies the preceding work of [9,10,12] which assumes a single multiallelic molecular marker, multiple biallelic markers, and two multiallelic markers, respectively. As for the simple genetic architectures the current model is too complex to allow for a closed-form solution for the maximum likelihood estimate (MLE). Hence, the expectation-maximization (EM) algorithm is employed. The derivation of the algorithm has the same structure as in [10,12] with some modifications and is hence presented for the sake of completeness in the Supporting information S1 Appendix Deriving the EM-algorithm. Only the final iterative algorithm is presented in Results. There, Table 1 provides an overview of the notation for those not interested in the technical details but only the results. Table 1 and the figures in Methods should be consulted to facilitate readability. Furthermore, in Methods expressions for haplotype prevalence are derived, which are epidemiologically more relevant than frequencies. Particularly, the interplay between the MOI distribution, frequencies, and prevalence becomes clear from the formulae. Importantly, prevalence cannot be directly observed from molecular data, since typically only unphased haplotype information is available. Consequently, it is in general ambiguous which haplotypes (variants) are present in an infection. In ad hoc approaches (see above), sometimes only unambiguous information is considered (e.g., [6,7]) to derive estimates for haplotype prevalence/frequencies. To facilitate the relations with such methods, also formulae for the prevalence of haplotypes in unambiguous observations are derived.

thumbnail
Table 1. Summary of key notation: Listed are the most important notations used throughout the manuscript. denotes the powerset of set X. Abbreviations: PGF... probability generating function.

https://doi.org/10.1371/journal.pcbi.1012955.t001

Furthermore, the asymptotic covariances between model parameters and their transform (mean MOI; haplotype prevalence) are derived. Two alternative approaches are discussed in S1 Appendix.

The finite sample properties of the estimator are explored by numerical simulations. These complement the results of [10,12,27], which in special cases indicate that the proposed method has little bias and that the estimator’s variance is close to the Cramér-Rao lower bound. Moreover, the computational efficiency of the model is estimated by analyzing the Pf8 dataset from the MalariaGen project [28]. This suggests that computational time increases exponentially with the maximum number of polymorphic markers in samples.

Special emphasis is given to data application. Specifically, a P. falciparum dataset concerned with markers associated with sulfadoxine-pyrimethamine (SP) resistance collected in Yaoundé, Cameroon is analyzed. First, the frequencies and prevalence of resistance-associated haplotypes are calculated. In a second step, heterozygosity and pairwise LD are determined across a range of microsatellite markers flanking the mutations of interest, conditioned on resistance-associated haplotypes that surpass a minimum frequency threshold of 10%. The data application is intended to showcase possible applications of the proposed method and to discuss its limitations. The necessity of the general genetic architecture becomes clear from the data applications. They are designed to showcase the limitations of the previous work of [10,12,27] (cf. Discussion).

An implementation of the method as R script alongside detailed documentation is provided as supplements and is available via GitHub at https://github.com/Maths-against-Malaria/generalModel.git, where the material will be maintained, and Zenodo at https://doi.org/10.5281/zenodo.14553429 (cf. [29]).

The method proposed here is haplotype-based, without simplifying assumptions such as independence between markers (linkage equilibrium). This applies to multiallelic molecular markers. This includes SNP barcodes, microhaplotypes, or panels of microsatellite markers. As a consequence, the number of involved computations grows exponentially with the number of markers in the dataset. Although in theory the number of molecular markers and the number of circulating variants (alleles) per marker are not restricted, the implementation reasches numerical limits if the number of markers is too large. The method is applicable to up to 13 polymorphic SNP markers (note that in standard SNP barcodes not all SNPs are polymorphic in a dataset - hence it will be applicable to, e.g., the standard 24-SNP barcode of [30]) or up to 10 mutiallelic microsatellite markers on a standard desktop computer. The applicability of the method is discussed in detail.

Results

The results described in this section use a specific notation aiming at facilitating the understanding of the results as well as the underlying derivations presented in the Methods section. Some key notations are summarized in Table 1.

The statistical model is derived in Methods. Here, only the final results are presented. First, the algorithm to derive the maximum likelihood estimates (MLE) of haplotype frequencies and the MOI parameter for the proposed statistical model is presented. Second, estimates of haplotype prevalences, which are epidemiologically and clinically more relevant quantities than frequencies, using the MLEs as plugin estimates are presented. Third, the asymptotic variance of the estimator is derived, i.e., the Cramér-Rao lower bound is derived as the inverse Fisher information. This is achieved by two alternative approaches, shown to be equivalent: (i) by embedding the log-likelihood function in a higher dimensional space; (ii) by eliminating a redundant parameter. Next, the finite sample properties of the estimator are explored via numerical simulations. Finally, the computational efficiency of the proposed method is ascertained using data from the MalariaGen project [28], and its use is demonstrated on a P. falciparum dataset from Cameroon, to estimate heterozygosity and LD across a range of microsatellite markers on the background of haplotypes associated with SP-resistance.

Maximum likelihood estimate

The estimates and of the model parameters and , representing the frequency of haplotype and MOI parameter, respectively, are obtained by maximizing the log-likelihood function (53). Note that even in the simple case of a single locus (for which the model can be written as an exponential family), no closed-form solution exists (cf. [9]), and one has to rely on numerical methods. Here, for this purpose, the expectation-maximization (EM)-algorithm is employed.

The EM-algorithm is an iterative procedure that alternates two steps: (i) the expectation (E) step during which the expectation, with regard to the parameter choice in the current step, of the log-likelihood function is calculated over an unobserved variable and the unknown model parameters; (ii) the maximization (M) step during which the function from the E step is maximized over the unknown parameters. This yields the parameter choice for the next E-step. The whole iteration is repeated until convergence, yielding the MLE. A detailed derivation of the algorithm is described in Supporting information S1 Appendix in section Deriving the EM-algorithm.

Let denote the set of all possible haplotypes, the set of all possible observations, the set of all sub-observations of observation , the number of times observation occurs in the dataset of sample size N, the set of all haplotypes compatible with observation , and the indicator function of set (see Table 1). The algorithm begins with an initial choice for the MOI parameter and haplotype frequencies . Given the parameter choices and in step t, the estimates are obtained in step t + 1 by first updating the haplotype frequencies as

(1a)

where

(1b)

and

(1c)

Then, the MOI parameter is obtained by iterating the following equation until convergence:

(1d)

where

(1e)

where G(z) and are the probability generation function (PGF; (48b)) of the MOI distribution (conditional Poisson distribution) and its derivative, respectively.

The iteration in (1d) starts with the initial value and is repeated until convergence, i.e., until is satisfied. The update of the Poisson parameter in step t + 1 is then .

The two iterative steps follow (1) until numerical convergence, i.e., until . Once this holds, the MLE is obtained as

(2)

Note, the algorithm is guaranteed to converge to a point, at which a maximum of the original likelihood function is attained (not necessarily a global maximum), typically within a few iterations.

The mean MOI is then estimated by evaluating (32b) at the MLE, i.e., as

(3)

Considering the practical applicability, the difficulty here is to efficiently implement the rather complicated sums in (1). An implementation is available as an R script and comprehensive manual, provided in Supporting information S1 Data, and a version subject to future updates can be accessed via GitHub at https://github.com/Maths-against-Malaria/generalModel.git, and Zenodo at [29].

Key assumptions and applicability.

The statistical model is based on a number of assumptions, which determines its applicability to malaria or other diseases.

First, the distribution of MOI is assumed to follow a conditional Poisson distribution, and is hence fully characterized by a single parameter . This is not restrictive, as it has been shown in similar situations that more flexible distirbutions hardly yield improvements [21].

Second, the model incorporates superinfections, while ignoring co-infections (i.e., the co-transmission of multiple pathogen variants at the same infective event). This implies that given an MOI value m, the number of infecting haplotypes is drawn from a multinomial distribution with parameters m (i.e., the realization of a random variable characterized by the Poisson parameter ) and (haplotype distribution). Hence, pathogen variants within each infection are independent. Under co-infections co-occurring haplotypes are not independent. As long as the dependency is weak, the super-infection assumption is a valid approximation. However, if – on a population level – the independence assumption of pathogen variants within infections is strongly violated, the proposed model is not applicable. For co-infections, one would need to model the distribution of sets of haplotypes being co-transmitted. In a disease like malaria, this would require additional assumptions regarding mosquito transmission dynamics, largely affected by factors such as vector competence and parasite density within hosts. In this case, both host-vector and vector-host transmission has to be modeled ideally. The former necessitates incorporating mutational models within hosts, as this mediates host-vector transmission.

Third, the method is haplotype-based without making simplifying assumptions, such as independence of markers (linkage equilibrium), which is often assumed in alternative methods, e.g., [14]. The advantage of assuming linkage equilibrium is that the number of model parameters grows linearly with the number of molecular markers. However, this assumption is a simplification which is not justified in all situations. In Particular, when, e.g., considering dense SNP panels, as this can bias results. Without assuming linkage equilibrium, the number of model parameters increases geometrically with the number of molecular markers. Although the method here is in theory applicable to an arbitrary number of multiallelic markers, the increase in model parameters imposes computational limitations on the number of molecular markers. As shown below, the model is applicable within a reasonable running time for up to approximately 10 polymorphic SNPs observed in samples, or about 8 multiallelic markers (such as microsatellites or microhaplotypes, cf. [3133]). In diseases such. In diseases such as malaria, this is sufficient in many situations for standard SNP panels (e.g., 24 SNPs [30]). Namely, in practice, laboratory assays fail for some markers, not all markers are polymorphic in a given study populations, and the number of polymorphic SNPs in samples is typically much smaller than the number of SNPs considered.

Fourth, the model implicitly assumes missingness at random. Only samples for which molecular information is available at all markers can be included, while samples with missing information are excluded. If there is a justified reason to assume a systematic bias due to the type of molecular data or assays being performed, the missing at random assumption can be an oversimplification.

Fifth, an error model is not included, i.e., the allelic information in samples is assumed to be perfect. This is a pragmatic assumption due to the haplotype-based nature of the method. Incorporating an error model would be computationally intractable, as any observation could results form errors from any other observation. Note, error models are possible under the simplifying assumption of linkage equilibrium, as the probabilistic expressions for observations simplify substantially. However, assuming independent errors, e.g., [14], might not be justified in all situations, e.g., if minor variants fail to be detected. In general, the necessity and type of an error model is assay specific. When considering, e.g., SNP panels, the expected errors vary substantially for SNPs inferred from sequencing data, melting assays, or TaqMan assays. Whereas errors in microhaplotypes obtained from nanopore sequencing are negligible, microsatellites are prone to errors.

Estimation of prevalence

The prevalence of a haplotype is the probability that it occurs in an infection. Importantly, pathogen haplotypes are not directly observed in infections. Rather, the genetic information obtained from molecular assays is typically unphased, which leads to ambiguity if multiple haplotypes are present in an infection (cf. Fig 1). Consequently, the absence and presence of certain haplotypes in an infection is uncertain.

thumbnail
Fig 1. Compatibility between infections and observation: For MOI = 4, the middle panel illustrates all possible infections with the 6 haplotypes circulating in the population (top panel), i.e., compatible with observation (bottom panel).

Haplotypes are sampled from a pool (top panel), in which they are ordered from one to six (so that the first and sixth haplotypes are at the top left and bottom right corner, respectively). In the top panel the set of all haplotypes compatible with observation , is indicated.

https://doi.org/10.1371/journal.pcbi.1012955.g001

Therefore, two concepts of prevalence are distinguished here: (i) “true prevalence”, which is the probability that a haplotype is present in an infection, and (ii) “conditional prevalence”, which is the probability that a haplotype occurs in an infection, in which it can be unambiguously observed. The distinction is important for practical purposes. In the first case, a statistical model, as the one proposed here, is required to resolve ambiguity in the observable information, while in the latter case, all samples with ambiguous information would be disregarded, and prevalence simply calculated as the relative frequency of the remaining samples, in which a particular haplotype occurs.

To distinguish between unobservable and conditional prevalence, it is necessary to emphasize that for an infection with MOI = m, two outcomes are possible: (i) a “single infection” involving the same pathogen haplotype m times, and (ii) a super-infection involving several pathogen haplotypes, i.e., “multiple infections”. Depending on the infecting pathogen haplotypes, multiple infections yield either ambiguous observations when the alleles of the infecting pathogen haplotypes are different at more than one locus (as the infections illustrated in Fig 1) or unambiguous observations if only the pathogen haplotype are infecting such that their alleles differ at exactly one locus (cf. Fig 2). Note that single infections yield unambiguous observations.

thumbnail
Fig 2. Illustration of unambiguity of infections between and haplotypes in set : Shown are multiple infections involving haplotype , and (ii) a haplotype from the set U(1,1,1) (upper block).

In all resulting observations, haplotype information is unambiguous. However, MOI remains unknown.

https://doi.org/10.1371/journal.pcbi.1012955.g002

In the following, first the true prevalence is derived, followed by the derivation of the conditional prevalence, which is conditioned on only observing unambiguous observations, i.e., single infections and unambiguous multiple infections.

True prevalence.

For a given haplotype , let denote its true prevalence. The derivations follow the steps in [12]. Moreover, assume an infection with observation , and the probability that haplotype is not in . If denotes the probability of MOI = m, the true prevalence is obtained as

(4a)

where and or short notations for the multinomial coefficients and power products occurring in a multinomial distribution (cf. Eq. 33). Using the multinomial theorem, the innermost sum yields

(4b)

With G being again the PGF (cf. Eq (48b)) one obtains

(4c)

Therefore, given the MLEs and of the MOI parameter and haplotype frequency, respectively, the true prevalence is estimated from (4c) by

(5)

Conditional prevalence.

In practice, it might be desirable to estimate haplotype prevalence based on observations in which haplotype information is unambiguous. In such a case, all ambiguous observations in the dataset are discarded, and the prevalence of a given haplotype is estimated as the probability of observing , conditioned on observing unambiguous observations.

The set of possible unambiguous observations is a subset of and is denoted by , i.e., (the subset is proper if more than one locus with at least two alleles are considered). The conditional prevalence of haplotype is defined as

(6)

where, defines the probability that is observed in an unambiguous observation, and is the probability of all unambiguous observations.

For a given haplotype , to obtain the quantities and , we need to construct the set of all haplotypes that yield unambiguous multiple infections with (see Fig 2). Recall that unambiguous multiple infections are obtained only for infections with exactly two pathogen haplotypes, such that their alleles are distinct at exactly one locus. Note that is not in the set , i.e., . Therefore, the set is defined by

(7)

Considering a genetic architecture with L loci and alleles at locus k, the cardinality of is , and for any haplotype such that , we have .

The probability that haplotype is observed in an unambiguous infection is the sum of the probabilities of all the multiple infections involving haplotype and exactly one haplotype in , and the single infection with . Assume a fixed haplotype , a haplotype , and an unambiguous observation involving . For MOI = m, because and are sampled with replacement each of the m times, the following outcomes are possible for : (i) is sampled all m times, i.e., , yielding a single infection with , (ii) is sampled all m times, i.e., , yielding a single infection with and (iii) and are sampled and times, respectively, such that , yielding an unambiguous multiple infection (cf. [12]). Since unambiguous infections with are of interest, only cases (i) and (iii) are relevant in the derivation of . Therefore, one has

(8a)

In section Prevalence estimates of Supporting information S1 Appendix this quantity is shown to simplify to

where G is again the PGF (48b), and L is the number of loci considered.

The probability of all unambiguous observations is derived in section Prevalence estimates of Supporting information S1 Appendix and is given by

Hence, the conditional prevalence of is given by

(9)

The estimate of conditional prevalence is obtained by plugging the MLEs in (9), i.e.,

(10)

Asymptotic variance and covariance

It is desirable to find unbiased estimators. In practice, this is hardly possible for complex statistical models. Specifically, maximum-likelihood estimators are typically only asymptotically unbiased, i.e., bias converges to zero as sample size increases to infinity. This also holds true for the present model, which was shown to be biased [10,12,24,27]. For the special case of a single molecular marker, the method was shown to be asymptotically unbiased, because the model falls into the class of exponential families [24]. For the cases of two multiallelic markers and arbitrary many biallelic markers, the model no longer falls into the class of exponential families and the estimator was shown numerically to be asymptotically unbiased [10,12]. In any case, it is also desirable to derive estimators with small variance. For unbiased estimators, the minimum possible variance is given by the Cramér-Rao lower bound (CRLB) [34,35]. Although biased estimators can have a lower variance, in practice, if an asymptotically unbiased estimator has variance close to the CRLB, there is not much hope to improve the estimator (cf. [36]). Hence, the CRLB is defined first, and it is shown numerically that it agrees well with the variance of the estimator. Together with the results of [10,12,24,27] this provides a numerical proof that the MLE of the present model is efficient, i.e., its asymptotic variance reaches the CRLB.

Original model parameters.

The CRLB is the inverse expected Fisher information [34,35]. Given the model parameters and the log-likelihood function in (53), the Fisher information, denoted , is the square matrix with entries

where and are components of the vector (H being the total number of possible haplotypes, cf. Table 1). The expectation is taken with regard to the distribution of the observations . For the Fisher information it is more convenient to label haplotypes by integers, each haplotype is identified by its rank (see Table 1). In the context of this model, the parameter space is not an open set of , since the -dimensional simplex is not an open set in , as one of the haplotype frequency, e.g., can be written as a function of the others, i.e., ( denoting the frequency of the k-th haplotype). Results on the Fisher information require the parameter space to be an open set. Here, this can be resolved in two ways. First, one of the redundant parameters, e.g., , can be eliminated by substituting . Second, the model can be embedded into a higher dimensional space by introducing a nuisance parameter.

Although the first approach seems simple at first sight, typically, calculations are simpler in the second approach. For the present model, this became evident in the special case of a single marker (cf. [9]). Hence, this approach is also pursued for the present general case, and it is formally proved that both approaches are equivalent (see section Fisher information matrix in Supporting information S1 Appendix).

Following [9], we use a Lagrange multiplier as a nuisance parameter, by defining

(11)

The Lagrange multiplier guarantees that and the original likelihood function attain their maxima at the same point. Note, is not a log-likelihood function. It is defined formally for all points in an open real space, i.e.,

(12)

The equivalent of the Fisher information is defined as

(13)

where i and j are the i-th and j-th element of the vector . The expectation is formally taken with regard to , which in the higher-dimensional embedding might not be a probability distribution. Importantly, for inverting the above matrix, the rows and columns corresponding to the nuisance parameter need to be considered.

A detailed description of the derivation of the entries of the Fisher information is presented in section Entries of information matrix in higher dimensional space in Supporting information S1 Appendix. The entries are as follows

(14a)

where

Additionally,

(14b)

with

Moreover,

(14c)

and

(14d)

One also has

(14e)

Finally,

(14f)

and

Hence, the “Fisher information matrix” has the form

(15)

The results in Fisher information matrix in Supporting information S1 Appendix show that for any likelihood function, whose parameter space includes a simplex, the CRLB is given by the inverted high-dimensional embedded “Fisher information matrix” with the rows and columns corresponding to the nuisance parameters being disregarded after inversion. Here, this corresponds to disregarding the row and column corresponding to . This is denoted by

(16)

where the latter indicates that the row and column corresponding to are disregarded, and the resulting matrix is evaluated at an admissible parameter . This gives the asymptotic covariance matrix of the original model parameters and .

Mean MOI and haplotype frequencies.

In practice, the mean MOI is of more interest than the MOI parameter . The inverse Fisher information can be readily used to calculate the asymptotic covariance matrix of the mean MOI and haplotype frequencies. Namely, recall that . Let

(17)

denote the parameters of interest. Thus, the log-likelihood function in terms of the new parameters becomes

(18)

The “Fisher information” of the transformed parameter is defined as

(19)

where i and j are the i-th and j-th element of . Straightforward application of the chain rule gives

(20a)(20b)(20c)(20d)(20e)

and

(20f)

where

In compact form, this is written as

(21)

from which it is evident that the inverse matrix becomes

(22)

The asymptotic covariance matrix is again given by dropping the row and column corresponding to in (22).

Mean MOI and prevalences.

In practice, haplotype prevalences are sometimes of more interest than frequencies. The asymptotic variance of prevalences is derived from that of the original parameters by similar transformations as above. Namely, recall that the (true) prevalence of haplotype is given by . The transformed parameters

(23)

can be expressed in terms of the original parameters as

(24)

where the parameter transformation can be written as

(25)

with f defined as in (32b) and

(26)

(recall the equivalence between haplotypes and their rank h.)

The log-likelihood function expressed in terms of the transformed parameters becomes

where .

As above, application of the chain rule yields the entries of the “Fisher information” of the transformed parameters. Particularly,

(27)

where i and j are the i-th and j-th element of the transformed parameter vector . By using the chain rule, one obtains

(28a)(28b)(28c)(28d)(29e)

and

(28f)

where

and

Note that the Jacobian matrix of the transformation , with , denoted by J, allows to rewrite as

(29a)

where

More explicitely,

Therefore, the inverse of the matrix in (29a) is obtained as

(29b)

The inverse J-1 of the Jacobian matrix J is just

The inverse is the covariance matrix of the estimator and is obtained from (29b).

The observed information is derived in a similar way. It is defined by dropping the expectation in (13), and evaluating at the MLE. Although the derivations are not presented explicitly in Supporting information, the observed information is included in the implementation of the method (see Supporting information S2 Appendix).

Finite sample properties

Typically, maximum-likelihood estimators have convenient statistical properties. The proposed method was shown to have little bias under finite sample assuming the following genetic architectures: multiple biallelic loci [12], a single multiallelic locus [27], and two multiallelic loci [10]. Furthermore, for a single multiallelic locus the method was proven to be asymptotically unbiased as it falls within the class of exponential families [24]. In the general case of multiple multiallelic loci, due to the curse of dimensionality, it is impractical to systematically investigate bias, besides that it would add little to what is already known. Hence, here the finite sample properties of the variance of the estimator are investigated and compared with the asymptotic results of the last section (Asymptotic variance and covariance). Thus, the focus here is on the efficiency of the estimator. To make the discrepancy between the actual variance and the asymptotic predictions of the mean MOI comparable across the parameter range, variation is studied in terms of the coefficient of variation (CV) for mean MOI.

Numerical simulations yield a close agreement of estimated coefficient of variation of both the mean MOI and haplotype frequencies and their theoretical prediction (based on the CRLB) for sample size N > 50 (Figs 3 and 4). For a small sample size of N = 50 a higher discrepancy is observed, particularly for more complex genetic architectures (compare Fig 3A, 3C, and Fig 3B, 3D). Namely, a larger number of alleles per locus yields an increased number of haplotypes, such that these are likely to have an inaccurate representation of the true haplotype distribution in a dataset with a small sample size (N = 50). Consequently, the estimate is sensitive to outliers, resulting in high variance for the MOI estimate. Additionally, the variance of the haplotype frequency estimates increases (compared with the asymptotic approximation; see Fig 4).

thumbnail
Fig 3. Cramér-Rao lower bound for MOI estimates: Shown is the coefficient of variation (CV) of the mean MOI estimates in % as a function of the true mean MOI (i.e., for a range of MOI parameters).

The genetic architecture is in (A, C) and n1 = 4, n2 = 7 in (B, D). The frequency distribution in (A, B) is balanced while that in (C, D) is unbalanced. The different sample sizes are represented by the colors, the continuous lines are the CV from the MOI estimates and the dashed lines are the CV from the Cramér-Rao lower bound.

https://doi.org/10.1371/journal.pcbi.1012955.g003

thumbnail
Fig 4. Cramér-Rao lower bound (CRLB) for haplotype frequencies estimates: Shown is the standard deviation (continuous line) alongside the CRLB (dashed line) for the estimates of haplotype frequencies as a function of the true mean MOI (i.e., for a range of MOI parameters).

Panels (A, C) correspond to the estimation of a haplotype frequency whose true frequency is p = 0.25 assuming the genetic architecture . The case of the genetic architecture n1 = 4, n2 = 7 for a dominant haplotype with true frequency p = 0.7 is shown in panels (B, D). Notably, the true haplotype frequency distribution in (A, B) is balanced while that in (C, D) is unbalanced. The colors indicate the different sample sizes.

https://doi.org/10.1371/journal.pcbi.1012955.g004

In summary, the numerical investigations suggest that the estimators of haplotype frequencies and MOI are efficient, and the asymptotic variance is properly predicted by the CRLB if sample size is sufficiently large (). Note that in the context of malaria, sample sizes of are realistic.

Computational efficiency

Theoretically the method here is general in the sense that there are no restrictions on the number of markers or alleles per marker. However, in practice the method is restricted by computational limitations. Namely, the number of model parameters increases “exponentially” with the number of genetic markers. E.g., for n biallelic markers haplotypes have to be considered. Thus, for n = 2, 10, and 100 a total of 4, 1 024, and haplotypes have to be considered, respectively, with 9, 59 049, and possible observations. The total number of observations has to be considered only for the Fisher information (but not necessarily for the observed information), which becomes computationally infeasible. For the computation of the maximum-likelihood estimates (MLEs) all distinct observations in a given dataset and all their sub-observations have to be considered. In the worst case these are all possible observations. In the current implementation, a large number of markers will hence lead to memory overflow. Note, memory overflow, will manifest differently across operating systems. On Windows a memory limit is assigned directly in R (and can be manually increased), such that memory overflow will be indicated as an error. On Linux or macOS R has no internal memory limit, instead it is managed by the operating system itself. Memory overflow manifests in a program crash.

Here, data from the MalariaGen project [28] is used to explore the computational limitations of the method. First, the dataset on antimalarial drug resistance was utilized. The dataset consists of allelic information at L = 36 markers, i.e., codons at the Pfcrt, Pfdhfr, Pfdhps, Pfkelch13 and Pfmdr1 loci (see Methods), of 33 325 worldwide samples from several studies. This data was chosen because the genetic markers are not restricted to be biallelic. The dataset was divided into separate datasets by country, year, and study. Datasets with more than 20 samples and at least two polymorphic makers were retained, yielding a total of 110 unique datasets (see Methods). Importantly, the number of polymorphic markers per dataset ranged from L = 2 to L = 16. The MLE of MOI and haplotype frequencies were calculated for each dataset and the computational time was recorded.

The method converged for 108 datasets without the occurrence of memory overflow or numerical over- or underflow, specifically for those datasets with up to 13 polymorphic markers. Memory overflow occurred with the remaining 2 datasets with 15 and 16 polymorphic markers, respectively (in our cases R crashed when macOS with 8 GB RAM processor allocated around 30 GB RAM, i.e., 7 GB physical RAM and 23 GB SWAP memory – borrowed from the hard disk, leaving less than 1 GB physical RAM for the operating system to run). For the majority of datasets the method converged within a few seconds to minutes (Fig 5). However, for complex datasets, computational time reached several hours. Computational time increases almost exponentially with the maximum number of polymorphic markers per sample. This is expected since the algebraic operations in the algorithm (1a) and (1d) increases exponentially with the number of polymorphic markers in the dataset. The effect of sample size is not straightforward. With a large sample size, the occurrence of several samples with many polymorphic markers is more likely. Hence, there is a tendency that datasets with a larger sample size require more computational time. However, the exact running time depends on the specific structure of a dataset.

thumbnail
Fig 5. Bench-marking computational time on drug resistance data: Shown is the computational time in seconds (y-axis; log scale) as a function of the maximum number of polymorphic markers per sample (x-axis).

Each point shows the time for one of the 108 datasets, for which the method converged. Ranges of sample size are shown in different colors and shapes.

https://doi.org/10.1371/journal.pcbi.1012955.g005

As a second attempt to benchmark computational time in practice, the N = 228 samples from a study conducted in Cameroon in 2013 available in the Pf8 dataset of the MalariaGen project were used. The study was picked due to its realistic sample size and the fact that transmission was high in the study area, so that sufficient genetic variation is circulating. For these samples, all SNPs within a window ranging from -4.3kb to 4.3kb around Pfdhfr on chromosome 4 were extracted. The majority of these SNPs were monomorphic in this dataset. Starting from a window ranging from -0.1kb to 0.1kb around Pfdhfr, window size was increased in steps of 0.1kb upstream and downstream (cf. Fig 6). Samples without missing data in the respective window were retained. Hence, sample size decreased with increasing window size (the maximum sample size was N = 228 and the minimum N = 33). For larger window sizes, the number of polymorphic markers leads to memory overflow (R crashed on macOS as the system tried to allocate too much working memory to R). Notably, in practice sequencing errors need to be eliminated first in such data, which likely decreases the number of polymorphic markers, suggesting that SNPs within larger region can be included. The decay in sample size (cf. Fig 6) can be counteracted by imputing missing values. However, the experiment shows the computational feasibility of the method for relevant applications.

thumbnail
Fig 6. Computational time benchmark on whole genome sequencing data: Shown is the computational time in seconds (y-axis; log scale) as a function of the size of the window around Pfdhfr (up- and downstream; x-axis).

Each point shows the time for one of the corresponding datasets in a window from 0 to 8.6kb. Ranges of sample size are shown in different colors and shapes.

https://doi.org/10.1371/journal.pcbi.1012955.g006

Data application

Estimates of haplotype frequencies and MOI can be utilized for further population genetic analyses. This is illustrated using a P. falciparum dataset from Yaoundé, Cameroon [37]. The data was collected in 2001, 2002, 2004, and 2005. In the following analysis, the data is stratified into two groups: years 2001–2002 (N = 166) and 2004–2005 (N = 165). The dataset consists of markers associated with resistance against sulfadoxine-pyrimethamine (SP) in P. falciparum. Resistance to the fast-acting component pyrimethamine is determined by mutations at codons 51, 59, 108, and 164 in the Pfdhfr gene, while resistance to the slow-acting partner drug sulfadoxine is determined by mutations at codons 436, 437, 540, 581, and 613 in the Pfdhps gene [37].

The following analysis aims to estimate heterozygosity and pairwise-LD across 18 microsatellite markers on chromosomes 4 around Pfdhfr, 15 microsatellite markers around Pfdhps, as well as 8 neutral markers on chromosomes 2 and 3 [37]. Such analyses are useful to understand the spread of antimalarial drug resistance.

In standard population-genetic analyses, one considers past evolutionary processes, i.e., the variants under selection already reached fixation. This is different in the case of antimalarial drug resistance. Namely, one is interested in ongoing evolutionary processes, in which the mutations of interest have not yet reached fixation. Hence, all analyses need to be conditioned on the variants of interest. Otherwise, patterns of genetic hitchhiking and LD would be obstructed. In the present case, the variants of interest are haplotypes determined by Pfdhfr and Pfdhps mutations. To obtain a reasonable sample size, the following analyses are conditioned on haplotypes surpassing a threshold frequency of 10%.

To determine the frequencies of Pfdhfr and Pfdhps haplotypes, their frequencies were first estimated with the proposed method.

Frequency of resistance-associated haplotypes and MOI.

The frequencies of Pfdhfr and Pfdhps haplotypes at the two-time points are given in Table 2. At Pfdhfr, only the triple-mutant 51I/59R/108N/I164, conferring strong resistance, was detected with a frequency higher than 10% at both time points. This suggests widespread resistance to SP in Yaoundé from 2001 to 2005. At Pfdhps, the haplotypes 436A/A437/K540/A581/A613, S436/437G/K540/A581/A613 were detected at a frequency higher than 10% in the years 2001–2002, while the double-mutant haplotype 436A/437G/K540/A581/A613 also surpassed the 10% threshold in 2004–2005 suggesting ongoing selection for sulfadoxine resistance.

thumbnail
Table 2. Frequencies estimates of P. falciparum haplotypes associated with SP-resistance from data collected in Cameroon in years 2001-2002, and 2004-2005. Haplotype frequencies above the 10% threshold are marked with an asterisk (*) in both year groups.

https://doi.org/10.1371/journal.pcbi.1012955.t002

The estimates of the MOI parameter and 95% bootstrap confidence intervals (CIs) are presented in Table 3. Estimates were obtained at both time points, based on Pfdhfr markers, and Pfdhps markers, as well as the combined Pfdhfr and Pfdhps markers. The merit of the latter is the inclusion of more information, at the cost of a deflated sample size due to missing data. Because the narrowest CIs are obtained in this case, the gain of information outweighs the reduction in sample size. (This is not a general principle but will depend on the particular dataset.) The widest CIs are obtained for the estimates based only on Pfdhfr markers. The reason is the unbalanced haplotype frequency distribution (cf. Table 2).

thumbnail
Table 3. Mean MOI estimates () from data collected in Cameroon in years 2001-2002, and 2004-2005.

https://doi.org/10.1371/journal.pcbi.1012955.t003

Between 2001–2002 and 2004–2005, a slight reduction in MOI seems to be observed, although the CIs overlap by a great extent. Only for the estimates based on Pfdhps markers, there seems to be a very slight increase in MOI. This is presumably because the haplotype frequency distribution was less balanced in 2004–2005 (which also resulted in slightly wider CIs).

Note that it is preferable to estimate MOI from neutral markers rather than those under selection (cf. [27]). Allele frequency distribution at markers under selection will tend to be more unbalanced, with elevated major allele frequencies. (The selected alleles might even be fixed, or – as in the case of Pfdhfr codon 164 or Pfdhps codon 540 – the potentially selected mutant has not yet emerged.) Hence, the true underlying MOI will be poorly reflected in observations, resulting in frequent underestimations of MOI – and occasional outliers will lead to substantial overestimates (cf. [10,12]).

Prevalence of resistance-associated haplotypes.

For completeness, also estimates of haplotype prevalence are presented (Table 4). Due to the moderate value of the MOI parameters, frequency and prevalence are similar. Most discrepancies occur for the Pfdhps haplotypes in 2001–2002. This is clear from (4c) because the Pfdhps have the most balanced frequency distribution.

thumbnail
Table 4. Prevalence estimates of P. falciparum haplotypes associated with SP-resistance from data collected in Cameroon in years 2001-2002, and 2004-2005.

https://doi.org/10.1371/journal.pcbi.1012955.t004

Although the frequency of the single Pfdhps mutant haplotype S436/437G/K540/A581/A613 is below 50% in 2001–2002, its prevalence is estimated to be larger than 50%, implying that this variant was present in more than half of the infections.

Genetic hitchhiking.

Conditioned on the SP-resistant Pfdhfr triple-mutant haplotype 51I/59R/108N/I164, heterozygosity estimates are shown for the years 2001–2002 and 2004–2005 in Fig 7A and 7B, respectively. Heterozygosity was calculated for each microsatellite marker separately to retain the maximum possible sample size. (This is preferable because considering all microsatellite markers at the same time to calculate haplotype frequencies and then marginalizing to obtain allele frequency spectra for each marker would substantially deplete sample size. Namely, only samples without missing data at all loci could be retained. Nevertheless, analyzing markers separately still requires a method that allows for a general genetic architecture, since it is performed conditioned on Pfdhfr and Pfdhps haplotypes.)

thumbnail
Fig 7. Conditional heterozygosity at microsatellite markers: Shown are estimates of heterozygosity across several microsatellite markers located on chromosomes 2 and 3, as well as on chromosome 4 surrounding Pfdhfr and chromosome 8 surrounding Pfdhps (chromosomes are separated by the vertical dashed lines) conditioned on various Pfdhfr and Pfdhps haplotypes either in the years 2001-2002 or 2004-2005 (shown at the top of each panel).

Markers are ordered by their position in kilobases on the chromosomes. On chromosomes 4 and 8, the positions are relative to Pfdhfr and Pfdhps.

https://doi.org/10.1371/journal.pcbi.1012955.g007

Heterozygosity at markers surrounding Pfdhfr is low, compared with that at more distant markers, exposing a clear selective sweep, i.e., traces of selection acting on Pfdhfr. Heterozygosity appears slightly higher in 2004–2005 (compare Fig 7A and 7B). Although the differences are within the margin of error, heterozygosity is expected to increase over time. A drop in selection pressure could amplify this since treatment policy abandoned SP as first-line treatment in Cameroon in 2004 [37].

Such patterns are not as pronounced in Pfdhps but are still visible. The depletion in heterozygosity surrounding Pfdhps is slightly more pronounced around the S436/437G/K540/A581/A613 compared with the 436A/A437/K540/A581/A613 mutation at both time points, which corresponds to stronger selection for the S436/437G/K540/A581/A613 haplotype. The hitchhiking pattern flanking Pfdhps haplotypes corresponds to “soft selective sweeps” from recurrent mutations [38], i.e., the resistance-associated mutations emerged de novo or were imported several times at the background of different haplotypes. Such a soft-sweep pattern (with even higher heterozygosity) is also observed on the background of the 436A/437G/K540/A581/A613 double mutant (see Fig 7G). It is plausible that the A → G mutation at codon 437 occurred on the background of the single-mutant 436A/A437/K540/A581/A613, while at the same time, the S → A mutation at codon 436 occurred on the background of the S436/437G/K540/A581/A613 haplotype, leading to soft-sweeps from independent origins, which therefore retains the levels of genetic variation.

The patterns of genetic hitchhiking in combination with the frequency distribution of Pfdhfr and Pfdhps haplotypes suggest stronger selection for pyrimethamine resistance. This is intuitive since pyrimethamine is considered the fast-acting component of SP, and targeting Pfdhps with sulfonamides alone would not be sufficient for malaria chemotherapy. Pyrimethamine was used as a monotherapy in the 1950s in some countries [39]. This suggests that resistance to pyrimethamine started to evolve earlier than resistance against sulfadoxine.

Pairwise linkage-disequilibrium.

Conditional pairwise LD-values are obtained using r2 (and as a comparison). LD is calculated at both time points for each pair of markers conditioned on the Pfdhfr triple mutant 51I/59R/108N/I164 at Pfdhfr (Fig 8A, 8B), and the Pfdhps single mutants 436A/A437/K540/A581/A613 (Fig 8C, 8D) and S436/437G/K540/A581/A613 (Fig 8E, 8F), as well as on the Pfdhps double mutant 436A/437G/K540/A581/A613 at the second time point (Fig 8G).

thumbnail
Fig 8. Conditional LD at microsatellite markers: As in Fig 7 but for pairwise-LD values calculated with r2.

https://doi.org/10.1371/journal.pcbi.1012955.g008

Multiallelic LD measures are notoriously difficult to interpret and often uninformative. Conditioned on the Pfdhfr triple mutant, only slight LD is observed flanking Pfdhfr and Pfdhps (Fig 8A, 8B). This suggests that the triple mutant was predominant for long enough to allow recombination to restore linkage equilibrium (LE). Note that microsatellite markers are highly variable and fast-evolving, hence recombination and mutation will tend to restore genetic variation. This is particularly true given the results on heterozygosity, which suggest soft selective sweeps around Pfdhps variants. This is confirmed by looking at LD conditioned at the Pfdhps mutations. Conditioned on these, pairwise LD is more pronounced around Pfdhfr than around Pfdhps, on the one hand reflecting the soft sweep nature of Pfdhps mutations, on the other hand exposing signatures of selection around Pfdhfr (most haplotypes are linked to the triple mutant, which is predominant). This suggests that different variants flanking Pfdhfr were affected by the soft sweeps at Pfdhps. These patterns will overlap and camouflage the traces of selection when conditioning only on the Pfdhfr triple mutant. (Note that conditioning on joint Pfdhfr and Pfdhps haplotypes is impractical here due to missing data, which would substantially reduce sample size.)

The patterns of LD flanking Pfdhfr and Pfdhps are most pronounced conditioned on the Pfdhps double mutant, which (as it is mainly linked to the predominant Pfdhfr triple mutant) experiences the highest selective pressure.

Although multiallelic LD in terms of r2 is hardly informative on the underlying evolutionary process in this case, it is at least intuitive. This is different for the measure (Fig 9). In fact, leads to counterintuitive results, with the highest levels of LD between neutral markers at chromosomes 2 and 3, and lower LD flanking the loci under selection. These observations are purely an artifact of a small sample size. Namely, a large number of alleles are segregating at these markers. For example, two markers with, e.g., n1 = 20 and n2 = 25 alleles, would lead to 500 possible haplotypes. If all haplotypes had a frequency of 0.002, the markers would be in perfect LE. However, when taking a sample of size N = 165, the vast majority of haplotypes will not be sampled, while it is highly likely to sample all alleles at both markers. This leads to high LD values (i.e., most of the terms in (64a) equal to 1). Thus, will tend to overestimate LD for highly polymorphic markers unless sample size is unrealistically large. This problem does not occur around markers flanking targets of selection, because polymorphism is reduced, i.e., the number of alleles segregating at these markers is substantially lower. This artifact is also seen when comparing conditioned on the Pfdhfr triple mutant vs. other mutants which are subject to weaker selection (Fig 8A, 8B vs. 8C-8G). Namely, genetic hitchhiking, which in the case of malaria can be genome-wide [40], reduces polymorphism at neutral markers. This effect is more pronounced, conditioned on variants under stronger selection, thereby mitigating the undesired behavior of for highly polymorphic markers in small samples.

thumbnail
Fig 9. Conditional LD at microsatellite markers: As in Fig 7 but for pairwise-LD values calculated with .

https://doi.org/10.1371/journal.pcbi.1012955.g009

Discussion

Due to advancements in molecular/genetic assays over the past decades, molecular disease surveillance has become increasingly feasible and popular. Here, a method to estimate pathogen variant (haplotype) frequencies and multiplicity of infection (MOI) was introduced.

The method extends those of [8,10,12] to accommodate a general genetic architecture, i.e., pathogen variants are characterized by an arbitrary number of multiallelic markers (loci). Following [810,12,31], MOI is defined as the number of super-infections with the same or different pathogen variants (cf. [2] for a detailed discussion). This only approximates co-infections, i.e., the co-transmission of different pathogen variants during the same infective event (cf. Fig 10). From a mathematical point of view, the statistical model estimates the distribution of independent pathogen variants within an infection (which is assumed to follow a conditional Poisson distribution). The assumption of independence reflects the concept of super-infections, which are independent, whereas the pathogen variants being co-transmitted are not independent. If co-infections are sufficiently rare, the assumption of independent variants is justified.

thumbnail
Fig 10. Super- and co-infections: Illustrated is the difference between super- and co-infections in the case of vector-borne diseases.

(A) shows 4 super-infections (MOI = 4) with pathogenic variants, i.e., four independent infective events. At each infective event, one pathogenic variant is transmitted. Pathogenic variants are characterized genetically by their allelic expressions (colors) at three positions (shapes) in the genome, which is illustrated by the horizontal lines. Note that MOI = 4, although only three distinct haplotypes are transmitted because two vectors transmit the same pathogenic variant. (B) illustrates a co-infection with three pathogenic variants, i.e., a single infective event at which three pathogenic variants are transmitted. (C) illustrates a super-infection with two different pathogens, illustrated by different shapes, transmitted by different vector species.

https://doi.org/10.1371/journal.pcbi.1012955.g010

The applications provided here are concerned with P. falciparum. However, the method is applicable to all human-pathogenic malaria species (cf. [41] for a more detailed discussion). Furthermore, the method is also applicable to infections caused by other eukaryotic parasites such as Trypanosoma, Toxoplasma, and Schistosoma, and bacteria such as Mycobacterium, which evolve at a rate at which it is possible to determine a stable number of genetically distinct variants during the course of an infection.

First, the underlying probabilistic model was derived. Because it does not allow a closed-form solution, the EM algorithm was employed to derive an efficient numerical iteration to obtain the maximum likelihood estimates. Furthermore, formulae for prevalence were derived.

Whereas frequency refers to the relative abundance of a pathogen variant in the pathogen population, prevalence refers to the probability that the variant is present in an infection. Prevalence is more relevant for clinical and epidemiological considerations. Although the terms prevalence and frequency are sometimes used synonymously in the literature, they are different. In the absence of multiple infections, frequency and prevalence coincide. However, due to MOI prevalence always exceeds frequency (cf. [2]).

Commonly, molecular/genetic data is not phased, i.e., haplotype information is missing. As a consequence, molecular data is ambiguous regarding the haplotypes actually present in an infection. In the case of malaria, often heuristic ad-hoc approaches are used to derive haplotype prevalence based only on unambiguous information. To relate the formal statistical approach to these heuristic ones, formulae for prevalence from unambiguous observations were also derived here.

The asymptotic covariances, i.e., the inverse Fisher information, were derived for the model parameters (haplotype frequency and MOI parameter) and their transforms in terms of prevalence and mean MOI. Although the Fisher information was derived explicitly, it was not possible to provide analytic expressions for its inverse. Importantly, two alternative approaches to derive the Fisher information were employed. First, a nuisance parameter was introduced to embed the parameter space into a higher-dimensional open set in a real space. Second, a redundant parameter was eliminated (the haplotype frequencies are elements of the simplex and hence dependent) to reduce the parameter space to an open set in a lower-dimensional real space. This leads to different information matrices. It was shown that both approaches are equivalent and that corresponding entries of the inverse information matrices coincide. The same arguments apply to the observed information. Although it is not explicitly derived here, the steps are explained, and it is incorporated in the implementation in R.

By numerical simulations, [12] and [10] already showed that the method has little bias in special cases, which vanishes with increasing sample size, suggesting that the method is asymptotically unbiased. Here, these results were complemented, focusing on the bias of haplotype frequencies. Furthermore, it was numerically verified that the covariances of the estimator are well approximated by the inverse Fisher information (Cramér-Rao lower bound; CRLB). Simulations showed that the variance of the estimator (for haplotype frequencies and MOI) agrees well with the CRLB even for moderate sample sizes (). The largest discrepancies occur if sample size is small (N < 100) and MOI is high. This is less problematic in practice since larger sample sizes should be feasible in high transmission areas. The CRLB defines the minimum variance of an unbiased estimator. The fact that the covariance matrix of the estimator is well approximated by the inverse Fisher information for finite sample size suggests that the proposed method has desirable asymptotic properties.

Application of the method was illustrated by analyzing a Plasmodium falciparum dataset consisting of genetic markers associated with resistance to sulfadoxine-pyrimethamine (SP), caused by point mutations in the Pfdhfr and Pfdhps genes. First, the frequencies and prevalence of resistance-associated haplotypes were derived. In a second step, heterozygosity and pairwise linkage disequilibrium (LD) across microsatellite markers flanking the loci associated with resistance were calculated. These calculations were performed conditioned on specific Pfdhfr and Pfdhps haplotypes. These analyses were performed to showcase that the MOI and haplotype frequency estimates can be utilized for further population genetic analysis. The example also highlighted the pathological behavior of one multiallelic measure of LD (D’). Importantly, the analysis required estimates of haplotypes, determined by a general genetic architecture (multiple multiallelic markers). The special cases of the proposed method published earlier [9,10,12] are insufficient for such analyses. The method in [9] allows only for a single multiallelic marker and is only appropriate to estimate allele frequencies and overall heterozygosity (i.e., not stratified on specific mutational backgrounds). In [12], multiple biallelic markers are assumed, which is sufficient to derive frequencies of resistance-associated haplotypes (as long as they are characterized by biallelic markers), but insufficient to derive heterozygosity of multiallelic markers. Pairwise linkage-disequilibria (LD) can be derived using the special case in [10], however since only two multiallelic markers are allowed, pairwise LD can only be calculated for the whole population, but not stratified on a specific mutational background. The generalization here allows for such analysis.

The method is designed for haploid pathogens. This is hardly a restriction given that many pathogens, including viruses, bacteria, protozoa, etc., are haploid. Nevertheless, the method can be extended to be applicable to diploid or polyploid pathogens, although the relevance of such generalizations is limited.

Besides the promising properties of the proposed method, there are several shortcomings. Unlike in the case of a single molecular marker, there is no formal proof of existence, uniqueness, asymptotic unbiasedness, consistency, and efficiency. For a genetic architecture of a single molecular marker, the model can be rewritten as a natural steep exponential family, which proves the desired properties (importantly, existence and uniqueness hold except in degenerate cases, e.g., if one variant is found in all samples). For two or more markers, the sum in (48a) does not factorize accordingly. However, the agreement between the CRLB and the variance of the estimator determined by simulations suggests that the estimator is efficient. Moreover, the fact that bias decreases with sample size suggests asymptotic unbiasedness (which also suggests uniqueness of the estimator).

MOI is assumed to follow a conditional Poisson distribution, which might be inappropriate if MOI is over-dispersed. Intuitively, a negative binomial distribution seems more appropriate. However, in [21] it was pointed out that the likelihood estimation of negative binomial data is problematic, as the model seems to have degenerate behavior. (This readily occurs for maximum likelihood estimation of negative binomially distributed data. Specifically, the MLE will yield the limit of a Poisson distribution, if the data is not sufficiently over-dispersed.) As an alternative, [21] assumed a non-parametric distribution of MOI, which is the most flexible model. Except for extreme cases, this model did not outperform the Poisson model, suggesting that the assumption of Poisson-distributed MOI is justified.

The estimators can be improved by applying bias correction as in [23] in the case of a single marker. This led to an improvement in the bias of the MOI parameter (the gain for marker frequencies is marginal, as these are hardly biased). Such bias corrections might be tedious in the present model. As an alternative, parametric or non-parametric bootstrap bias corrections can be applied (cf. [42]).

Another shortcoming of the model is its inability to handle missing data. Namely, observations that lack information at one or more markers need to be disregarded. This yields a tradeoff between the confidence in the estimates and the number of molecular markers included. Namely, while the addition of more markers increases information, it also deflates sample size due to missing data and increases the number of model parameters geometrically. For a single marker, [24] proposed a model that incorporates missing information. This method was only superior to ignoring missing information if these were common. Incorporating missing information for a general genetic architecture leads to combinatorial difficulties in practice. In particular, all possible observations would need to be considered. Assuming 10 markers with 10 alleles per marker yields possible observations. For the same reason, a mutational model is not included in the current method. For computational feasibility, restrictions and approximations would need to be applied to the probabilistic model to render it numerically feasible. An alternative to incorporate missing data would be to impute missing information. This can be readily achieved by estimating the model parameters first by disregarding missing information, and then using these estimates to impute missing information for each sample separately based on the marginalization of the distribution over the markers with missing information. In the final step, the estimates would be updated by those of the imputed dataset. A similar approach can be conducted to include assay errors. After obtaining estimates from the original data, a parametric bootstrap approach can be used to generate simulated datasets subject to mutational models.

The method presented here is “exact” in the sense that (assuming no errors in the data) it includes all haplotypes which can theoretically exist. Alternative models, e.g., DEploid, assume a reference haplotype panel [19]. For a smaller genetic architecture, it is desirable to allow all haplotypes to avoid biasing the estimates towards higher MOI. For example, consider the case of 3 biallelic markers. If in a reference panel only the haplotypes (1,1,1), (1,2,1), and (2,1,2) are present, the observation ({1,2},{1,2},{1,2}) must have MOI . On the contrary, if all possible haplotypes are included, the minimum MOI is m = 2 (e.g., haplotypes (1,1,1) and (2,2,2) are infecting). However, the inclusion of all haplotypes becomes unrealistic for a complex genetic architecture. E.g., with 30 STR markers with 10 alleles each, 1030 haplotypes are possible. Assuming a maximum number of 1012 parasites within an infection and 500 million infections per year, the number of possible haplotypes exceeds the number of haplotypes that have ever existed by orders of magnitude. Hence, there is a tradeoff between when to use an exact or approximate method. Moreover, the exact method will yield some frequency estimates that are well below the numerical precision. These can be safely rounded to zero without jeopardizing the accuracy of the remaining frequencies. As a rule of thumb, whenever the data is numerically feasible for the current model implementation, the use of an “exact” is appropriate.

Concerning numerical feasibility, the method is appropriate for a moderate number of molecular markers, with a moderate number of alleles per marker. Whether the method is feasible for a particular genetic architecture depends crucially on the underlying dataset. As an example, assume 20 biallelic SNPs. Further assume that only two haplotypes are present, the wildtype and mutant (these differ at all 20 SNPs). If both haplotypes occur in an infection, the formula for the resulting observation considers all 1048576 possible haplotypes, which give rise to more than 3.5 billion summands in equation (48a). In practice, such observations do not occur, and a genetic architecture of more than 20 SNPs is feasible.

In any case, the supported genetic architectures are insufficient to study relatedness of haplotypes within an infection (cf. [4348]). Relatedness is important to distinguish super- from co-infections. Here, co-infections are ignored and only approximated by super-infections (cf. [27] for a more detailed discussion). If co-infections dominate transmission (cf. [44]), the method here is no longer valid. In such a case, the assumption of independent haplotypes within infections is violated. To resolve this problem, knowledge of the distribution of co-infecting haplotypes would be required. Such information could be generated from additionally collecting samples from mosquitoes or from modelling host-vector and vector-host transmission explicitly. In any case, even if the assumptions of the method are violated, it will mainly affect the estimates of MOI. The reason is that MOI is defined as the number of independent transmission events, and this will be detached from the number of circulating haplotypes in infections if they are frequently co-transmitted. However, phasing of the haplotypes will be less affected. Hence, even if relatedness within infections is important, the method can be used to phase haplotypes and obtain frequency estimates at the population level, but the MOI estimates should be ignored then.

Note that the model could be approximated by considering prior knowledge on haplotypes likely to be detected in the area of the study and disregarding those that likely do not exist. Making such assumptions can lead to substantially more efficient numerical implementations in terms of computational time and the complexity of feasible genetic architectures. Models such as DEploid [19] and coiaf [20] use a similar approach and rely on some prior knowledge of reference panels, and minor allele frequencies, respectively, to estimate haplotype frequencies and complexity of infection (COI) from a large number of biallelic markers (SNPs) in a reasonable time.

The proposed method does not correct for errors in the data, e.g., sequencing errors. While this is a limitation, it also avoids introducing bias. Namely, the method is not restricted to a particular type of molecular/genetic data. Errors occurring in STR and SNP data are different and have to be handled accordingly. Users who have reasons to question the quality of their data are advised to modify their data according to an appropriate mutational model several times and repeat the analysis for each modified dataset. This approach allows to ascertain how sensitive the model estimates are to errors in the data. This is of particular importance when aiming to analyze whole genome sequencing datasets, e.g., the open access dataset of Plasmodium falciparum genome variation from the MalariaGen project, consisting of 33 325 worldwide samples (cf. [28]).

Here, a maximum-likelihood approach was pursued. Bayesian alternatives can be readily implemented and should be in good agreement as long as an uninformative prior distribution is used.

Besides the limitations, the proposed method is valuable for population genetic analysis of infectious diseases, similar to malaria, for a limited amount of molecular data, which is frequently collected in practice. An efficient implementation of the model is provided as an R script in the supplement, on GitHub https://github.com/Maths-against-Malaria/generalModel.git and Zenodo at https://doi.org/10.5281/zenodo.14452432 (cf. [29]). Moreover, detailed documentation of the R script with examples is provided.

Methods

Model background

The objective is to estimate the distributions of multiplicity of infection (MOI) and pathogen lineages for infectious diseases similar to malaria. Here, maximum-likelihood estimation is used. Although the following is not confined to malaria, this example is used to motivate the statistical model.

Here, the term multiplicity of infection refers to the number of super-infections during one disease episode, i.e., to the number of independent infectious events with potentially different variants of the same pathogen (see Fig 10A). Importantly, it is assumed that during an infectious event, only one pathogen variant is transmitted. This is different from co-infections, which refer to the co-transmission of several pathogen variants during one infectious event (see Fig 10B). Importantly, super-infections with different pathogen variants rather than with different pathogens are considered (cf. Fig 10A and 10C).

‘In what follows, the terms “pathogens variants”, “lineages”, and “haplotypes” are used synonymously.

Statistical model

Genetic architecture.

Pathogen haplotypes are characterized by their allelic configuration at L marker loci. Haplotypes are denoted by vectors , where represents one of the possible alleles at locus k. This yields a total of possible haplotypes. The set of all possible haplotypes is given by (see illustration Fig 11A).

thumbnail
Fig 11. Genetic architecture and haplotype ranking: Panel (A) shows for a given genetic architecture (i.e., three loci with two, four, and three alleles at the first, second, and third locus, respectively), all the haplotypes that could be present in the pathogen population.

Each shape represents a locus, and each color is an allele at a given locus. All the possible haplotypes alongside their vector and mix-radix representations, i.e., ranking, are shown in panel (B).

https://doi.org/10.1371/journal.pcbi.1012955.g011

In the following, it will be convenient to label (rank) haplotypes by the numbers . The rank of hapotype is denoted by . A natural way of ranking is to assume that is the mixed-radix representation [49] of the rank with base (see Fig 11B). More precisely,

(30a)

with

(30b)

Ranking haplotypes has the advantage that each haplotype can be uniquely identified with its rank . While this is not necessary for the model derivation, it is the basis of an efficient model implementation.

The relative abundance of haplotype in the pathogen’s population is denoted by , or if is the k-th haplotype, i.e., if . Collectively, the vector of haplotype frequencies is denoted by

This notation implies that the set of haplotypes is regarded as ordered by the haplotype ranks.

Importantly, the number H of possible haplotypes increases “geometrically” with the number of loci L and alleles , . However, only a subset of possible haplotypes will be realized in the pathogen population, i.e., for some (or if L large, most) haplotypes. It is assumed that the genetic architecture already subsumes all possible haplotypes so that mutational events do not need to be considered. In malaria, the pathogen population (or rather its reference point) is the population of sporozoites within the mosquitoes’ salivary glands [9,10].

Distribution of MOI.

MOI, which is sometimes also referred to as complexity of infection (COI) [4,50,51], is defined here as the number of independent infectious events during one disease episode, assuming that exactly one pathogen variant (haplotype) is transmitted at each event (see Fig 12). Notably, MOI does not refer to the number of distinct pathogen variants within an infection but to the number of infectious events, i.e., a host can be infected with the same pathogen variant multiple times (see Fig 12). Because it cannot be decided in practice how often a given pathogen variant infected a host, MOI is an unobservable quantity. Note that this definition of MOI coincides with the one from [8,9] (cf. [2,23] for more discussion).

thumbnail
Fig 12. MOI and number of haplotypes: Illustrated are three hypothetical infections with pathogenic variants.

Panel A shows four super-infections (cf. Fig 10A), i.e., MOI = 4, with four different haplotypes. Panel B shows four super-infections (MOI = 4) with three different haplotypes. Panel C illustrates three super-infections (MOI = 3) with two different pathogenic variants.

https://doi.org/10.1371/journal.pcbi.1012955.g012

Let the distribution of MOI on the population level be denoted by

(31)

In the following, only disease-positive individuals are considered, hence .

The intuitive assumption is that infective events are rare and independent. This implies that MOI follows a conditional Poisson distribution, i.e.,

(32a)

where is the parameter characterizing the distribution. Clearly, other distributions can be assumed. In malaria, for instance, exposure to mosquitoes might be heterogeneous across different groups in the population. Even if MOI is Poisson distributed in each group, in the total population MOI would then correspond to a mixture of Poisson distributions. In the limit case of infinitely many population strata, such that the Poisson parameter follows a gamma distribution across the strata, MOI would follow a conditional negative binomial distribution. The negative binomial distribution at first might seem more appropriate than the conditional Poisson distribution, as it fits empirical observations of mosquito biting behavior better (cf. [52]). However, as noted in [21], maximum likelihood estimation of the negative binomial distribution is problematic (cf. also [53]) as the maximum-likelihood estimate does not exist if the empirical observations are not overdispersed. (Note also that a negative binomially distributed biting rate does not necessarily imply that the number of infective events is negatively binomially distributed – in fact, these might be well approximated by the Poisson distribution). As an alternative, [21] explored a non-parametric MOI distribution (in the simple case of one marker locus, L = 1). This is the most flexible assumption. Their results suggest that even for rather overdispersed true MOI distributions, a statistical model based on the Poisson distribution performs similarly to their non-parametric alternative. As a consequence, in what follows, it is assumed that MOI follows a conditional Poisson distribution.

The mean of the conditional Poisson distribution is given by

(32b)

This parameter also characterizes the conditional Poisson distribution and is more intuitive than , as it is the average number of times infected individuals are super-infected.

Infections.

Since a host can be super-infected multiple times with the same haplotype, an infection corresponds to the MOI vector , where is the number of times the host was infected with haplotype . Because only one haplotype is transmitted per infectious event, the MOI value of infection is .

Super-infections are assumed to be independent, i.e., given a host is infected with the pathogen, the host is not more or less likely to be infected again during the same disease episode. As a consequence, the probability of observing infection , given it has MOI , follows a multinomial distribution with parameters m and , i.e., . Hence,

(33)

m haplotypes are drawn with replacement from the pathogen population according to their relative abundances .

Observations.

As mentioned above, MOI is an unobservable quantity, because an infection is itself unobservable, as it cannot be distinguished how often each haplotype was infecting. At most, the absence or presence of haplotypes can be observed, i.e., at most is observable. However, in practice, pathogenic variants within an infection are determined by molecular assays. These typically generate unphased haplotype information, i.e., they generate consensus sequences that only distinguish the allelic variants at each marker locus, rather than determining the actual haplotypes present (see Fig 13 for an illustration). In other words, at each marker locus, only the absence and presence of the alleles are observable.

thumbnail
Fig 13. Observable and unobservable information: Illustration shows three different infections from the same pathogen population.

The first infection (middle left) describes a super-infection with two haplotypes, i.e., MOI = 2. The haplotype combination generates unphased haplotype information, i.e., ambiguous observation (bottom left). In this case, haplotype present in the observation cannot be reconstructed, as well as the corresponding MOI. The second infection (middle), illustrates a super-infection with four haplotypes, three of which are transmitted once, while the fourth one is transmitted twice, i.e., MOI = 5. The resulting observation and MOI are ambiguous. The last infection (middle right) involves two haplotypes, i.e., MOI = 2, with resulting unphased haplotype information.

https://doi.org/10.1371/journal.pcbi.1012955.g013

The observable allelic information in a disease-positive sample is denoted by the vector , where is the set of alleles detected at locus k, i.e.,

(34)

Here, denotes the power set. Hence, the components of are sets (corresponding to 0–1 vectors of length ; this correspondence is also illustrated in Fig 2). Note that cannot be the empty set, because we only consider disease-positive samples, and we assume the molecular assays to be free of errors (no missing or wrong information, cf. [24]). Therefore, a proper sample is one for which at least one allele is detected at each of the L loci. Consequently, the observational space is given by the set of all possible observations, i.e., as

(35)

Note that different infections can yield the same observation (see Fig 1). Given MOI m, the set of all possible MOI vectors vectors that lead to is denoted by

(36)

Distribution of observations.

Two definitions are helpful to derive the probability distribution of the observations . First, the set of all haplotypes which are compatible with observation , i.e.,

(37a)

(When using the correspondence of to a 0–1 vector, corresponds to , where is the -th component of the 0–1 vector.) Hence, if , haplotype is potentially present in the infection underlying observation , while cannot be present. Second, the set of all sub-observations of , i.e.,

(37b)

(When using the correspondence of and to a 0–1 vector, corresponds to , where the inequality is understood componentwise.) Hence, for a sub-observation in , any haplotype that is compatible with observation is also compatible with observation , i.e., if , then .

The probability of observation given MOI = m > 0 is

(38a)

where is the probability of descending from an infection with MOI = m > 0 and is the probability of MOI = m. Recall that for in , yields . Hence, the law of total probability gives

(38b)

and

(38c)

The probability mass function in (38c) can be further manipulated using the approach described in [12]. Namely, the partial order

(39)

is defined on the set . (Since the components of an observation correspond to 0–1 vectors corresponds to , where the inequality is understood componentwise.) Note, is equivalent to . The set can be expressed as

(40)

Here, infections in the first set yield either observation or a proper sub-observation . The MOI vectors that correspond to such proper sub-observations are removed by the second term.

Using the above, the inner-sum in (38c) can be rewritten using the inclusion-exclusion principle as

(41)

where and are respectively, the cardinals of , and . Note that and . Hence,

(42)

Therefore, the probability mass function in (38c) becomes

(43)

By the multinomial theorem, we have

(44)

which can be replaced in (43) to give

(45)(46)

The inner-sum in (46) is the probability-generating function (PGF) of the MOI distribution, evaluated at . We denote the probability-generating function by G such that

(47)

Therefore, the probability of observing is given by

(48a)

In the case that MOI follows a conditional Poisson distribution (as assumed here),

(48b)

Under this assumption, the parameter space of the model is

(49)

where is an -dimensional simplex, and is a positive real number.

Datasets and likelihood function.

A typical molecular dataset consists of N samples in the observational space (35). I.e., N set-valued vectors with L components corresponding to alleles detected at each of the L markers. The j-th sample is denoted by using a superscript, i.e., , where is the allelic information at locus k.

Let be the number of times each observation is made in the dataset. Hence,

(50)

Consequently, the dataset can be represented as the integer-valued vector

(51)

This representation will be repeatedly used in the following derivations. Note that for increased number of loci L and number of alleles , not all possible observations are detected, i.e., exceeds the sample size N. Therefore, for most observations .

Given , the model parameters can be collectively estimated by maximum likelihood. Because the N samples are assumed to be independent and identically distributed, the likelihood function is

(52)

and the -likelihood function becomes

(53)

The maximum likelihood estimate (MLE) of the model parameters is obtained by maximizing the -likelihood function. A closed solution for the MLE is typically not possible, particularly for this complex likelihood function. In fact, a closed solution is not even possible in the simplest case of a single molecular marker (cf. [9,24]).

Here, the expectation-maximization (EM)-algorithm is used to derive the MLE. It is an efficient, stable, and fast-converging algorithm to maximize the likelihood function [26]. The algorithm is derived in section Maximum likelihood estimate.

Because the MLE needs to be derived numerically, it is impossible to obtain analytic results about the quality of the estimator. Particularly, bias and variance cannot be determined explicitly. However, these can be assessed numerically as it was done for the special cases of (i) a single molecular marker (L = 1) [27], (ii) L biallelic markers [12], and (iii) two multiallelic markers (L = 2) [10]. The results suggested that the estimator is asymptotically unbiased, and its asymptotic variance is given by the Cramér-Rao lower bound (CRLB). This is confirmed by asymptotic results in the special case of a single marker (L = 1), in which case, the model falls into the exponential-family class. Given these facts, the present estimator can be considered asymptotically unbiased and efficient. However, for the asymptotic variance, the CRLB has to be derived for the present general case.

Numerical investigation of finite sample properties

Finite sample properties of the estimator are investigated by numerical simulations.

dataset generation.

datasets are created following Fig 13. Specifically, for a choice of the parameters and , a dataset of size N is created by first sampling N MOI values (m(i), ) according to a conditional Poisson distribution. Next, N MOI vectors () are drawn from multinomial distributions with parameters m(i) and . From each MOI vector , the observation is created by retaining only the information concerning the absence and presence of alleles at each marker.

For each set of parameters , this procedure is repeated K = 100 000 times to generate K datasets of sample size N.

Simulated variance.

Given a set of parameters , , and N, for each of the K datasets , the MLEs are calculated and the estimate of the mean MOI is derived. Next, the variance of the estimator for a parameter of interest, , is calculated as the empirical variance, i.e.,

(54a)

where

(54b)

To allow comparison between different true values of the MOI parameter , the variation of the mean MOI parameter is reported as the coefficient of variation (CV), i.e.,

(55a)

whereas the variation of the haplotype frequencies is reported in terms of the empirical standard deviation . These quantities are compared to the appropriate transforms of the CRLB, i.e., to and .

Parameter choices for numerical investigations.

The following parameters are chosen for numerical investigations.

Genetic architecture.

Two markers (n = 2) are assumed. Moreover, for the simulations, and loci are chosen, leading respectively to H = 4 and H = 28 possible haplotypes.

MOI parameter

The choice of MOI parameters is made to represent different levels of transmission intensities. With malaria in mind, MOI parameters are chosen as , corresponding to mean MOI . Note that corresponds to low transmission, to intermediate transmission and to high transmission [23].

Haplotype frequency distribution

The distribution of haplotype frequency is chosen to mimic two extreme cases:

(i) a uniform (balanced) distribution such that

(56a)

and (ii) an unbalanced distribution for which one haplotype, e.g., p1 is predominant with a frequency of 70%, while the remaining haplotypes have the same frequency, i.e.,

(56b)

In particular, for the chosen genetic architectures, this gives in the case and in the case n1 = 4 and n2 = 7.

Sample size

Sample sizes N = 50, 100, 150, 200, 500 are chosen for the simulations. Note, in practice, sample size correlates with transmission intensity. In areas of low disease transmission, it is more challenging to achieve a large sample size, whereas this is much easier in areas of high transmission.

Population genetic measures

In a population of size N the expected heterozygosity at locus l with segregating alleles (), each with frequency , is given by

(57)

Note that is obtained by marginalization of the frequencies of haplotypes containing allele at locus l, i.e.,

(58)

the sum of the frequencies of all haplotypes, which carry allele at locus l.

Consider a subset of loci and a specific allelic configuration (), i.e., a “sub-haplotype” determined by its allelic configuration at the markers in set S. One can calculate the heterozygosity at locus l, conditioned on the background of the sub-haplotype . The marginal frequency of allele () at locus l is given by

(59)

The heterozygosity conditioned on is then given by

(60)

Pairwise LD can be obtained from several metrics (cf. [54,55]). Here, with no particular preference, two of these commonly used metrics, i.e., r2 (also known as ) and are reported. The LD metric between two loci k and l is obtained based on the Hardy-Weinberg heterozygosities and at loci k and l, respectively, as

(61)

where measures the discrepancy between the observed frequency of sub-haplotype and its expected frequency under random association.

The measure is defined in [54,55] as

(62a)

where

(62b)

Restricted to the background of a given sub-haplotype , the LD measures are based on conditional allele frequencies defined as in (59). The conditional LD measures and are defined by

(63a)

with

(63b)

and

(64a)

with

(64b)(64c)

and

(64d)

Benchmarking computational time

Data from the MalariaGen project [28] was utilized to investigate the performance of the proposed method. In particular, data from the current release of the P. falciparum data (Pf8) was used. This dataset contains whole genome information on 33 325 P. falciparum specimens and is substantially more comprehensive than the prior version Pf7 [56]. Two numerical experiments were performed.

The first one used the prepared data on drug resistance. We split that data by country, year, and study and retained all resulting datasets with more than 20 samples. We included genetic information from Pfcrt codons 72–76 (used as microhaplotype), 93, 97, 218, 220, 271, 326, 333, 353, 356, and 371, Pfdhfr codons 16, 51, 59, 108, 164, and 306, Pfdhps codons 436, 437, 540, 581, and 613, Pfmdr1 codons 81, 184, 1034, 1042, 1126, 1246, Pfexo codon 415, Pfarps10 codons 127 and 128, Pffd codon 193, Pfmdr2 codon 484, non-synonymous changes in Pfkelch13 codons 349–726 (used as microhaplotype), as well as duplication status in Pfmdr1 and Pfpm2. For the purpose here, duplications were treated as alleles, i.e., absence/presence of duplicates. This resulted in a total of L = 36 molecular markers. Several of these markers are multiallelic.

The data needed some preliminary steps of data cleaning. Several data entries were marked as low quality. These were included here to increase sample size and the number of polymorphic markers, since the purpose of the numerical experiment was to test the proposed method.

For the second experiment, genetic information for the samples collected in Cameroon in 2013 was used. All SNPs within 4.3kb up- and downstream from Pfdhfr on chromosome 4 were extracted. Only those SNPs that were polymorphic in the data were retained. All resulting SNPs were biallelic. The data was then used to create several derived datasets. The first derived dataset included all SNPs within -0.1kb to 0.1kb Pfdhfr. This window was then increased in steps of 0.1kb up- and downstream until the final window size of -4.3kb to 4.3kb. In each dataset only samples with complete information were retained. Hence, sample size of the datasets decreased with increasing window size.

In both experiments, the MLE was calculated for each dataset, and the computational time was recorded. All computations were performed using R.4.4.1 on a MacBook Pro (OS: Sequoia 15.5, CPU: Apple M1 8-core CPU with 4 3.2 GHz performance cores and 4 2.1 GHz efficiency cores, RAM: 8 GB, storage: 500 GB).

Supporting information

S1 Data. Zip file containing an implementation of the model as an R script, a template R script with commands to use for data analysis using the method, and an example molecular dataset.

https://doi.org/10.1371/journal.pcbi.1012955.s003

(ZIP)

Acknowledgments

The authors gratefully acknowledge the African Institute for Mathematical Sciences (AIMS) Cameroon for supporting the meeting between the authors and this research. The many fruitful discussions with friends and colleagues that helped to improve the manuscript were highly appreciated. The constructive comments of two anonymous reviewers are gratefully acknowledged. The content is solely the responsibility of the authors and does not represent the official views of anybody.

References

  1. 1. Koudokpon H, Lègba B, Sintondji K, Kissira I, Kounou A, Guindo I, et al. Empowering public health: building advanced molecular surveillance in resource-limited settings through collaboration and capacity-building. Front Health Serv. 2024;4:1289394. pmid:38957804
  2. 2. Schneider KA, Tsoungui Obama HCJ, Kamanga G, Kayanula L, Adil Mahmoud Yousif N. The many definitions of multiplicity of infection. Front Epidemiol. 2022;2:961593. pmid:38455332
  3. 3. Tusting LS, Bousema T, Smith DL, Drakeley C. Measuring changes in Plasmodium falciparum transmission: precision, accuracy and costs of metrics. Adv Parasitol. 2014;84:151–208. pmid:24480314
  4. 4. Sondo P, Derra K, Rouamba T, Nakanabo Diallo S, Taconet P, Kazienga A, et al. Determinants of Plasmodium falciparum multiplicity of infection and genetic diversity in Burkina Faso. Parasit Vectors. 2020;13(1):427. pmid:32819420
  5. 5. Sinha A, Kar S, Deora N, Dash M, Tiwari A, Kori L, et al. India-EMBO Lecture Course: Understanding Malaria from Molecular Epidemiology, Population Genetics, and Evolutionary Perspectives. Trends Parasitol. 2023;39(5):307–13.
  6. 6. McCollum AM, Schneider KA, Griffing SM, Zhou Z, Kariuki S, Ter-Kuile F, et al. Differences in selective pressure on dhps and dhfr drug resistant mutations in western Kenya. Malar J. 2012;11:77. pmid:22439637
  7. 7. Nash D, Nair S, Mayxay M, Newton PN, Guthmann J-P, Nosten F, et al. Selection strength and hitchhiking around two anti-malarial resistance genes. Proc Biol Sci. 2005;272(1568):1153–61. pmid:16024377
  8. 8. Hill WG, Babiker HA. Estimation of numbers of malaria clones in blood samples. Proc Biol Sci. 1995;262(1365):249–57. pmid:8587883
  9. 9. Schneider KA, Escalante AA. A likelihood approach to estimate the number of co-infections. PLoS One. 2014;9(7):e97899. pmid:24988302
  10. 10. Tsoungui Obama HCJ, Schneider KA. Estimating multiplicity of infection, haplotype frequencies, and linkage disequilibria from multi-allelic markers for molecular disease surveillance. PLoS One. 2025;20(5):e0321723. pmid:40424286
  11. 11. Galinsky K, Valim C, Salmier A, de Thoisy B, Musset L, Legrand E, et al. COIL: a methodology for evaluating malarial complexity of infection using likelihood from single nucleotide polymorphism data. Malar J. 2015;14:4. pmid:25599890
  12. 12. Tsoungui Obama HCJ, Schneider KA. A maximum-likelihood method to estimate haplotype frequencies and prevalence alongside multiplicity of infection from SNP data. Front Epidemiol. 2022;2:943625. pmid:38455338
  13. 13. Li X, Foulkes AS, Yucel RM, Rich SM. An expectation maximization approach to estimate malaria haplotype frequencies in multiply infected children. Stat Appl Genet Mol Biol. 2007;6:Article33. pmid:18052916
  14. 14. Chang H-H, Worby CJ, Yeka A, Nankabirwa J, Kamya MR, Staedke SG, et al. THE REAL McCOIL: A method for the concurrent estimation of the complexity of infection and SNP allele frequency for malaria parasites. PLoS Comput Biol. 2017;13(1):e1005348. pmid:28125584
  15. 15. Hastings IM, Smith TA. MalHaploFreq: a computer programme for estimating malaria haplotype frequencies from blood samples. Malar J. 2008;7:130. pmid:18627599
  16. 16. Wigger L, Vogt JE, Roth V. Malaria haplotype frequency estimation. Stat Med. 2013;32(21):3737–51. pmid:23609602
  17. 17. Kuk AYC, Li X, Xu J. An EM algorithm based on an internal list for estimating haplotype distributions of rare variants from pooled genotype data. BMC Genet. 2013;14:82. pmid:24034507
  18. 18. Ken-Dror G, Hastings IM. Markov chain Monte Carlo and expectation maximization approaches for estimation of haplotype frequencies for multiply infected human blood samples. Malar J. 2016;15(1):430. pmid:27557806
  19. 19. Zhu SJ, Almagro-Garcia J, McVean G. Deconvolution of multiple infections in Plasmodium falciparum from high throughput sequencing data. Bioinformatics. 2018;34(1):9–15. pmid:28961721
  20. 20. Paschalidis A, Watson OJ, Aydemir O, Verity R, Bailey JA. coiaf: Directly estimating complexity of infection with allele frequencies. PLoS Comput Biol. 2023;19(6):e1010247. pmid:37294835
  21. 21. Kayanula L, Schneider KA. A non-parametric approach to estimate multiplicity of infection (MOI) and pathogen haplotype frequencies. Front Malar. 2024;2.
  22. 22. Ross A, Koepfli C, Li X, Schoepflin S, Siba P, Mueller I, et al. Estimating the numbers of malaria infections in blood samples using high-resolution genotyping data. PLoS One. 2012;7(8):e42496. pmid:22952595
  23. 23. Hashemi M, Schneider KA. Bias-corrected maximum-likelihood estimation of multiplicity of infection and lineage frequencies. PLoS One. 2021;16(12):e0261889. pmid:34965279
  24. 24. Hashemi M, Schneider KA. Estimating multiplicity of infection, allele frequencies, and prevalences accounting for incomplete data. PLoS One. 2024;19(3):e0287161. pmid:38512826
  25. 25. Dempster AP, Laird NM, Rubin DB. Maximum Likelihood from Incomplete Data Via the EM Algorithm. J R Stat Soc Series B Stat Methodol. 1977;39(1):1–22.
  26. 26. Excoffier L, Slatkin M. Maximum-likelihood estimation of molecular haplotype frequencies in a diploid population. Mol Biol Evol. 1995;12(5):921–7. pmid:7476138
  27. 27. Schneider KA. Large and finite sample properties of a maximum-likelihood estimator for multiplicity of infection. PLoS One. 2018;13(4):e0194148. pmid:29630605
  28. 28. MalariaGen MM, Abdel Hamid M, Abdelraheem M, Acheampong D, Adam I, Aide P, et al. Pf8: an open dataset of Plasmodium falciparum genome variation in 33,325 worldwide samples [version 1; peer review: 1 approved]. Wellcome Open Res. 2025;10(325).
  29. 29. Tsoungui Obama HCJ, Schneider KA. Maths-against-Malaria/generalModel: v1.0.0. Zenodo; 2024.
  30. 30. Daniels R, Volkman SK, Milner DA, Mahesh N, Neafsey DE, Park DJ, et al. A general SNP-based molecular barcode for Plasmodium falciparum identification and tracking. Malar J. 2008;7:223. pmid:18959790
  31. 31. Pacheco MA, Forero-Peña DA, Schneider KA, Chavero M, Gamardo A, Figuera L, et al. Malaria in Venezuela: changes in the complexity of infection reflects the increment in transmission intensity. Malar J. 2020;19(1):176. pmid:32380999
  32. 32. de Cesare M, Mwenda M, Jeffreys AE, Chirwa J, Drakeley C, Schneider K, et al. Flexible and cost-effective genomic surveillance of P. falciparum malaria with targeted nanopore sequencing. Nat Commun. 2024;15(1):1413. pmid:38360754
  33. 33. Holzschuh A, Lerch A, Nsanzabana C. Rapid multiplexed nanopore amplicon sequencing to distinguish Plasmodium falciparum recrudescence from new infection in antimalarial drug trials. Sci Rep. 2025;15(1):36941. pmid:41125674
  34. 34. Pathak PK. Introduction to Rao (1945) information and the accuracy attainable in the estimation of statistical parameters. In: Kotz S, Johnson NL, editors. Breakthroughs in Statistics: Foundations and Basic Theory. New York (NY): Springer; 1992. p. 227–34.
  35. 35. Nielsen F. Cramér-Rao lower bound and information geometry. In: Bhatia R, Rajan CS, Singh AI, editors. Connected at infinity II: A selection of mathematics by Indians. Gurgaon: Hindustan Book Agency; 2013. p. 18–37.
  36. 36. Davison AC. Statistical Models. Cambridge: Cambridge University Press; 2003.
  37. 37. McCollum AM, Basco LK, Tahar R, Udhayakumar V, Escalante AA. Hitchhiking and selective sweeps of Plasmodium falciparum sulfadoxine and pyrimethamine resistance alleles in a population from central Africa. Antimicrob Agents Chemother. 2008;52(11):4089–97. pmid:18765692
  38. 38. Nair S, Nash D, Sudimack D, Jaidee A, Barends M, Uhlemann A-C, et al. Recurrent gene amplification and soft selective sweeps during evolution of multidrug resistance in malaria parasites. Mol Biol Evol. 2007;24(2):562–73. pmid:17124182
  39. 39. Contreras CE, Cortese JF, Caraballo A, Plowe CV. Genetics of drug-resistant Plasmodium falciparum malaria in the Venezuelan state of Bolivar. Am J Trop Med Hygiene. 2002;67(4):400–5.
  40. 40. Schneider KA, Kim Y. An analytical model for genetic hitchhiking in the evolution of antimalarial drug resistance. Theor Popul Biol. 2010;78(2):93–108. pmid:20600206
  41. 41. Schneider KA, Salas CJ. Evolutionary genetics of malaria. Front Genet. 2022;13.
  42. 42. Efron B, Tibshirani RJ. An introduction to the bootstrap. New York: Chapman and Hall/CRC; 1994.
  43. 43. Nkhoma SC, Nair S, Cheeseman IH, Rohr-Allegrini C, Singlam S, Nosten F, et al. Close kinship within multiple-genotype malaria parasite infections. Proc Biol Sci. 2012;279(1738):2589–98. pmid:22398165
  44. 44. Wong W, Wenger EA, Hartl DL, Wirth DF. Modeling the genetic relatedness of Plasmodium falciparum parasites following meiotic recombination and cotransmission. PLoS Comput Biol. 2018;14(1):e1005923. pmid:29315306
  45. 45. Nkhoma SC, Trevino SG, Gorena KM, Nair S, Khoswe S, Jett C, et al. Co-transmission of Related Malaria Parasite Lineages Shapes Within-Host Parasite Diversity. Cell Host Microbe. 2020;27(1):93–103.e4. pmid:31901523
  46. 46. Neafsey DE, Taylor AR, MacInnis BL. Advances and opportunities in malaria population genomics. Nat Rev Genet. 2021;22(8):502–17. pmid:33833443
  47. 47. Dia A, Cheeseman IH. Single-Cell Genome Sequencing of Protozoan Parasites. Trends in Parasitology. 2021;37(9):803–14.
  48. 48. Zhu SJ, Hendry JA, Almagro-Garcia J, Pearson RD, Amato R, Miles A, et al. The Origins and Relatedness Structure of Mixed Infections Vary with Local Prevalence of P. Falciparum Malaria. eLife. 2019;8:e40845.
  49. 49. Komerup P. Digit-set conversions: generalizations and applications. IEEE Trans Comput. 1994;43(5).
  50. 50. Taylor AR, Flegg JA, Nsobya SL, Yeka A, Kamya MR, Rosenthal PJ, et al. Estimation of malaria haplotype and genotype frequencies: a statistical approach to overcome the challenge associated with multiclonal infections. Malar J. 2014;13:102. pmid:24636676
  51. 51. Assefa SA, Preston MD, Campino S, Ocholla H, Sutherland CJ, Clark TG. estMOI: estimating multiplicity of infection using parasite deep sequencing data. Bioinformatics. 2014;30(9):1292–4. pmid:24443379
  52. 52. Irvine MA, Kazura JW, Hollingsworth TD, Reimer LJ. Understanding heterogeneities in mosquito-bite exposure and infection distributions for the elimination of lymphatic filariasis. Proc Biol Sci. 2018;285(1871):20172253. pmid:29386362
  53. 53. Adamidis K. Theory & Methods: An EM algorithm for estimating negative binomial parameters. Aus NZ J Stat. 1999;41(2):213–21.
  54. 54. Hedrick PW. Gametic disequilibrium measures: proceed with caution. Genetics. 1987;117(2):331–41. pmid:3666445
  55. 55. Zhao H, Nettleton D, Dekkers JCM. Evaluation of linkage disequilibrium measures between multi-allelic markers as predictors of linkage disequilibrium between single nucleotide polymorphisms. Genet Res. 2007;89(1):1–6. pmid:17517154
  56. 56. MalariaGEN MM, Abdel Hamid MM, Abdelraheem MH, Acheampong DO, Ahouidi A, Ali M, et al. Pf7: an open dataset of Plasmodium falciparum genome variation in 20,000 worldwide samples. Wellcome Open Res. 2023;8:22. pmid:36864926