Abstract
Motivation
Longitudinal pathogen genotyping data from individual hosts can uncover strain-specific infection dynamics and their relationships to disease and intervention, especially in the malaria field. An important use case involves distinguishing newly incident from pre-existing (persistent) strains, but implementation faces statistical challenges relating to individual samples containing multiple strains, strains sharing alleles, and markers dropping out stochastically during the genotyping process. Current approaches to distinguish new versus persistent strains therefore rely primarily on simple rules that consider only the time since alleles were last observed.
Results
We developed DINEMITES (Distinguishing New Malaria Infections in Time Series), a set of statistical methods to estimate, from longitudinal genotyping data, the probability each sequenced allele represents a new infection harboring that allele, the total molecular force of infection (molFOI, the cumulative number of newly acquired strains over time) for each individual, and the total number of new infection events for each individual. DINEMITES can handle time points with missing sequencing data, incorporate treatment history and covariates affecting the rate of new or persistent infections, and can scale to studies with thousands of samples sequenced across multiple loci containing hundreds of possible alleles. In synthetic evaluations, the DINEMITES Bayesian model, which generally outperformed an alternative clustering-based model also developed in this work, accurately estimated key clinical parameters such as molFOI (bias 2.5, compared to −12.2 for a typical simple rule). When applied to three real longitudinal genotyping datasets, the model detected 33%, 112%, and 359% more average infections per participant than would have been detected by applying a typical simple rule to the equivalent datasets without sequencing.
Introduction
Pathogen genetic analysis is key to understanding infectious disease dynamics, especially for diseases such as malaria in which the etiological agent (Plasmodium spp.) comprises multiple strains which can co-infect individual hosts. In the malaria field, cross-sectional population genetic analyses are frequently used to track Plasmodium parasite population connectivity, identify polymorphisms linked to therapeutic resistance, and monitor the dispersal of such variants.1, 2, 3, 4 There is also interest in the potential for longitudinal genotypic analyses to elucidate within-host malaria infection dynamics, especially in the context of intervention efficacy trials.5, 6, 7, 8, 9 Such trials sample participants serially over the course of months to years to evaluate whether the intervention (e.g., a monoclonal antibody or vaccine) effectively blocks new infections.
Genotypic data have the potential to be particularly informative for longitudinal infectious disease studies because they can both inform how many unique pathogen strains were present during an infection and distinguish new from pre-existing or recrudescent infections, neither of which is possible with binary (presence/absence) infection detection methods such as microscopy or (q)PCR. However, several methodological and statistical challenges remain to be addressed to obtain the maximum information available from such data for pathogens such as Plasmodium.
One challenge for interpreting longitudinal Plasmodium genotyping data is presented by polyclonal infections, in which two or more genetically distinct strains simultaneously infect a host. The complexity of infection (COI; the number of distinct co-infecting strains) is often epidemiologically important but estimating COI is complicated by factors such as partial genetic relatedness of co-infecting parasite lineages and the choice of which loci to sequence, among other factors.10, 11, 12 Previous methods have been developed to deconvolve infections from independent samples (e.g., studies with one sample per individual) to estimate COI,13, 14, 15 but longitudinal studies clearly involve non-independent samples because the same individuals are sampled repeatedly over time.
Whether infections are monoclonal or polyclonal, a statistically informed approach is needed to distinguish new from persistent strain infections. This capacity would inform malaria intervention studies, where the efficacy could be measured as cumulative protection against infection over time rather than simply time to the first infection or case, or via other metrics such as strain-level asymptomatic infection duration.5, 16, 17, 18 However, this task presents statistical challenges since alleles observed repeatedly can come from either persistent infections or new infections with the same allele. Furthermore, alleles can stochastically be missed during sequencing due to low pathogen abundance, even when an infection is detectable using more sensitive molecular methods such as ultra-sensitive qRT-PCR.19 Historically, studies have typically identified new infections from such data using simple evidence-informed rules based on the time since the last detected infection.5, 6, 8, 20, 21 The few existing statistical methods addressing this application are limited by the fact that they address new infections only at an aggregate level rather than the strain level; only analyze a small number of time points per subject; do not account for the challenge of detection-positive but sequencing-absent samples; require entire genomes; or are locus- or study-specific.22, 23, 24
To bridge this gap, we introduce DINEMITES (Distinguishing New Malaria Infections in Time Series) to estimate, from longitudinal genotyping data, (1) the probability each sequenced allele represents a new infection with that allele, (2) the molecular force of infection for each individual (molFOI, the cumulative number of newly acquired strains over time), and (3) the total number of new infection events for each individual. Additionally, DINEMITES handles detection-positive (e.g., via qPCR) but sequencing-absent time points and scales to studies involving hundreds of participants with dozens of time points each, sequenced across multiple loci containing hundreds of possible alleles. DINEMITES, along with its source code, documentation, tutorials, and example data sets, is freely available at https://github.com/WillNickols/dinemites.
Results
Here, we present DINEMITES, a set of computational tools for analyzing longitudinal infection genotyping data. DINEMITES takes as input the pathogen genotyping results for each individual at each time point, along with (optionally) a record of samples which are known to be pathogen-positive but lack sequencing data, a record of when individuals were treated for the pathogen, and other infection-modifying covariates such as season, insecticide net usage, and vaccination status (Fig. 1A). The software outputs the probability each sequenced allele belongs to a new infection, the per-individual molFOI, the per-individual number of new infection events, and plots visualizing the time series for each individual.
Figure 1. Statistical methods distinguish alleles from new versus persistent infections in longitudinal genotyping data.
A. Longitudinal genotyping data consist of multiple time points (vertical dashed lines) at which subjects provided blood spots. From these, multiple loci (horizontal panes) are sequenced to detect alleles (crosses if present), sometimes occurring repeatedly over time (indicated by horizontal lines). Some time points (e.g., day 96) involve polyclonal infections, but not all loci have the same number of alleles. Some time points are only known to be pathogen-positive by qRT-PCR but have no genotyping information (red dashes, day 124). Participants are sometimes treated for the pathogen (blue dashes). This example is from subject 0266R of a CIS43LS monoclonal antibody study.16 B. Some time points are only known to be positive (P) for an infection but do not have genotyping information (missingness). The multiple imputation procedure uses the available data with genotyping (alleles displayed as 1 if present, blank if absent) to build a table of how frequently each missingness pattern could be generated by the complete data and uses this to impute the missing data. C. The Bayesian model determines the probability an allele is new by comparing the probability of observing the allele due to a new infection to the probability of observing the allele at all, the latter being increased after a previous detection. D. The clustering model creates a graph from co-occurrence of the alleles, clusters the edges to infer infection events, performs likelihood maximization to estimate the probability each cluster was present on each day, and computes the probability an allele was new based on how likely it was to be present in each cluster and how likely each cluster was to be new on each day.
In some studies, a subset of samples are known to be pathogen-positive but do not have genotyping data, either because a more sensitive detection method was used alongside genotyping (e.g., qPCR or qRT-PCR5, 6, 16, 19) or because only some samples were chosen for genotyping (e.g., to reduce costs). Such samples are hereafter referred to as missing (distinct from samples for which no data are available). To handle such samples, a multiple imputation procedure25 uses the portion of the data with complete genotyping information to build a table of how often each missingness pattern could be generated by the complete data (Fig. 1B, Methods). These frequencies are then used to sample specific alleles at the missing time points, creating multiple complete datasets which are analyzed uniformly but separately, from which the results are ultimately aggregated. To determine whether each sequenced allele is new in a complete or imputed dataset, one of three methods is applied: (1) a simple rule that defines an allele as persistent if it has been recently observed, (2) a Bayesian model that compares the probability of a new infection by that allele to the probability of observing that allele after a prior infection (Fig. 1C), or (3) a clustering model that uses allele co-occurrence to define likely infection events (Fig. 1D, Methods).
A Bayesian model with multiple imputation outperforms other models on synthetic data
To evaluate the ability of DINEMITES to accurately classify infections as new or persistent, synthetic longitudinal genotyping datasets were generated in which each allele was known to come from a new or persistent infection. The genotyping data were generated according to either a model with probabilities of infections that updated at each time point based on the previous time points (”rolling presence probability”) or a model with infections lasting for variable time periods sampled from a Poisson distribution (”Poisson time to clearance”) (Supplementary Information). These datasets were created to simulate high-transmission settings with common occurrences of superinfection (new infection in the presence of persistent infection) and polyclonality (multiple alleles present at a single locus, which corresponds to multiple strains occurring because Plasmodium parasites are haploid in the blood stage). To mimic missingness in real genotyping data, varying proportions of the genotyping-positive time points were masked so that they were only known to be infection-positive (qPCR positive). Then, with and without the imputation strategy, the Bayesian model, the clustering model, and a simple rule were applied to the datasets to determine the probability each sequenced allele at each time point for each person (hereafter, an ”allele”) represented a new infection by a parasite strain with that allele (Methods). Once probabilities were assigned, alleles were grouped into probability bins (0 to 10%, 10 to 20%, etc., probability of being new), and the proportion of alleles in that bin that were actually new was compared to the bin’s center (average of its endpoints) and weighted by the number of alleles in each bin to compute the probability error.
Without any missing time points, the Bayesian model produced the least biased probabilities for both the rolling presence probability synthetic datasets (1% overestimation versus 4% and 7% underestimation for the simple and clustering models) and the Poisson time to clearance synthetic datasets (3% overestimation versus 11% and 14% underestimation for the simple and clustering models). The clustering model and the simple rule were more likely to mistake repeated observation of a common allele as representing a persistent, rather than a new, infection (Fig. 2A). When the proportion of missing time points increased, if the imputation strategy was not used, the predicted probability increased substantially (by 10%-20% over the qPCR range for the models on the rolling presence probability data and 16%-21% for the Poisson time to clearance data) since the missingness-induced gaps appeared as long time periods without previously-observed alleles. However, with the imputation strategy, the predicted probabilities changed much less (1%-5% decrease for any model over the qPCR range), showing that the imputation procedure mitigates bias due to missingness.
Figure 2. The Bayesian model with the multiple imputation strategy produces approximately unbiased estimates of key infection parameters.
Fifty synthetic datasets were generated, each with 200 subjects, an average of 20 evenly spaced time points per subject, one locus with 100 alleles, and varying proportions of sequencing positive samples masked as qPCR-positive only to mimic missingness. New infections were generated according to allele-specific probabilities with non-specific dependencies designed to yield polyclonal infections. Persistent infections were generated according to two data generating models: a ”rolling presence probability” model in which the probability an allele was present and persistent was determined at each time point by the allele’s history, and a ”Poisson time to clearance” model in which infections were set to have Poisson-length times to clearance. The Bayesian, clustering, and simple models were applied to each dataset, with or without multiple imputation. A. Alleles (across all datasets) were binned by their assigned probabilities into intervals of width 10%, and the centers of these bins were compared to the proportion of the alleles in the bin that were actually new, yielding a probability error weighted by the number of alleles in each bin. B. The per-subject molFOI was estimated for each subject in each dataset and compared to the true number of new strains (one allele per strain) with which the person was infected across the time points. C. The per-subject number of new infection events was estimated for each subject in each dataset and compared to the true number of new infections across the time points. The error mean ± SD across the subjects and datasets is shown. The probability errors do not have standard deviations because alleles from all subjects and datasets were binned together. Points closer to 0 are better.
The outcomes of interest from longitudinal genotyping studies typically involve metrics such as molFOI and the total number of new infection events per individual over the study period. Therefore, the probabilities assigned by each method were aggregated to estimate these parameters (Methods). As before, the Bayesian model produced the least biased estimates of these parameters, and the multiple imputation procedure reduced bias when the dataset contained missing samples (Fig. 2B–C). Furthermore, regarding absolute error, the Bayesian model with imputation uniformly estimated the most accurate probabilities, molFOI, and number of new infections across both data types, save that it was slightly less accurate than the simple model at estimating new infections in the Poisson time to clearance data with few missing samples (0.76 vs 0.50 infections from the truth on average with complete data, Sup. Fig. 1).
To test the robustness of these results, the number of subjects per datasets, the number of alleles sequenced, and the model properties affecting the rate of new infections were varied (Supplementary Information). In general, the Bayesian model was robust to variations in the underlying data and typically produced the most accurate results on all metrics, though the clustering model was the most accurate at estimating the number of new infection events for simulations with either low allele counts (20 and 50) or treatment for infections (Sup. Figs. 2–3).
When using multiple loci, choosing the most variable locus after genotyping maximizes accuracy
To improve new strain detection, it is common for studies to involve genotyping multiple loci instead of a single locus.9, 16, 26 Because alleles at different loci can correspond to the same strain, two de-duplication strategies are implemented to determine the molFOI, which are applied after determining allele-specific probabilities (Methods, Sup. Fig. 4). First, the ”sum then max” procedure first determines the molFOI for each locus and then chooses the locus with the maximum molFOI for each individual. Second, the ”max then sum” procedure first determines the locus with the most new alleles at each time point and then adds these maxima over the time points. As expected, the max then sum method always estimated higher molFOI values, though both methods still underestimated the molFOI when applied after the clustering and simple models (Sup. Fig. 5). When applied after the Bayesian model, the max then sum method overestimated the molFOI with any number of loci while the sum then max method estimated correctly with two loci but underestimated with five loci. Still, the sum then max method with the Bayesian model produced the lowest absolute error with one, two, or five loci.
The max then sum method is expected to be least accurate when the loci are sequenced incompletely, spreading the detection of new alleles from a single infection over multiple days. Therefore, the methods were applied to simulations with five loci and varying drop-out rates—the proportion of alleles first sequenced on the second, rather than the first, time point after a new infection. As expected, with higher drop-out rates, the max then sum method increasingly overestimated the molFOI, and its absolute error was only lower than that of the sum then max method when there was no drop-out (Sup. Fig. 6). This suggests that, in general, the sum then max method should be used.
All methods produce highly consistent results on real data, which are frequently unambiguous
To evaluate these methods on real data, three longitudinal malaria genotyping datasets were analyzed: a CIS43LS monoclonal antibody trial cohort,16 a 2011 Malian cohort,9 and a Ugandan cohort.5 The CIS43LS monoclonal antibody trial cohort (348 participants, 5529 time points total) was sampled approximately every two weeks with more frequent sampling in the first weeks of the trial, and samples were analyzed with both qRT-PCR and amplicon sequencing of 6 loci (316 alleles total). The 2011 Malian cohort (648 participants, 5741 time points total) was sampled approximately every two weeks, and samples were analyzed with amplicon sequencing of four loci (548 alleles total) only (i.e., no qPCR). The Ugandan cohort (477 participants, 10884 time points total) was sampled approximately every four weeks for two years, and samples were analyzed with both qPCR and amplicon sequencing of a single locus (45 alleles). Since the CIS43LS trial cohort and Ugandan cohort data included qPCR data (146 of 1014 and 326 of 1187 infection-positive time points were qPCR positive but failed to produce amplicon sequencing data, respectively), multiple imputation was used to create fifty imputed datasets. Then, the Bayesian, clustering, and simple models were run on each dataset (Methods). The first two time points for each individual were excluded from analysis because any alleles present could have represented either new or persistent infections. The CIS43LS cohort was characterized by moderate transmission, short infections, and low sequencing drop-out (an estimated 28% of alleles were unobserved when likely present) (Fig. 3A). The 2011 Malian cohort was characterized by high transmission, short infections, and high sequencing drop-out (73%) (Sup. Fig. 7). The Ugandan cohort was characterized by low transmission, very long infections, and low sequencing drop-out (20%) (Sup. Fig. 8).
Figure 3. Probabilities assigned to the real datasets are biologically plausible and agree across models.
A. The default DINEMITES vizualization shows the infection course for the same individual as in Fig. 1A with one horizontal pane per locus and one row per allele. Vertical dashed lines mark days when the subject provided blood spots, and dots indicate alleles present in genotyping, connected horizontally if observed repeatedly. Fifty imputed datasets were used, and alleles at missing time points (red dashes, day 124) are opaque proportional to their probability of being present as determined in the imputation process. Treatments for malaria are marked with blue dashes. Probabilities that the alleles were from new infections were assigned using the Bayesian model with parameters for study phase, seasonality, treatment, and previous infections (ever and in the previous 30, 60, and 90 days). Sequenced alleles are marked with solid circles if their average assigned probabilities of being new are over 50%, and they are marked with open circles otherwise. The probability of the allele being new is only displayed under the point if the probability is between 20% and 80%. The pan-locus new alleles (top strip) are calculated by multiplying the probability an allele was present and the probability the allele was new and summing these products over all alleles at each time point. The prevalence on the right is the proportion of sequenced infections in the dataset in which the allele is present. B. Correlations between the probabilities assigned by each model on each dataset for present alleles.
The probabilities assigned to each sequenced allele were broadly consistent, with correlations at least 0.70 for all pairs of methods on all datasets (Fig. 3B). The probabilities were even more consistent for the CIS43LS cohort and Ugandan cohort, likely due to a combination of more accurate genotyping and the use of the same imputed datasets across methods. Notably, this consistency largely came from the abundance of unambiguous alleles (clearly new or clearly persistent). When subset to alleles assigned probabilities between 5% and 95% by both the Bayesian and clustering methods, the correlations ranged from 0.49 to 0.68 on the CIS43LS cohort data and from 0.14 to 0.55 on the 2011 Malian cohort data compared to 0.91-0.94 and 0.70-0.84 with the full data. When the Ugandan cohort was subset in this way, only 12 of the original 1570 sequenced alleles remained since the alleles from this cohort were almost always categorized as new or persistent with very high confidence.
Next, the probabilities were aggregated to estimate the molFOI and number of infections for each dataset (Fig. 4A–B). The results were highly consistent across methods for both the molFOI (correlations 0.92 to 1.00 across the methods and datasets) and the number of new infections (correlations 0.85 to 0.99). The largest differences among the models came from estimating the number of new infections in the Ugandan cohort data since there were frequently instances in which an allele was observed, subsequently not observed for at least three time points, and then observed again (25 instances out of the 126 sequences in which such a pattern could be observed). The simple rule classified these as new infections while the clustering model and the Bayesian model classified these as persistent infections, using the fact that new infections were very rare in this cohort: on average, there were 0.23 new infections per subject with an average of 612 days of observation per subject. Because the 2011 Malian cohort sequencing likely had a high sequencing drop-out rate, a modified Bayesian model was also applied that allowed for drop-out (Supplementary Information). As expected, the probability each allele was new, the estimated molFOI, and the estimated number of new infections were all lower with the model allowing drop-out, with the estimated molFOI reduced from 7.9 to 4.9 on average and the estimated number of new infections reduced from 3.2 to 2.1 (Sup. Fig. 9).
Figure 4. Cumulative infection metrics agreed across models.
A. Using the sum then max method, the molFOI was estimated for all subjects in each cohort. All subjects not plotted had molFOI values of zero assigned by all models. Insets show the correlations in the estimated molFOI across the Bayesian (B), clustering (C), and simple (S) models. B. The number of new infection events was estimated for all subjects in each cohort. All subjects not plotted had no infections estimated by all models. Insets show the correlations in the estimated new infections across the models. C. The number of infections predicted by the Bayesian model with all loci sequenced or only the most variable locus sequenced was compared to the count from simply classifying infections as new if no infection had been observed in the previous three time points (i.e., sequencing agnostic).
Finally, to evaluate the combined improvements of sequencing and applying more rigorous statistical methods, the number of infection events was compared between (1) the Bayesian model applied to the full genotyping data or the most variable locus versus (2) a simple rule (the infection is new if not observed in the previous 3 time points) applied to the infection presence/absence data that would have been generated without sequencing. Notably, one strategy might detect no infections while the other detects at least one because the first two time points for each subject were excluded, and subsequent infections might be classified as the same as at those excluded times. Among subjects with at least one infection detected by either the simple rule or genotyping, there were an average of 0.92 infections detected by the simple rule but 1.95 detected by genotyping (112% increase) in the CIS43LS cohort, 0.74 versus 3.45 (359% increase) in the 2011 Malian cohort, and 0.58 versus 0.77 (33% increase) in the Ugandan cohort (Fig. 4C). Even when restricting the analysis to only the single locus with the most unique alleles in the CIS43LS and 2011 Malian cohorts, there were 85% and 327% more infections detected on average. Thus, the combination of genotyping and more rigorous statistical methods can substantially improve the detection of new infections.
Discussion
Longitudinal cohorts sequenced for infectious diseases can answer many biological questions more precisely, but the data they generate can create analytical challenges due to the complicated dependencies between time points, the effect of variable pathogen loads on sequencing success, and uncertainty regarding how best to aggregate allele-specific information into clinical endpoints. Furthermore, previous analyses have relied on plausible but untested assumptions about how long pathogens can remain present but undetected to distinguish new from persistent infections.5, 6, 8, 20, 21 Distinguishing new from persistent infections is frequently important clinically (e.g., in evaluating interventions that only prevent new infections), but doing so with complete confidence requires expensive and intensive operations such as physically moving people to places they cannot be reinfected.27
To address these challenges, we introduced DINEMITES, a set of statistical methods to distinguish new from persistent infections at the allele level and aggregate this information into clinical endpoints including the molFOI and the number of new infection events. On simulated datasets, the Bayesian model produced the most accurate estimates of these parameters across most settings and was well complemented by a multiple imputation procedure to deal with the frequent case of missing time points (Fig. 2). When applied to three real datasets, the Bayesian model, the clustering model, and the simple rule implemented in DINEMITES all produced highly consistent estimates of clinical outcomes, bolstering confidence that the results accurately reflect the underlying disease dynamics (Figs. 3–4). Finally, when compared to a simple rule applied to only the corresponding infection presence/absence data, the Bayesian model with the complete genotyping data detected 33%, 112%, and 359% more average infections among participants with any infections (Fig. 4C).
The high degree of agreement between fundamentally different methods on real data is encouraging because it suggests that the results obtained from such datasets—including previous results—are largely robust to variations in analysis strategies. Indeed, in all datasets, the majority of the sequenced alleles were classified as new or persistent with high confidence by all models. This is expected since every allele observed for the first time must be new, while the same allele observed in short succession is highly likely to be from the same infection, and these two scenarios constitute the majority of genotyping datasets. In fact, the lower accuracy of the non-Bayesian methods in the simulations likely results from the fact that the simulations were constructed to mimic high transmission settings in which each sequenced allele is not as obviously new or persistent.
Practically, these results suggest that future longitudinal genotyping studies should be analyzed by applying all three models (with multiple imputation as necessary for missing time points), comparing the results to check for consistency, and defaulting to the Bayesian model when ambiguous. If multiple loci are sequenced, unless the genotyping is nearly perfect, the recommended method of computing the molFOI is to select the locus with the highest molFOI. Finally, multi-locus genotyping is likely still useful for identifying which locus is the most variable, even if sequencing multiple loci did not always substantially increase the number of infections detected compared to sequencing only the most variable locus (Fig. 4C). Furthermore, multi-locus genotyping likely improves robustness across Plasmodium populations and enables more precise estimates of single time point COI and infection duration.
Despite the typically high accuracy of these recommended methods, there remain some limitations. First, the Bayesian model does not explicitly account for the co-occurrence of alleles, possibly ignoring useful data (though in real data it estimated similarly to the clustering model that uses co-occurrence data). Second, these methods do not incorporate information about read depth or propagate uncertainty in the sequencing results, but rather assume that the genotyping data have been cleaned of errors beforehand and that each allele detected is equally informative. Finally, each of these models still makes important assumptions: the Bayesian model assumes that a prior infection with an allele does not affect the probability of a new infection with that allele; the clustering model assumes that the probably an allele is sequenced depends only on its cluster membership; and the multiple imputation strategy assumes that whether an allele is present at a missing time point depends only on that allele’s presence/absence pattern at nearby time points.
In summary, the methods introduced here represent an important advancement in using more rigorous and reproducible statistical methods to analyze longitudinal genotyping data. While the results here have focused on malaria, these methods could be applied to other infectious disease data in which individuals can clear and reacquire the same pathogen such as tuberculosis, urinary tract infections, rhinovirus, and norovirus.28, 29, 30, 31, 32, 33 These results corroborate the methodology used in previous studies while also providing more rigorous and generalizable methodology for future studies.
Methods
DINEMITES models
The DINEMITES package implements three models for distinguishing new from persistent infections: a simple model based on time to last occurrence, a Bayesian model based on allele frequencies, and a clustering model based on allele co-occurrence.
Simple model
The simple model defines an allele as persistent if it has been observed in the last nlag visits (default 3) and the last tlag days (default infinite). Otherwise, it is defined as new. This captures the intuition that the allele is unlikely to be new if observed in a recent visit, and (optionally) the visit in which it is observed cannot be too long ago.
Bayesian model
The Bayesian model estimates the probability an allele present represents a new infection by comparing the allele’s background rate of infection to its post-infection probability of being present. The Bayesian model relies on the following key identifiability assumptions:
The rate of new infection with an allele is independent of having been infected with a strain with that allele in the past (i.e., no allele-specific immunity)
Subjects are independent and exchangeable conditional on their covariates.
Notation used for the Bayesian model is summarized in Table 1.
Table 1:
Summary of notation.
| Notation | Description |
|---|---|
| i | Subject index |
| t | Time index |
| a | Allele index |
| Indicator of whether subject i at time t had allele a | |
| is an indicator of whether there was allele a from a new infection in subject i at time t. is an indicator of whether there was allele a from an old infection in subject i at time t. iff or . | |
| Indicator of whether subject i at time t had any allele | |
|
is an indicator of whether there was a new infection in subject i at time t. is an indicator of whether there was an old infection in subject i at time t. iff or |
|
| Vectors of covariates for subject i at time t (with regards to allele a for ). These include both general and persistence covariates. | |
| for | |
| . These are equal because the allele-specific covariates are assumed to matter at the whole-infection level only insofar as their information is stored in the infection-specific covariates. | |
| for |
Covariates are split into two types: general and persistence. General covariates are those that affect the probability of a new infection (e.g., season or bed net use). Persistence covariates are those that affect the probability of a persistent infection being observed again. These include covariates for if and when an infection has occurred previously along with whether there was treatment between the last observed time and the current time (Supplementary Information). Though continuous covariates are allowed, binary covariates allow for de-duplication and significant runtime improvements in calculating the likelihood.
The probability there is an infection present for subject at time (any allele) is modeled by a logistic regression with the constraint if corresponds to a persistence covariate:
The constraint , using the identifiability assumption, ensures that a previous infection can never decrease the probability of being observed to have an infection. The probability an infection is new is then given by the laws of conditional probability:
Also, since the new and old infections are assumed to be independent given the covariates, . It follows that the probability of an old infection is .
Next, different logistic models are used for the individual alleles depending on whether the whole infection is new or old:
If the infection is new, the probability of an allele being present is just determined by , corresponding to the frequency of the allele in the population. If the infection is old, the probability of an allele being present depends on that allele’s presence/absence history, hence the covariates. However, for the allele to be from an old infection, the infection must be old and the allele must have been present before, hence the log(0) = −∞. From these parameters, can be calculated (Supplementary Information).
The model is parameterized in Stan34, 35 with and as the observed data. From the fit parameters, the probability each allele is from a new infection can be calculated (Supplementary Information). Weakly informative priors for the parameters are specified in the Supplementary Information.
By default, the Bayesian model assumes all time points are approximately equally spaced for all subjects or that the probabilities of new infections are unrelated to the length of time between visits. That new infections might be less likely in shorter intervals can be accounted for with general covariates specifying different interval lengths, but modifying the model itself introduces statistical and computational challenges (Supplementary Information).
Clustering model
The clustering model identifies alleles resulting from the same infection through co-occurrence and uses these co-occurrence clusters to estimate whether an allele represents a new infection. The clusters are defined per-subject, corresponding to an assumption of no linkage disequilibrium, which was supported in the data by a lack of cluster similarity across subjects. For each subject, the model does the following:
Using the time points at which 2 or more alleles were observed, a graph is constructed with nodes corresponding to alleles and edges with weights given by the number of time points at which the two alleles co-occurred.
Using the getLinkCommunities function of the linkcomm package,36, 37 edges are hierarchically clustered, and the tree is split at the point that maximizes the partition density to yield sets (clusters) of alleles (possibly overlapping) that represent infection events. Singleton clusters are also added for any alleles that occurred alone.
Probabilities are assigned to (1) each cluster occurring on each day and (2) each allele occurring in the clusters to which it has been assigned based on maximizing the likelihood of the observed presence/absence data. Clusters are assumed to be independent of each other.
The probability each allele represents a new infection is calculated from these probabilities (Supplementary Information).
Multiple imputation
The multiple imputation procedure takes as input a dataset in which some samples have complete genotyping information and some are only known to be pathogen positive or negative (considered ”missing” if positive). The procedure uses the presence/absence patterns of the complete data to generate nimputations imputed datasets in which the pathogen positive samples are replaced with complete genotyping information. The multiple imputation procedure does the following nimputations times (storing results when redundant):
For each subject, for k ∈ {1, …, kmax} (default kmax = 8), each uninterrupted length k sequence of time points (across all alleles) in the complete data is recorded.
For each sequence, all possible masks are generated in which all alleles at time points with a positive sequenced infection are masked with missingness indicators.
For each allele in the sequence, both the original k-ple and masked k-ple are recorded, and a table is created recording how often each masked k-ple is generated by each complete data k-ple.
In the dataset, for each time point t with missingness, for each allele, the kmax-ple centered at t is searched in the table. Then, a complete kmax-ple replacement is sampled from among the complete data k-ples that could generate the observed kmax-ple, proportional to their frequencies in the original complete data. Then, the missing value at the center of the kmax-ple is replaced with the value at the center of the kmax-ple replacement, and the window moves to the next time with missingness. If no kmax-ples that could generate the missingness pattern are in the original complete data, the search process is repeated with (kmax − 1)-ples.
Some exclusion criteria are applied to the imputed alleles to ensure they create plausible complete data without distorting downstream metrics (Supplementary Information).
The multiple imputation procedure makes the assumptions that whether a missing allele is present or absent depends only on that allele’s presence, absence, or missing pattern at the rest of the time points. To ensure sufficiently many observations are available for the imputation table, no distinction is made between alleles (based on frequency etc.), and time points only matter through their ordering, not their actual values. If visit frequencies are highly irregular, the imputation procedure might not be appropriate.
Summary statistic calculations
molFOI
When only one locus is sequenced, the molFOI is simply estimated by the sum of: for each allele, the probability the allele is new multiplied by the probability the allele is present (1 if sequenced and present, 0 if not present, between 0 and 1 if imputed).
When multiple loci are sequenced, the molFOI aggregated across the loci should not double count pathogen strains. Therefore, two counting procedures are implemented (Sup. Fig. 4A). Both start by, for each individual, for each locus at each time point, taking the sum across the alleles of the probability the allele is new multiplied by the probability the allele is present. Then, the two procedures do the following:
Sum then max: For each locus, sum these sums across all time points. Then, take the maximum of the per-locus sums.
Max then sum: For each time point, take the maximum of the sums. Then, sum the maxima over the time points.
The first method ensures that drop-out in alleles at different loci at different times does not result in double counting. The second ensures that if different infections have different diversities at the different loci, the different infections are all counted in full.
Estimating new infection events
New infection events are identified by finding peaks in the estimated new alleles (spanning multiple times) and then checking the probabilities assigned to the alleles in each set of times representing a peak (Sup. Fig. 4B). Peaks (from a local minimum to a local maximum to the next local minimum), rather than singular days with a nonzero number of new alleles, are chosen to represent new infections since typically not all alleles representing an infection are sequenced on the first time point at which the subject has the infection.
The number of new infection events for each subject is estimated as follows:
For each time point, compute the number of new alleles (the sum across the alleles and loci of the probability the allele is new multiplied by the probability the allele is present), the maximum probability any allele is new, and the minimum probability any allele is new.
Divide the times into peaks demarcated by local minima in the number of new alleles.
Within the times belonging to each peak, if the number of new alleles is at least 1, the largest maximum probability is added to the count of new infections. Also, the minimum probabilities for all other time points in the peak are added. If the number of new alleles is less than 1, the peak is assumed to not represent a new infection, and only the maximum of the minimum probabilities at the time points in the peak is added.
When using imputed datasets, the number of new infections is estimated for each subject for each dataset and averaged over the datasets.
Real data applications
The CIS43LS trial (ClinicalTrials.gov number, NCT04329104) and observational cohort study in Mali (ClinicalTrials.gov number, NCT01322581) were approved by the Ethics Committee of the Faculty of Medicine, Pharmacy and Dentistry at the University of Sciences, Techniques and Technology of Bamako. Written, informed consent was obtained from all study participants including the parents and/or guardians of participating children.
Statistical models applied to real datasets
For the CIS43LS trial and Ugandan cohorts, 50-fold multiple imputation was used to generate complete datasets. The models were applied to each imputation, and the probabilities were averaged over the imputed datasets. For the simple model, an allele was considered new if it had not been observed in the previous three time points and persistent otherwise. The clustering model was applied as described. The Bayesian model was applied with infection persistence covariates for whether there had ever been an infection; whether there was an infection in the last 30, 60, and 90 days; and whether there was an acute or longitudinal treatment effect. Equivalent allele-specific infection persistence covariates were also included. For all cohorts, an indicator for the rainy season was used as a general covariate. Also, since the CIS43LS trial involved periods with different visit frequencies, indicators were also used to indicate visits during days 1 to 9 (highest frequency visit phase) or days 10 to 35 (higher frequency visit phase) since new infections were expected to be less likely with less time between visits. Sequencing drop-out rates (the probability of an allele not being observed despite being present) were estimated by computing, for alleles that were observed once and also at either two or three time points later, what proportion of those alleles were also observed at the time points in between. For all models, for each individual, the first two time points were excluded since these could have represented either new or persistent infections.
Supplementary Material
Acknowledgments
The computations in this paper were run in part on the FASRC Cannon cluster supported by the FAS Division of Science Research Computing Group at Harvard University. W.A.N. was supported on a training grant from the National Institute of General Medical Sciences (T32GM135117). This work was also supported by an award from the Bill and Melinda Gates Foundation (INV-052365) and the NIH (1R01AI141544-01). The CIS43LS trial was funded by the Division of Intramural Research and the Vaccine Research Center, National Institute of Allergy and Infectious Diseases, National Institutes of Health. The Mali observational cohort study was funded by the Division of Intramural Research, National Institute of Allergy and Infectious Diseases, National Institutes of Health. We thank Dr. Gail Potter and Dr. Angela Early for informative discussions and feedback on this work.
Footnotes
Availability and implementation
DINEMITES is freely available as an R package, along with documentation, tutorials, and example data, at https://github.com/WillNickols/dinemites.
Software and Data Availability
DINEMITES, along with its source code, documentation, tutorials, and example data sets is freely available at https://github.com/WillNickols/dinemites. The code used to run the synthetic and real analyses is available at https://github.com/WillNickols/dinemites_evaluation. The data used for the Ugandan cohort are available from the corresponding publication,5 the raw sequencing data for the 2011 Malian cohort are available from the NCBI Sequence Read Archive under accession PRJNA1129562, and the data used from the CIS43LS and 2011 Malian cohorts are available from the corresponding author upon reasonable request.
References
- 1.Tessema S. K. et al. Applying next-generation sequencing to track falciparum malaria in sub-Saharan Africa. Malaria Journal 18, 268 (2019). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 2.Anderson T. J. et al. Microsatellite markers reveal a spectrum of population structures in the malaria parasite Plasmodium falciparum. Molecular Biology and Evolution 17, 1467–1482 (2000). [DOI] [PubMed] [Google Scholar]
- 3.Patel J. C. et al. Genetic Evidence of Importation of Drug-Resistant Plasmodium falciparum to Guatemala from the Democratic Republic of the Congo. Emerging Infectious Diseases 20, 932–940 (2014). URL https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4036788/. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 4.Ishengoma D. S., Saidi Q., Sibley C. H., Roper C. & Alifrangis M. Deployment and utilization of next-generation sequencing of Plasmodium falciparum to guide anti-malarial drug policy decisions in sub-Saharan Africa: opportunities and challenges. Malaria Journal 18, 267 (2019). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 5.Briggs J. et al. Sex-based differences in clearance of chronic Plasmodium falciparum infection. eLife 9, e59872 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 6.Andolina C. et al. Sources of persistent malaria transmission in a setting with effective malaria control in eastern Uganda: a longitudinal, observational cohort study. The Lancet. Infectious Diseases 21, 1568–1578 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 7.Neafsey D. E. et al. Genetic Diversity and Protective Efficacy of the RTS,S/AS01 Malaria Vaccine. The New England Journal of Medicine 373, 2025–2037 (2015). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 8.Juraska M. et al. Genotypic analysis of RTS,S/AS01E malaria vaccine efficacy against parasite infection as a function of dosage regimen and baseline malaria infection status in children aged 5-17 months in Ghana and Kenya: a longitudinal phase 2b randomised controlled trial. The Lancet. Infectious Diseases 24, 1025–1036 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 9.LaVerriere E. et al. Marked heterogeneity in malaria infection risk in a Malian longitudinal cohort (2024). URL https://www.medrxiv.org/content/10.1101/2024.08.20.24312307v1. Pages: 2024.08.20.24312307. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 10.Mueller I. et al. Force of infection is key to understanding the epidemiology of Plasmodium falciparum malaria in Papua New Guinean children. Proceedings of the National Academy of Sciences of the United States of America 109, 10030–10035 (2012). URL https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3382533/. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 11.Zhong D., Koepfli C., Cui L. & Yan G. Molecular approaches to determine the multiplicity of Plasmodium infections. Malaria Journal 17, 172 (2018). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 12.Mayor A., Ishengoma D. S., Proctor J. L. & Verity R. Sampling for malaria molecular surveillance. Trends in Parasitology 39, 954–968 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 13.Galinsky K. et al. COIL: a methodology for evaluating malarial complexity of infection using likelihood from single nucleotide polymorphism data. Malaria Journal 14, 4 (2015). URL https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4417311/. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 14.Chang H.-H. et al. THE REAL McCOIL: A method for the concurrent estimation of the complexity of infection and SNP allele frequency for malaria parasites. PLoS computational biology 13, e1005348 (2017). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 15.Murphy M. & Greenhouse B. MOIRE: a software package for the estimation of allele frequencies and effective multiplicity of infection from polyallelic data. Bioinformatics (Oxford, England) 40, btae619 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 16.Kayentao K. et al. Safety and Efficacy of a Monoclonal Antibody against Malaria in Mali. The New England Journal of Medicine 387, 1833–1842 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 17.RTS,S Clinical Trials Partnership et al. A phase 3 trial of RTS,S/AS01 malaria vaccine in African infants. The New England Journal of Medicine 367, 2284–2295 (2012). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 18.Potter G. E. et al. Can incorporating genotyping data into efficacy estimators improve efficiency of early phase malaria vaccine trials? Malaria Journal 22, 383 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 19.Murphy S. C. et al. Real-time quantitative reverse transcription PCR for monitoring of blood-stage Plasmodium falciparum infections in malaria human challenge trials. The American Journal of Tropical Medicine and Hygiene 86, 383–394 (2012). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 20.Lerch A. et al. Longitudinal tracking and quantification of individual Plasmodium falciparum clones in complex infections. Scientific Reports 9, 3333 (2019). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 21.Jones S. et al. Should Deep-Sequenced Amplicons Become the New Gold Standard for Analyzing Malaria Drug Clinical Trials? Antimicrobial Agents and Chemotherapy 65, e0043721 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 22.Taylor A. R. et al. Resolving the cause of recurrent Plasmodium vivax malaria probabilistically. Nature Communications 10, 5595 (2019). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 23.Cowell A. N., Valdivia H. O., Bishop D. K. & Winzeler E. A. Exploration of Plasmodium vivax transmission dynamics and recurrent infections in the Peruvian Amazon using whole genome sequencing. Genome Medicine 10, 52 (2018). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 24.Plucinski M. M., Morton L., Bushman M., Dimbu P. R. & Udhayakumar V. Robust Algorithm for Systematic Classification of Malaria Late Treatment Failures as Recrudescence or Reinfection Using Microsatellite Genotyping. Antimicrobial Agents and Chemotherapy 59, 6096–6100 (2015). URL https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4576024/. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 25.Rubin D. B. Multiple Imputation for Nonresponse in Surveys (John Wiley & Sons, 2004). Google-Books-ID: gTGzEAAAQBAJ. [Google Scholar]
- 26.LaVerriere E. et al. Design and implementation of multiplexed amplicon sequencing panels to serve genomic epidemiology of infectious disease: a malaria case study. Molecular ecology resources 22, 2285–2303 (2022). URL https://www.ncbi.nlm.nih.gov/pmc/articles/PMC9288814/. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 27.Popovici J. et al. Recrudescence, Reinfection, or Relapse? A More Rigorous Framework to Assess Chloroquine Efficacy for Plasmodium vivax Malaria. The Journal of Infectious Diseases 219, 315–322 (2019). URL https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6306015/. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 28.Millet J.-P. et al. Tuberculosis recurrence after completion treatment in a European city: reinfection or relapse? PloS One 8, e64898 (2013). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 29.Verver S. et al. Rate of reinfection tuberculosis after successful treatment is higher than rate of new tuberculosis. American Journal of Respiratory and Critical Care Medicine 171, 1430–1435 (2005). [DOI] [PubMed] [Google Scholar]
- 30.Horsburgh C. R. et al. Contribution of Reinfection to Annual Rate of Tuberculosis Infection (ARI) and Incidence of Tuberculosis Disease. Clinical Infectious Diseases: An Official Publication of the Infectious Diseases Society of America 76, e965–e972 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 31.Turck M., Anderson K. N. & Petersdorf R. G. Relapse and reinfection in chronic bacteriuria. The New England Journal of Medicine 275, 70–73 (1966). [DOI] [PubMed] [Google Scholar]
- 32.van der Zalm M. M. et al. Highly frequent infections with human rhinovirus in healthy young children: a longitudinal cohort study. Journal of Clinical Virology: The Official Publication of the Pan American Society for Clinical Virology 52, 317–320 (2011). [DOI] [PubMed] [Google Scholar]
- 33.Brown J. R., Roy S., Tutill H., Williams R. & Breuer J. Super-infections and relapses occur in chronic norovirus infections. Journal of Clinical Virology: The Official Publication of the Pan American Society for Clinical Virology 96, 44–48 (2017). [DOI] [PubMed] [Google Scholar]
- 34.Carpenter B. et al. Stan: A Probabilistic Programming Language. Journal of Statistical Software 76, 1–32 (2017). URL 10.18637/jss.v076.i01. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 35.Gabry J., Češnovar R., Johnson A. & Bronder S. cmdstanr: R Interface to ‘CmdStan’ (2024). URL https://mc-stan.org/cmdstanr/. [Google Scholar]
- 36.Kalinka A. T. & Tomancak P. linkcomm: an R package for the generation, visualization, and analysis of link communities in networks of arbitrary size and type. Bioinformatics (Oxford, England) 27, 2011–2012 (2011). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 37.Ahn Y.-Y., Bagrow J. P. & Lehmann S. Link communities reveal multiscale complexity in networks. Nature 466, 761–764 (2010). [DOI] [PubMed] [Google Scholar]
- 38.Miller R. H. et al. A deep sequencing approach to estimate Plasmodium falciparum complexity of infection (COI) and explore apical membrane antigen 1 diversity. Malaria Journal 16, 490 (2017). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 39.Hathaway N. J., Parobek C. M., Juliano J. J. & Bailey J. A. SeekDeep: single-base resolution de novo clustering for amplicon deep sequencing. Nucleic Acids Research 46, e21 (2018). [DOI] [PMC free article] [PubMed] [Google Scholar]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Supplementary Materials
Data Availability Statement
DINEMITES, along with its source code, documentation, tutorials, and example data sets is freely available at https://github.com/WillNickols/dinemites. The code used to run the synthetic and real analyses is available at https://github.com/WillNickols/dinemites_evaluation. The data used for the Ugandan cohort are available from the corresponding publication,5 the raw sequencing data for the 2011 Malian cohort are available from the NCBI Sequence Read Archive under accession PRJNA1129562, and the data used from the CIS43LS and 2011 Malian cohorts are available from the corresponding author upon reasonable request.




