we used previously analyzed nucleotide sequences from patients included in the swiss hiv cohort study ( shcs ) drug resistance database ( see kouyos et al   and genbank accession numbers therein for a random sample of sequences ) . the shcs is a nationwide , prospective , clinic - based cohort study with continuous enrollment and semiannual study visits [ 6 , 7 ] . the shcs has been approved by the ethical committees of all participating institutions , and written informed consent has been obtained from the participants . the shcs drug resistance database contains the results of 13,201 genotypic resistance tests from 9,231 patients performed by the 4 laboratories engaged in hiv resistance testing in switzerland , stored in a central database developed and hosted by smartgene ( zug , switzerland ; integrated database network system , version 3.5.0 ) . resistance data stem from routine clinical testing ( 60% of tests ) and from tests performed retrospectively from frozen repository plasma samples ( 40% of tests ) . retrospective sequencing was performed systematically by analyzing the earliest plasma sample available for each patient . all laboratories perform population - based sequencing of the full protease gene and at minimum codons 28225 of the reverse transcriptase gene by means of commercial assays ( viroseq version 1 , pe biosystems ; virsoseq version 2 , abbott ag ; vircotype hiv-1 assay , virco lab ) and in - house methods . subtype b dominates the swiss hiv-1 epidemic [ 10 , 11 ] , and we therefore focused on this subtype ( n  =  9,157 sequences ) . because antiretroviral therapy strongly distorts viral diversity , we included only sequences from patients who were therapy - nave at the time of sampling and for whom an independent estimate of infection time was available ( 3,307 sequences , each from a different patient ) . the year of infection was estimated as described elsewhere   as the median of patient - specific infection time estimates based on a bayesian back calculation model incorporating the dates of the first positive or last negative hiv test results and cd4 counts as predictor variables . furthermore , we considered 3 additional sets of patients , for whom times or time differences are known with better accuracy : ( 1 ) in the set of seroconverters ( 366 patients ) , patients were recruited to the cohort within 1 year after infection , based on documented negative and positive hiv test results no longer than 180 d apart ; ( 2 ) the longitudinal set contains 124 patients for whom sequences are available at 2 time points ( at least 6 months apart ) . although for this data set the time of infection is not more precise than for the large data set , the age difference of the 2 samples is known exactly ; and ( 3 ) the zurich primary hiv infection study ( zphi ; clinicaltrials.gov identifier , nct00537966 ) set contains 130 patients with sequences obtained during acute infection ( median time from infection , 41 d ; interquartile range [ iqr ] , 2856 d ) . the relationship between the proportion of ambiguous positions ( the dependent variable ) and the time since infection was investigated using linear regression analysis . because model residuals were not normally distributed , we performed a bootstrap analysis with 1,000 replicates to obtain 95% confidence intervals ( cis ) . we verified results by repeating all analyses on logit - transformed fractions by use of a generalized linear model for proportions . both crude and adjusted analyses , using the patient 's mode of hiv acquisition , ethnicity , sex , and age , were performed . in addition , a variable coding for the sequence - generating laboratory was included to account for assay- or laboratory - specific effects . all p values were 2-sided , and the level of statistical significance was set at .05 . we sought to identify a cutoff in the proportion of ambiguous sites to classify a patient 's infection status into recent ( infected for 1 year ) or chronic ( infected for > 1 year ) . the classification performance of 2 categorizations of the proportion of ambiguous sites was evaluated with receiver operating characteristic ( roc ) analyses . the first analysis included ambiguous sites as a categorical variable with 5 groups based on quintiles , whereas for the second analysis only 2 categories were included based on an a priori defined cutoff of .5% or > .5% ambiguous positions . as shown in table 1 , the majority of individuals in our sample were male ( n  =  2,593 ; 78.4% ) and of white ethnicity ( n  =  2,933 ; 88.7% ) . of these 3,307 patients , 1,482 ( 45% ) had acquired hiv through homosexual contacts , 862 ( 26.1% ) through intravenous drug use , and 857 ( 25.9% ) through heterosexual intercourse . the median year of infection was 1995 with an iqr of 19912000 , and the median duration from infection to sampling for genotypic sequencing was 4.7 years ( iqr , 3.36.9 years ) . note that for the quadratic model ( all patients ) both the linear and the quadratic term significantly improve the fit , but not when only the first 8 years of infection were considered . grt , genotypic resistance test ; hiv , human immunodeficiency virus ; iqr , interquartile range ; na , not applicable . we found that for hiv-1 sequences sampled before initiation of antiretroviral therapy , the fraction of ambiguous nucleotides increases significantly with the age of infection . this relationship is shown in figure 1a for the full data set ( 3,307 patients ) for whom the age of infection has been estimated with the back calculation algorithm ( see materials and methods and taffe and may ) . figure 1a shows that the fraction of ambiguous sites grows linearly with time in the first few years of infection and then flattens off . this effect can be described by including time since infection as a linear and a quadratic term in an adjusted regression model with the fraction of ambiguous nucleotides as outcome : if all patients are taken into account , both the positive linear and the negative quadratic components significantly improve the quality of the fit ( model with linear term , r  =  .14 ; model with additional quadratic term , r  =  .17 ) ( figure 1b ; table 1 ) . because the initial increase in the proportion of ambiguous positions is almost linear during the first phase of infection , we further restricted our analyses to patients with an hiv sequence obtained in this phase of linear increase , that is , within the first 8 years of infection ( n  =  2,729 ) . these adjusted analyses revealed a yearly increase in the proportion of ambiguous sites of .2 percentage points per year ( table 1 ) , which was comparable with results from unadjusted regression analyses with yearly increases of .25% ( 95% ci , .23%.28% ) for the full sample and .19% ( 95% ci , .18%.21% ) for the sample restricted to patients with an infection duration of 8 years . interestingly , table 1 indicates that the mode of hiv acquisition significantly affects the level of diversity . in particular , intravenous drug users exhibit a larger fraction of ambiguous nucleotides than do both heterosexuals and men who have sex with men , which may suggest broader transmission bottlenecks for blood - transmitted than for sexually transmitted hiv . relationship between the year of infection and the fraction of ambiguous nucleotides ( f ) . a , mean of f as a function of the age of infection , where data points have been binned according to the age of infection in years ( n  =  3,307 patients ) . the shaded area corresponds to the 95% confidence interval of the means of f. these confidence intervals have been determined by bootstrap ( with 1,000 samples ) . the red point corresponds to the mean of f for the zurich primary hiv infection study data set ( n  =  130 ) , for which all sequences stem from the first few months after the infection . b , quadratic and linear fit of the full data set . note that the linear fit is restricted to ages of infection of 8 years . c , linear fit of the different data sets . only sequences obtained within the first 8 years after infection were considered . d , distribution of the age of infection ( in years ) for different fractions of ambiguous nucleotides . the left plot depicts the density plot of the age of infection for the 5 quintiles of f. the right plot depicts , for each of the 5 quintiles of f , the 25%75% percentiles ( green lines ) and 5%95% percentiles ( black lines ) of the year of infection . to further assess the validity of the relationship between ambiguity and age of infection , we examined the smaller seroconverter set , which consists of 366 individuals who were recruited to the cohort in the early phase of their infection and for whom therefore the time point of infection was known within a given time interval of 6 months , and the longitudinal set , which contains 124 patients with sequence samples obtained from 2 time - points at least 6 months apart from each other . in the latter data set , inclusion was restricted to those patients for whom both samples were obtained within the first 8 years of infection . for these patients , we correlated the length of the time interval between the 2 measurements with the increase of the fraction of ambiguous nucleotides . figure 1c shows that both additional data sets yield an estimate for the increase of ambiguous nucleotides over the first 8 years after infection that is similar to the estimate yielded by the original data set . finally , we used the zphi data set , which contains the most stringent infection time estimate , to test the diversity around the time point of infection . figure 1a shows that the fraction of ambiguous nucleotides in the zphi set is consistent with that found in the other 3 data sets . moreover , for the zphi set , we observed a highly significant correlation ( spearman  = 36 ; p  <  .001 ) between the fraction of ambiguous nucleotides in the pol gene and the diversity of clonal env sequences , which confirms that the fraction of ambiguous nucleotides is a good marker for viral diversity . in order to explore whether the observed correlation between infection time and the fraction of ambiguous sites could be exploited for age classification of individual hiv sequences , we subdivided our data set into quintiles of the fraction of ambiguous nucleotides f and inferred the distribution of the time of infection for each of these quintiles . figure 1d shows that the fraction of ambiguous nucleotides provides useful information mainly on the lower bound of the age of infection : whereas sequences with f < .68% ( ie , the first two quintiles ) ( table 2 ) may stem from the early phase of an infection , this is unlikely for sequences with a larger fraction of ambiguous nucleotides . however , it is important to note that although it is unlikely that the hiv sequence from a recent hiv infection has a large fraction of ambiguous nucleotides , this may occur if the hiv population is founded by > 1 virus , in which case diversity is large from the beginning on . this effect can be clearly seen in the zphi data set : a substantial minority of 24 ( 18% ) of 130 patients exhibit a fraction of ambiguous nucleotides > .68% , even though all patients samples have been sequenced in the first months of their infection . this can be explained by results of keele et al , who found that 23% of hiv infections are founded by > 1 virus and hence should exhibit a large diversity even during primary infection . summary of the two cutoff methods : a priori defined threshold of .5% and cutoffs based on quintiles indicates how strata are collapsed for comparison ; for example , strata 1 versus all remaining strata . proportion of patients infected 1 year whose human immunodeficiency virus ( hiv ) sequence had .5% ambiguous positions . proportion of patients infected > 1 year whose hiv sequence had > .5% ambiguous positions . we explicitly evaluated 2 different stratifications for cutoffs to predict whether a patient was infected for < 1 year at the time of sampling for the genotypic test . as shown in table 2 , the selection of a cutoff of .5% ambiguous positions predicted recent infections quite well in our full data set of 3,307 patients . of 212 patients with a recent infection at the time of genotypic testing , 184 had .5% ambiguous positions in their hiv sequence ( sensitivity , 86.8% ) , but the specificity , which is the proportion of chronically infected patients with > .5% ambiguous positions , was only 70% ( roc area under curve , 78.3% ) . therefore , this cutoff of .5% may not be very useful to identify recently infected patients , but it can very accurately discriminate against patients with a chronic infection : only 28 ( 1.3% ) of 2,190 patients with > .5% ambiguous positions had an infection duration of 1 year at the time of genotyping . thus , if the observed fraction of ambiguous positions is > .5% , then there is a probability of 98.7% ( 95% ci 98.2%99.1% ) that the genotypic test was performed > 1 year after infection ( negative predictive value ) . stratification by quintile did not improve the classification performance but essentially confirmed the above finding : when quintiles 1 and 2 are collapsed into a single category and compared with the remaining strata ( ie , sequences with < .68% vs those with .68% ambiguous positions ) , sensitivity increased to 89.6% but specificity decreased to 63.2% . when testing the .5% cutoff in the sample of observed seroconverters ( n  =  366 ) , the performance was very similar to that in the full sample . overall , 79.8% of patients were correctly classified , and the area under the roc curve was 72.0% . the observed increase in ambiguous positions over the time of infection likely reflects the diversification of the hiv population after the genetic bottleneck at the infection event . in the simplest scenario , this diversification is controlled only by mutation and genetic drift ( ie , random extinction of viral strains ) . we modeled this scenario by simulating the wright - fisher model ( wfm ) , starting from an initially uniform population ( ie , with no initial diversity ) . as the wfm assumes neutrality , we focused on ambiguous nucleotides at 4-fold degenerate third - codon positions for which the assumption of neutrality is best justified . we found that the wfm can reproduce the temporal increase of the fraction of ambiguous sites for parameters that have been shown to reproduce neutral evolution in hiv ( see kouyos et al   and references therein ) ( figure 2 ) . this finding implies that , at least for 4-fold degenerate third - codon positions , the increasing diversity of the hiv population can be understood as the combined effect of mutation and genetic drift acting on a virus population , which is homogenous at the time point of infection . temporal increase of the fraction of ambiguous nucleotides in the wright - fisher model ( wfm ) for a population size of 500 and a mutation rate of 3  10 mutations per generation ( solid green line ) and at 4-fold degenerate third - codon positions in the full data set ( dashed black line ) . the curve for the wfm has been obtained by averaging over 104 runs of the model . the wfm describes discrete and nonoverlapping generations in a population with fixed size n. every generation , each of the n genomes undergoes mutation with probability m. then the n genomes for the next generation are determined from the gene pool by drawing every offspring genome with uniform probability from the n parental genomes . the most relevant clinical result of this study is that a large fraction of ambiguous nucleotides provides evidence against a recent infection event . in particular , we found that a threshold of .5% ambiguous nucleotides yields a negative predictive value of 98.7% . it is important to note that , by definition , the negative predictive value depends on the overall composition of the considered population at time of diagnosis . a strength of the sample studied here , however , is the high representativeness of the shcs for the epidemic in switzerland [ 68 ] . thus , the composition of our sample is likely to be very similar to that of the population of hiv-1-infected individuals at the time of hiv infection diagnosis , and therefore the negative predictive value inferred here closely describes the situation in clinical practice . finally , we find that although the frequency of ambiguous nucleotide calls differs significantly between laboratories ( table 1 ) , the negative predictive value varies only marginally when calculated for samples from each laboratory separately ( range , 98.5%99.5% ;  test , p  =  .668 ) . in order to test the robustness of our findings , we additionally assessed the impact of hla types , transmitted resistance , and subtype . hla types may affect viral diversity , for instance , by stabilizing selection ( and possibly by maintaining detrimental viral mutations , as may be the case for type hla - b*57 ) or , in the opposite , by leading to increased viral replication and diversity by triggering only suboptimal cytotoxic t lymphocytes responses , for instance , in the presence of homozygous hla alleles . using available hla data from 352 individuals , we considered the homozygosity of hla - b ( n  =  32 ) and the following hla - b haplotypes : hla - b*57 ( n  =  23 ) , hla - b*27 ( n  =  25 ) , hla - b*5801 ( n  =  7 ) , and hla - b*35 ( n  =  80 ) . upon inclusion of these variables in the adjusted regression model ( restricted to a time of 8 years ) , neither of these hla - b alleles reached statistical significance . there was a nonsignificant trend for higher viral diversity among carriers of homozygous hla - b alleles of .243 ( 95% ci -.054 to .551 ) . concerning hiv subtype , it should be noted that the present analysis focused on subtype b , because most patients in the shcs have been infected with that subtype . we found , however , very similar results for other subtypes ( table 3 ) , indicating that our methodology extends beyond subtype b. however , it is also clear from the limited data available for non - b subtypes that additional tests are required for these subtypes . finally , transmitted resistance mutations ( present in 10% of the included patients ) did not seem to have an impact when included in an adjusted model analogous to that in table 1 ( with time restricted to 8 years ) , since the parameters were not statistically significant ( data not shown ) . in summary , these 3 tests suggest that our findings are robust against hla type , subtype , and transmitted resistance . unadjusted and adjusted estimates for the growth rates over the first eight years of infection and summary of the cutoff method based on the .5% threshold for the four largest non - b subtype groups in switzerland note . the unadjusted and adjusted estimates for the growth rates over the first 8 years of infection are analogous to table 1 . the summary of the cutoff method based on the .5% threshold is analogous to table 2 . ci , confidence interval ; npp , negative predictive value ; roc , receiver operating characteristic . a potential limitation of our analysis is the accuracy of infection date estimates . we have confirmed the correlation between the age of an infection and the fraction of ambiguous base calls in several data sets with different estimation methods for infection duration . moreover , we performed a sensitivity analysis to assess the impact of the uncertainty of infection date estimates from the back calculation model ( data not shown ) . this was done by repeating the adjusted and unadjusted regression analyses on a random time point between the upper and the lower bound of the posterior infection date distribution . time trends were somewhat attenuated due to the introduction of additional variation with an increase of.13% per year ( 95% ci , .11%.14% ) for the unadjusted analysis and an increase of .11% per year ( 95% ci , .12%.13% ) for the adjusted analysis , but these point estimates still reached statistical significance . we would like to emphasize that this study represents a proof of principle and that the details of the method should ideally be replicated and calibrated for each sequencing laboratory or method ( especially in the light of our finding of significant differences between laboratories ) ( table 1 ) . moreover , it is important to note that 10%20% of recently infected patients do have a high viral diversity because they are infected with several strains . therefore , the fraction of ambiguous nucleotides should be only one of several measurements used to decide whether a patient is recently infected . , we have shown that this byproduct carries important information on the age of the infection at sampling time . in particular , a large frequency of ambiguous nucleotides argues against a recent infection event . the qualitative pattern of an initially linearly increasing amount of diversity and subsequent saturation is consistent with the diversification pattern observed for the env gene . overall , our study highlights the usefulness of diversity measures as markers for infection age . this usefulness might further increase with the advent of array - based pyrosequencing , which allows the diversity of the hiv population to be analyzed in much more detail . supplementary materials consist of data provided by the author that are published to benefit the reader .
the fraction of ambiguous nucleotide calls in bulk sequencing of human immunodeficiency virus type 1 ( hiv-1 ) carries important information on viral diversity and the age of infection . 
 in particular , a fraction of ambiguous nucleotides of > .5% provides evidence against a recent infection event < 1 year ago .