I'm trying to write a script which will count the number of occurrences of different strings and put the count values to certain tags in the file.
Sample text:
Expected output:
I've written a script (code given below) which does this job but its not that fast for large files.
How do I make the script more efficient?
Sample text:
Code: Select all
<counts>
<fig-count count="8"/>
<table-count count="6"/>
<equation-count count="10"/>
<page-count count="1"/>
</counts>
</article-meta>
</front>
<body>
<p>Nineteen million people have died of AIDS since the discovery of HIV in the 1980s. In 1999 alone, 5.4 million people were newly infected with HIV (ref. <xref ref-type="bibr" rid="B1">1</xref> and <ext-link ext-link-type="url" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.unaids.org/epidemicupdate/report/Epireport.html">http://www.unaids.org/epidemicupdate/report/Epireport.html</ext-link>). (For brevity, HIV-1 is referred to as HIV in this paper.) Sub-Saharan Africa has been hardest hit, with more than 20% of the general population HIV-positive in some countries (<xref ref-type="bibr" rid="B2">2</xref>, <xref ref-type="bibr" rid="B3">3</xref>). In comparison, heterosexual epidemics in developed, market-economy countries have not reached such severe levels. Factors contributing to the severity of the epidemic in economically developing countries abound, including economic, health, and social differences such as high levels of sexually transmitted diseases and a lack of prevention programs. However, the staggering rate at which the epidemic has spread in sub-Saharan Africa has not been adequately explained. The rate and severity of this epidemic also could indicate a greater underlying susceptibility to HIV attributable not only to sexually transmitted disease, economics, etc., but also to other more ubiquitous factors such as host genetics (<xref ref-type="bibr" rid="B4">4</xref>, <xref ref-type="bibr" rid="B5">5</xref>).</p>
<p>To exemplify the contribution of such a host genetic factor to HIV prevalence trends, we consider a well-characterized 32-bp deletion in the host-cell chemokine receptor CCR5, CCR5Δ32. When HIV binds to host cells, it uses the CD4 receptor on the surface of host immune cells together with a coreceptor, mainly the CCR5 and CXCR4 chemokine receptors (<xref ref-type="bibr" rid="B6">6</xref>). Homozygous mutations for this 32-bp deletion offer almost complete protection from HIV infection, and heterozygous mutations are associated with lower pre-AIDS viral loads and delayed progression to AIDS (<xref ref-type="bibr" rid="B7">7</xref>–<xref ref-type="bibr" rid="B14">14</xref>). CCR5Δ32 generally is found in populations of European descent, with allelic frequencies ranging from 0 to 0.29 (<xref ref-type="bibr" rid="B13">13</xref>). African and Asian populations studied outside the United States or Europe appear to lack the CCR5Δ32 allele, with an allelic frequency of almost zero (<xref ref-type="bibr" rid="B5">5</xref>, <xref ref-type="bibr" rid="B13">13</xref>). Thus, to understand the effects of a protective allele, we use a mathematical model to track prevalence of HIV in populations with or without CCR5Δ32 heterozygous and homozygous people and also to follow the CCR5Δ32 allelic frequency.</p>
<sec>
<title>The Model</title>
<p>Because we are most concerned with understanding the severity of the epidemic in developing countries where the majority of infection is heterosexual, we consider a purely heterosexual model. To model the effects of the allele in the population, we examine the rate of HIV spread by using an enhanced susceptible-infected-AIDS model of epidemic HIV (for review see ref. <xref ref-type="bibr" rid="B31">31</xref>). Our model compares two population scenarios: a CCR5 wild-type population and one with CCR5Δ32 heterozygotes and homozygotes in addition to the wild type.</p>
<fig id="F1">
<label>Figure 1</label>
<caption>
<p>A schematic representation of the basic compartmental HIV epidemic model. The criss-cross lines indicate the sexual mixing between different compartments. Each of these interactions has a positive probability of taking place; they also incorporate individual rates of transmission indicated as λ, but in full notation is λ<sub><italic>î</italic>,<italic></italic>,<italic></italic>→<italic>i</italic>,<italic>j</italic>,</sub> where <italic>i</italic>,<italic>j</italic>,<italic>k</italic> is the phenotype of the infected partner and <italic>î</italic>,<italic></italic> is the phenotype of the susceptible partner.</p>
</caption>
<graphic xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="pq1813251001">
</graphic>
</fig>
<table-wrap id="T1">
<label>Table 1</label>
<caption>
<p>Children's genotype</p>
</caption>
<table>
<tr>
<th>Parents</th>
<th colspan="4">Mother</th>
</tr>
<tr>
<td colspan="5">
<hr/>
</td>
</tr>
<tr>
<td>Father</td>
<td/>
<td>W/W</td>
<td>W/Δ32</td>
<td>Δ32/Δ32</td>
</tr>
</table>
<table-wrap-foot>
<fn>
<p>χ<sub>1,<italic>j</italic></sub>1,<italic>j</italic> = wild-type children; (W/W); χ<sub>2,<italic>j</italic></sub>2,<italic>j</italic> = heterozygous children (W/Δ32); χ<sub>3,<italic>j</italic></sub>3,<italic>j</italic> = homozygous children (Δ32/Δ32) of gender <italic>j</italic>. Children's genotypes are determined by using Mendelian inheritance patterns.</p>
</fn>
</table-wrap-foot>
</table-wrap>
<sec>
<title>Parameter Estimates for the Model.</title>
<p>Estimates for rates that govern the interactions depicted in Fig. <xref ref-type="fig" rid="F1">1</xref> were derived from the extensive literature on HIV. Our parameters and their estimates are summarized in Tables <xref ref-type="table" rid="T2">2</xref>–<xref ref-type="table" rid="T4">4</xref>. The general form of the equations describing the rates of transition between population classes as depicted in Fig. <xref ref-type="fig" rid="F1">1</xref> are summarized as follows: <disp-formula id="E1">
<tex-math id="M1">\documentclass[12pt]{minimal} \usepackage{wasysym} \usepackage[substack]{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage[mathscr]{eucal} \usepackage{mathrsfs} \DeclareFontFamily{T1}{linotext}{} \DeclareFontShape{T1}{linotext}{m}{n} { <-> linotext }{} \DeclareSymbolFont{linotext}{T1}{linotext}{m}{n} \DeclareSymbolFontAlphabet{\mathLINOTEXT}{linotext} \begin{document} $$ \frac{dS_{i,j}(t)}{dt}={\chi}_{i,j}(t)-{\mu}_{j}S_{i,j}(t)-{\lambda}_{\hat {\imath},\hat {},\hat {k}{\rightarrow}i,j}S_{i,j}(t), $$ \end{document} </tex-math>
</disp-formula>
<disp-formula id="E2">
<tex-math id="M2">\documentclass[12pt]{minimal} \usepackage{wasysym} \usepackage[substack]{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage[mathscr]{eucal} \usepackage{mathrsfs} \DeclareFontFamily{T1}{linotext}{} \DeclareFontShape{T1}{linotext}{m}{n} { <-> linotext }{} \DeclareSymbolFont{linotext}{T1}{linotext}{m}{n} \DeclareSymbolFontAlphabet{\mathLINOTEXT}{linotext} \begin{document} $$ \hspace{1em}\hspace{1em}\hspace{.167em}\frac{dI_{i,j,A}(t)}{dt}={\lambda}_{\hat {\imath},\hat {},\hat {k}{\rightarrow}i,j}S_{i,j}(t)-{\mu}_{j}I_{i,j,A}(t)-{\gamma}_{i,j,A}I_{i,j,A}(t), $$ \end{document} </tex-math>
</disp-formula>
<disp-formula id="E3">
<tex-math id="M3">\documentclass[12pt]{minimal} \usepackage{wasysym} \usepackage[substack]{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage[mathscr]{eucal} \usepackage{mathrsfs} \DeclareFontFamily{T1}{linotext}{} \DeclareFontShape{T1}{linotext}{m}{n} { <-> linotext }{} \DeclareSymbolFont{linotext}{T1}{linotext}{m}{n} \DeclareSymbolFontAlphabet{\mathLINOTEXT}{linotext} \begin{document} $$ \frac{dI_{i,j,B}(t)}{dt}={\gamma}_{i,j,A}I_{i,j,A}(t)-{\mu}_{j}I_{i,j,B}(t)-{\gamma}_{i,j,B}I_{i,j,B}(t), $$ \end{document} </tex-math>
</disp-formula>
<disp-formula id="E4">
<tex-math id="M4">\documentclass[12pt]{minimal} \usepackage{wasysym} \usepackage[substack]{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage[mathscr]{eucal} \usepackage{mathrsfs} \DeclareFontFamily{T1}{linotext}{} \DeclareFontShape{T1}{linotext}{m}{n} { <-> linotext }{} \DeclareSymbolFont{linotext}{T1}{linotext}{m}{n} \DeclareSymbolFontAlphabet{\mathLINOTEXT}{linotext} \begin{document} $$ \frac{dA(t)}{dt}={\gamma}_{i,j,B} \left( { \,\substack{ ^{3} \\ {\sum} \\ _{i=1} }\, }I_{i,F,B}(t)+I_{i,M,B}(t) \right) -{\mu}_{A}A(t)-{\delta}A(t), $$ \end{document} </tex-math>
</disp-formula> where, in addition to previously defined populations and rates (with <italic>i</italic> equals genotype, <italic>j</italic> equals gender, and <italic>k</italic> equals stage of infection, either <italic>A</italic> or <italic>B</italic>), μ<sub><italic>j</italic></sub>, represents the non-AIDS (natural) death rate for males and females respectively, and μ<sub>A</sub> is estimated by the average (μ<sub>F</sub> + μ<sub>M</sub>/2). This approximation allows us to simplify the model (only one AIDS compartment) without compromising the results, as most people with AIDS die of AIDS (δ<sub>AIDS</sub>) and very few of other causes (μ<sub>A</sub>). These estimates include values that affect infectivity (λ<sub><italic>î</italic>,<italic></italic>,<italic></italic>→<italic>i</italic>,<italic>j</italic></sub>), transmission (β<sub><italic>î</italic>,<italic></italic>,<italic></italic>→<italic>i</italic>,<italic>j</italic></sub>), and disease progression.</p>
<table-wrap id="T2">
<label>Table 2</label>
<caption>
<p>Transmission probabilities</p>
</caption>
<table>
<tr>
<th rowspan="3">HIV-infected partner (îıı^^, ^^, <italic>k</italic><italic>k</italic>^^)</th>
<th colspan="4">Susceptible partner (<italic>i</italic>, <italic>j</italic>)</th>
</tr>
<tr>
<td colspan="4">
<hr/>
</td>
</tr>
<tr>
<th>(^^ to <italic>j</italic>)</th>
<th>W/W</th>
<th>W/Δ32</th>
<th>Δ32/Δ32 </th>
</tr>
<tr>
<td colspan="5">
<hr/>
</td>
</tr>
<tr>
<td>Acute/primary</td>
</tr>
<tr>
<td> W/W or Δ32/Δ32</td>
<td>M to F</td>
<td>0.040</td>
<td>0.040</td>
<td>0.00040 </td>
</tr>
<tr>
<td/>
<td>F to M</td>
<td>0.020</td>
<td>0.020</td>
<td>0.00020 </td>
</tr>
<tr>
<td>Asymptomatic </td>
</tr>
<tr>
<td> W/W or Δ32/Δ32</td>
<td>M to F</td>
<td>0.0010</td>
<td>0.0010</td>
<td>10 × 10<sup>−6</sup>
</td>
</tr>
<tr>
<td/>
<td>F to M</td>
<td>0.00025</td>
<td>0.00025</td>
<td>2.5 × 10<sup>−6</sup>
</td>
</tr>
</table>
</table-wrap>
<title>Disease progression.</title>
<p>We assume three stages of HIV infection: primary (acute, stage A), asymptomatic HIV (stage B), and AIDS. The rates of transition through the first two stages are denoted by γ<sub><italic>i</italic>,<italic>j</italic>,<italic>k</italic></sub><italic>i</italic>,<italic>j</italic>,<italic>k</italic>, where <italic>i</italic> represents genotype, <italic>j</italic> is male/female, and <italic>k</italic> represents either stage A or stage B. Transition rates through each of these stages are assumed to be inversely proportional to the duration of that stage; however, other distributions are possible (<xref ref-type="bibr" rid="B31">31</xref>, <xref ref-type="bibr" rid="B44">44</xref>, <xref ref-type="bibr" rid="B45">45</xref>). Although viral loads generally peak in the first 2 months of infection, steady-state viral loads are established several months beyond this (<xref ref-type="bibr" rid="B46">46</xref>). For group A, the primary HIV-infecteds, duration is assumed to be 3.5 months. Based on results from European cohort studies (<xref ref-type="bibr" rid="B7">7</xref>–<xref ref-type="bibr" rid="B10">10</xref>), the beneficial effects of the CCR5 W/Δ32 genotype are observed mainly in the asymptomatic years of HIV infection; ≈7 years after seroconversion survival rates appear to be quite similar between heterozygous and homozygous individuals. We also assume that CCR5Δ32/Δ32-infected individuals and wild-type individuals progress similarly, and that men and women progress through each disease stage at the same rate. Given these observations, and that survival after infection may be shorter in untreated populations, we choose the duration time in stage B to be 6 years for wild-type individuals and 8 years for heterozygous individuals. Transition through AIDS, δ<sub>AIDS</sub>, is inversely proportional to the duration of AIDS. We estimate this value to be 1 year for the time from onset of AIDS to death. The progression rates are summarized in Table <xref ref-type="table" rid="T3">3</xref>.</p>
</sec>
</sec>
<sec>
<title>Prevalence of HIV</title>
<sec>
<title>Demographics and Model Validation.</title>
<p>The model was validated by using parameters estimated from available demographic data. Simulations were run in the absence of HIV infection to compare the model with known population growth rates. Infection was subsequently introduced with an initial low HIV prevalence of 0.5% to capture early epidemic behavior.</p>
<p>In deciding on our initial values for parameters during infection, we use Joint United Nations Programme on HIV/AIDS national prevalence data for Malawi, Zimbabwe, and Botswana. Nationwide seroprevalence of HIV in these countries varies from ≈11% to over 20% (<xref ref-type="bibr" rid="B3">3</xref>), although there may be considerable variation within given subpopulations (<xref ref-type="bibr" rid="B2">2</xref>, <xref ref-type="bibr" rid="B49">49</xref>).</p>
<p>In the absence of HIV infection, the annual percent population growth rate in the model is ≈2.5%, predicting the present-day values for an average of sub-Saharan African cities (data not shown). To validate the model with HIV infection, we compare our simulation of the HIV epidemic to existing prevalence data for Kenya and Mozambique (<ext-link ext-link-type="url" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.who.int/emc-hiv/fact-sheets/pdfs/kenya.pdf">http://www.who.int/emc-hiv/fact-sheets/pdfs/kenya.pdf</ext-link> and ref. <xref ref-type="bibr" rid="B51">51</xref>). Prevalence data collected from these countries follow similar trajectories to those predicted by our model (Fig. <xref ref-type="fig" rid="F2">2</xref>). </p>
<fig id="F2">
<label>Figure 2</label>
<caption>
<p>Model simulation of HIV infection in a population lacking the protective CCR5Δ32 allele compared with national data from Kenya (healthy adults) and Mozambique (blood donors, ref. <xref ref-type="bibr" rid="B17">17</xref>). The simulated population incorporates parameter estimates from sub-Saharan African demographics. Note the two outlier points from the Mozambique data were likely caused by underreporting in the early stages of the epidemic.</p>
</caption>
<graphic xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="pq1813251002">
</graphic>
</fig>
</sec>
<sec>
<title>Effects of the Allele on Prevalence.</title>
<p>After validating the model in the wild type-only population, both CCR5Δ32 heterozygous and homozygous people are included. Parameter values for HIV transmission, duration of illness, and numbers of contacts per partner are assumed to be the same within both settings. We then calculate HIV/AIDS prevalence among adults for total HIV/AIDS cases.</p>
<p>Fig. <xref ref-type="fig" rid="F3">3</xref> shows the prevalence of HIV in two populations: one lacking the mutant CCR5 allele and another carrying that allele. In the population lacking the protective mutation, prevalence increases logarithmically for the first 35 years of the epidemic, reaching 18% before leveling off. </p>
<p>In contrast, when a proportion of the population carries the CCR5Δ32 allele, the epidemic increases more slowly, but still logarithmically, for the first 50 years, and HIV/AIDS prevalence reaches ≈12% (Fig. <xref ref-type="fig" rid="F3">3</xref>). Prevalence begins to decline slowly after 70 years.</p>
</sec>
</sec>
<sec>
<title>HIV Induces Selective Pressure on Genotype Frequency</title>
<p>To observe changes in the frequency of the CCR5Δ32 allele in a setting with HIV infection as compared with the Hardy-Weinberg equilibrium in the absence of HIV, we follow changes in the total number of CCR5Δ32 heterozygotes and homozygotes over 1,000 years (Fig. <xref ref-type="fig" rid="F4">4</xref>). We initially perform simulations in the absence of HIV infection as a negative control to show there is not significant selection of the allele in the absence of infection.</p>
</sec>
Code: Select all
<counts>
<fig-count count="2"/>
<table-count count="2"/>
<equation-count count="4"/>
<page-count count="1"/>
</counts>
</article-meta>
</front>
<body>
<p>Nineteen million people have died of AIDS since the discovery of HIV in the 1980s. In 1999 alone, 5.4 million people were newly infected with HIV (ref. <xref ref-type="bibr" rid="B1">1</xref> and <ext-link ext-link-type="url" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.unaids.org/epidemicupdate/report/Epireport.html">http://www.unaids.org/epidemicupdate/report/Epireport.html</ext-link>). (For brevity, HIV-1 is referred to as HIV in this paper.) Sub-Saharan Africa has been hardest hit, with more than 20% of the general population HIV-positive in some countries (<xref ref-type="bibr" rid="B2">2</xref>, <xref ref-type="bibr" rid="B3">3</xref>). In comparison, heterosexual epidemics in developed, market-economy countries have not reached such severe levels. Factors contributing to the severity of the epidemic in economically developing countries abound, including economic, health, and social differences such as high levels of sexually transmitted diseases and a lack of prevention programs. However, the staggering rate at which the epidemic has spread in sub-Saharan Africa has not been adequately explained. The rate and severity of this epidemic also could indicate a greater underlying susceptibility to HIV attributable not only to sexually transmitted disease, economics, etc., but also to other more ubiquitous factors such as host genetics (<xref ref-type="bibr" rid="B4">4</xref>, <xref ref-type="bibr" rid="B5">5</xref>).</p>
<p>To exemplify the contribution of such a host genetic factor to HIV prevalence trends, we consider a well-characterized 32-bp deletion in the host-cell chemokine receptor CCR5, CCR5Δ32. When HIV binds to host cells, it uses the CD4 receptor on the surface of host immune cells together with a coreceptor, mainly the CCR5 and CXCR4 chemokine receptors (<xref ref-type="bibr" rid="B6">6</xref>). Homozygous mutations for this 32-bp deletion offer almost complete protection from HIV infection, and heterozygous mutations are associated with lower pre-AIDS viral loads and delayed progression to AIDS (<xref ref-type="bibr" rid="B7">7</xref>–<xref ref-type="bibr" rid="B14">14</xref>). CCR5Δ32 generally is found in populations of European descent, with allelic frequencies ranging from 0 to 0.29 (<xref ref-type="bibr" rid="B13">13</xref>). African and Asian populations studied outside the United States or Europe appear to lack the CCR5Δ32 allele, with an allelic frequency of almost zero (<xref ref-type="bibr" rid="B5">5</xref>, <xref ref-type="bibr" rid="B13">13</xref>). Thus, to understand the effects of a protective allele, we use a mathematical model to track prevalence of HIV in populations with or without CCR5Δ32 heterozygous and homozygous people and also to follow the CCR5Δ32 allelic frequency.</p>
<sec>
<title>The Model</title>
<p>Because we are most concerned with understanding the severity of the epidemic in developing countries where the majority of infection is heterosexual, we consider a purely heterosexual model. To model the effects of the allele in the population, we examine the rate of HIV spread by using an enhanced susceptible-infected-AIDS model of epidemic HIV (for review see ref. <xref ref-type="bibr" rid="B31">31</xref>). Our model compares two population scenarios: a CCR5 wild-type population and one with CCR5Δ32 heterozygotes and homozygotes in addition to the wild type.</p>
<fig id="F1">
<label>Figure 1</label>
<caption>
<p>A schematic representation of the basic compartmental HIV epidemic model. The criss-cross lines indicate the sexual mixing between different compartments. Each of these interactions has a positive probability of taking place; they also incorporate individual rates of transmission indicated as λ, but in full notation is λ<sub><italic>î</italic>,<italic></italic>,<italic></italic>→<italic>i</italic>,<italic>j</italic>,</sub> where <italic>i</italic>,<italic>j</italic>,<italic>k</italic> is the phenotype of the infected partner and <italic>î</italic>,<italic></italic> is the phenotype of the susceptible partner.</p>
</caption>
<graphic xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="pq1813251001">
</graphic>
</fig>
<table-wrap id="T1">
<label>Table 1</label>
<caption>
<p>Children's genotype</p>
</caption>
<table>
<tr>
<th>Parents</th>
<th colspan="4">Mother</th>
</tr>
<tr>
<td colspan="5">
<hr/>
</td>
</tr>
<tr>
<td>Father</td>
<td/>
<td>W/W</td>
<td>W/Δ32</td>
<td>Δ32/Δ32</td>
</tr>
</table>
<table-wrap-foot>
<fn>
<p>χ<sub>1,<italic>j</italic></sub>1,<italic>j</italic> = wild-type children; (W/W); χ<sub>2,<italic>j</italic></sub>2,<italic>j</italic> = heterozygous children (W/Δ32); χ<sub>3,<italic>j</italic></sub>3,<italic>j</italic> = homozygous children (Δ32/Δ32) of gender <italic>j</italic>. Children's genotypes are determined by using Mendelian inheritance patterns.</p>
</fn>
</table-wrap-foot>
</table-wrap>
<sec>
<title>Parameter Estimates for the Model.</title>
<p>Estimates for rates that govern the interactions depicted in Fig. <xref ref-type="fig" rid="F1">1</xref> were derived from the extensive literature on HIV. Our parameters and their estimates are summarized in Tables <xref ref-type="table" rid="T2">2</xref>–<xref ref-type="table" rid="T4">4</xref>. The general form of the equations describing the rates of transition between population classes as depicted in Fig. <xref ref-type="fig" rid="F1">1</xref> are summarized as follows: <disp-formula id="E1">
<tex-math id="M1">\documentclass[12pt]{minimal} \usepackage{wasysym} \usepackage[substack]{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage[mathscr]{eucal} \usepackage{mathrsfs} \DeclareFontFamily{T1}{linotext}{} \DeclareFontShape{T1}{linotext}{m}{n} { <-> linotext }{} \DeclareSymbolFont{linotext}{T1}{linotext}{m}{n} \DeclareSymbolFontAlphabet{\mathLINOTEXT}{linotext} \begin{document} $$ \frac{dS_{i,j}(t)}{dt}={\chi}_{i,j}(t)-{\mu}_{j}S_{i,j}(t)-{\lambda}_{\hat {\imath},\hat {},\hat {k}{\rightarrow}i,j}S_{i,j}(t), $$ \end{document} </tex-math>
</disp-formula>
<disp-formula id="E2">
<tex-math id="M2">\documentclass[12pt]{minimal} \usepackage{wasysym} \usepackage[substack]{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage[mathscr]{eucal} \usepackage{mathrsfs} \DeclareFontFamily{T1}{linotext}{} \DeclareFontShape{T1}{linotext}{m}{n} { <-> linotext }{} \DeclareSymbolFont{linotext}{T1}{linotext}{m}{n} \DeclareSymbolFontAlphabet{\mathLINOTEXT}{linotext} \begin{document} $$ \hspace{1em}\hspace{1em}\hspace{.167em}\frac{dI_{i,j,A}(t)}{dt}={\lambda}_{\hat {\imath},\hat {},\hat {k}{\rightarrow}i,j}S_{i,j}(t)-{\mu}_{j}I_{i,j,A}(t)-{\gamma}_{i,j,A}I_{i,j,A}(t), $$ \end{document} </tex-math>
</disp-formula>
<disp-formula id="E3">
<tex-math id="M3">\documentclass[12pt]{minimal} \usepackage{wasysym} \usepackage[substack]{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage[mathscr]{eucal} \usepackage{mathrsfs} \DeclareFontFamily{T1}{linotext}{} \DeclareFontShape{T1}{linotext}{m}{n} { <-> linotext }{} \DeclareSymbolFont{linotext}{T1}{linotext}{m}{n} \DeclareSymbolFontAlphabet{\mathLINOTEXT}{linotext} \begin{document} $$ \frac{dI_{i,j,B}(t)}{dt}={\gamma}_{i,j,A}I_{i,j,A}(t)-{\mu}_{j}I_{i,j,B}(t)-{\gamma}_{i,j,B}I_{i,j,B}(t), $$ \end{document} </tex-math>
</disp-formula>
<disp-formula id="E4">
<tex-math id="M4">\documentclass[12pt]{minimal} \usepackage{wasysym} \usepackage[substack]{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage[mathscr]{eucal} \usepackage{mathrsfs} \DeclareFontFamily{T1}{linotext}{} \DeclareFontShape{T1}{linotext}{m}{n} { <-> linotext }{} \DeclareSymbolFont{linotext}{T1}{linotext}{m}{n} \DeclareSymbolFontAlphabet{\mathLINOTEXT}{linotext} \begin{document} $$ \frac{dA(t)}{dt}={\gamma}_{i,j,B} \left( { \,\substack{ ^{3} \\ {\sum} \\ _{i=1} }\, }I_{i,F,B}(t)+I_{i,M,B}(t) \right) -{\mu}_{A}A(t)-{\delta}A(t), $$ \end{document} </tex-math>
</disp-formula> where, in addition to previously defined populations and rates (with <italic>i</italic> equals genotype, <italic>j</italic> equals gender, and <italic>k</italic> equals stage of infection, either <italic>A</italic> or <italic>B</italic>), μ<sub><italic>j</italic></sub>, represents the non-AIDS (natural) death rate for males and females respectively, and μ<sub>A</sub> is estimated by the average (μ<sub>F</sub> + μ<sub>M</sub>/2). This approximation allows us to simplify the model (only one AIDS compartment) without compromising the results, as most people with AIDS die of AIDS (δ<sub>AIDS</sub>) and very few of other causes (μ<sub>A</sub>). These estimates include values that affect infectivity (λ<sub><italic>î</italic>,<italic></italic>,<italic></italic>→<italic>i</italic>,<italic>j</italic></sub>), transmission (β<sub><italic>î</italic>,<italic></italic>,<italic></italic>→<italic>i</italic>,<italic>j</italic></sub>), and disease progression.</p>
<table-wrap id="T2">
<label>Table 2</label>
<caption>
<p>Transmission probabilities</p>
</caption>
<table>
<tr>
<th rowspan="3">HIV-infected partner (îıı^^, ^^, <italic>k</italic><italic>k</italic>^^)</th>
<th colspan="4">Susceptible partner (<italic>i</italic>, <italic>j</italic>)</th>
</tr>
<tr>
<td colspan="4">
<hr/>
</td>
</tr>
<tr>
<th>(^^ to <italic>j</italic>)</th>
<th>W/W</th>
<th>W/Δ32</th>
<th>Δ32/Δ32 </th>
</tr>
<tr>
<td colspan="5">
<hr/>
</td>
</tr>
<tr>
<td>Acute/primary</td>
</tr>
<tr>
<td> W/W or Δ32/Δ32</td>
<td>M to F</td>
<td>0.040</td>
<td>0.040</td>
<td>0.00040 </td>
</tr>
<tr>
<td/>
<td>F to M</td>
<td>0.020</td>
<td>0.020</td>
<td>0.00020 </td>
</tr>
<tr>
<td>Asymptomatic </td>
</tr>
<tr>
<td> W/W or Δ32/Δ32</td>
<td>M to F</td>
<td>0.0010</td>
<td>0.0010</td>
<td>10 × 10<sup>−6</sup>
</td>
</tr>
<tr>
<td/>
<td>F to M</td>
<td>0.00025</td>
<td>0.00025</td>
<td>2.5 × 10<sup>−6</sup>
</td>
</tr>
</table>
</table-wrap>
<title>Disease progression.</title>
<p>We assume three stages of HIV infection: primary (acute, stage A), asymptomatic HIV (stage B), and AIDS. The rates of transition through the first two stages are denoted by γ<sub><italic>i</italic>,<italic>j</italic>,<italic>k</italic></sub><italic>i</italic>,<italic>j</italic>,<italic>k</italic>, where <italic>i</italic> represents genotype, <italic>j</italic> is male/female, and <italic>k</italic> represents either stage A or stage B. Transition rates through each of these stages are assumed to be inversely proportional to the duration of that stage; however, other distributions are possible (<xref ref-type="bibr" rid="B31">31</xref>, <xref ref-type="bibr" rid="B44">44</xref>, <xref ref-type="bibr" rid="B45">45</xref>). Although viral loads generally peak in the first 2 months of infection, steady-state viral loads are established several months beyond this (<xref ref-type="bibr" rid="B46">46</xref>). For group A, the primary HIV-infecteds, duration is assumed to be 3.5 months. Based on results from European cohort studies (<xref ref-type="bibr" rid="B7">7</xref>–<xref ref-type="bibr" rid="B10">10</xref>), the beneficial effects of the CCR5 W/Δ32 genotype are observed mainly in the asymptomatic years of HIV infection; ≈7 years after seroconversion survival rates appear to be quite similar between heterozygous and homozygous individuals. We also assume that CCR5Δ32/Δ32-infected individuals and wild-type individuals progress similarly, and that men and women progress through each disease stage at the same rate. Given these observations, and that survival after infection may be shorter in untreated populations, we choose the duration time in stage B to be 6 years for wild-type individuals and 8 years for heterozygous individuals. Transition through AIDS, δ<sub>AIDS</sub>, is inversely proportional to the duration of AIDS. We estimate this value to be 1 year for the time from onset of AIDS to death. The progression rates are summarized in Table <xref ref-type="table" rid="T3">3</xref>.</p>
</sec>
</sec>
<sec>
<title>Prevalence of HIV</title>
<sec>
<title>Demographics and Model Validation.</title>
<p>The model was validated by using parameters estimated from available demographic data. Simulations were run in the absence of HIV infection to compare the model with known population growth rates. Infection was subsequently introduced with an initial low HIV prevalence of 0.5% to capture early epidemic behavior.</p>
<p>In deciding on our initial values for parameters during infection, we use Joint United Nations Programme on HIV/AIDS national prevalence data for Malawi, Zimbabwe, and Botswana. Nationwide seroprevalence of HIV in these countries varies from ≈11% to over 20% (<xref ref-type="bibr" rid="B3">3</xref>), although there may be considerable variation within given subpopulations (<xref ref-type="bibr" rid="B2">2</xref>, <xref ref-type="bibr" rid="B49">49</xref>).</p>
<p>In the absence of HIV infection, the annual percent population growth rate in the model is ≈2.5%, predicting the present-day values for an average of sub-Saharan African cities (data not shown). To validate the model with HIV infection, we compare our simulation of the HIV epidemic to existing prevalence data for Kenya and Mozambique (<ext-link ext-link-type="url" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.who.int/emc-hiv/fact-sheets/pdfs/kenya.pdf">http://www.who.int/emc-hiv/fact-sheets/pdfs/kenya.pdf</ext-link> and ref. <xref ref-type="bibr" rid="B51">51</xref>). Prevalence data collected from these countries follow similar trajectories to those predicted by our model (Fig. <xref ref-type="fig" rid="F2">2</xref>). </p>
<fig id="F2">
<label>Figure 2</label>
<caption>
<p>Model simulation of HIV infection in a population lacking the protective CCR5Δ32 allele compared with national data from Kenya (healthy adults) and Mozambique (blood donors, ref. <xref ref-type="bibr" rid="B17">17</xref>). The simulated population incorporates parameter estimates from sub-Saharan African demographics. Note the two outlier points from the Mozambique data were likely caused by underreporting in the early stages of the epidemic.</p>
</caption>
<graphic xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="pq1813251002">
</graphic>
</fig>
</sec>
<sec>
<title>Effects of the Allele on Prevalence.</title>
<p>After validating the model in the wild type-only population, both CCR5Δ32 heterozygous and homozygous people are included. Parameter values for HIV transmission, duration of illness, and numbers of contacts per partner are assumed to be the same within both settings. We then calculate HIV/AIDS prevalence among adults for total HIV/AIDS cases.</p>
<p>Fig. <xref ref-type="fig" rid="F3">3</xref> shows the prevalence of HIV in two populations: one lacking the mutant CCR5 allele and another carrying that allele. In the population lacking the protective mutation, prevalence increases logarithmically for the first 35 years of the epidemic, reaching 18% before leveling off. </p>
<p>In contrast, when a proportion of the population carries the CCR5Δ32 allele, the epidemic increases more slowly, but still logarithmically, for the first 50 years, and HIV/AIDS prevalence reaches ≈12% (Fig. <xref ref-type="fig" rid="F3">3</xref>). Prevalence begins to decline slowly after 70 years.</p>
</sec>
</sec>
<sec>
<title>HIV Induces Selective Pressure on Genotype Frequency</title>
<p>To observe changes in the frequency of the CCR5Δ32 allele in a setting with HIV infection as compared with the Hardy-Weinberg equilibrium in the absence of HIV, we follow changes in the total number of CCR5Δ32 heterozygotes and homozygotes over 1,000 years (Fig. <xref ref-type="fig" rid="F4">4</xref>). We initially perform simulations in the absence of HIV infection as a negative control to show there is not significant selection of the allele in the absence of infection.</p>
</sec>
How do I make the script more efficient?
Code: Select all
var countStirng = ['</disp-formula>', '</fig>','</table-wrap>'];
function myReplace1()
{
UltraEdit.activeDocument.top();
var first = countStirng[0];
UltraEdit.activeDocument.findReplace.find(first);
i = 0;
UltraEdit.clearClipboard();
while (UltraEdit.activeDocument.isFound())
{
if (UltraEdit.activeDocument.isFound()) {
i++;
}
UltraEdit.activeDocument.findReplace.find(first);
}if (i == 0){
UltraEdit.activeDocument.top();
UltraEdit.insertMode();
if (typeof(UltraEdit.columnModeOff) == "function") UltraEdit.columnModeOff();
else if (typeof(UltraEdit.activeDocument.columnModeOff) == "function") UltraEdit.activeDocument.columnModeOff();
UltraEdit.activeDocument.hexOff();
UltraEdit.activeDocument.findReplace.mode=0;
UltraEdit.activeDocument.findReplace.matchCase=false;
UltraEdit.activeDocument.findReplace.matchWord=false;
UltraEdit.activeDocument.findReplace.regExp=true;
UltraEdit.activeDocument.findReplace.searchDown=true;
UltraEdit.activeDocument.findReplace.searchInColumn=false;
UltraEdit.activeDocument.findReplace.preserveCase=false;
UltraEdit.activeDocument.findReplace.replaceAll=true;
UltraEdit.activeDocument.findReplace.replaceInAllOpen=false;
UltraEdit.activeDocument.findReplace.replace('<equation-count count="[0-9]+"/>', '<equation-count count="0"/>');
} else {
UltraEdit.activeDocument.top();
UltraEdit.insertMode();
if (typeof(UltraEdit.columnModeOff) == "function") UltraEdit.columnModeOff();
else if (typeof(UltraEdit.activeDocument.columnModeOff) == "function") UltraEdit.activeDocument.columnModeOff();
UltraEdit.activeDocument.hexOff();
UltraEdit.activeDocument.findReplace.mode=0;
UltraEdit.activeDocument.findReplace.matchCase=false;
UltraEdit.activeDocument.findReplace.matchWord=false;
UltraEdit.activeDocument.findReplace.regExp=true;
UltraEdit.activeDocument.findReplace.searchDown=true;
UltraEdit.activeDocument.findReplace.searchInColumn=false;
UltraEdit.activeDocument.findReplace.preserveCase=false;
UltraEdit.activeDocument.findReplace.replaceAll=true;
UltraEdit.activeDocument.findReplace.replaceInAllOpen=false;
UltraEdit.activeDocument.findReplace.replace('<equation-count count="[0-9]+"/>', '<equation-count count="'+i+'"/>');
}
}
function myReplace2()
{
UltraEdit.activeDocument.top();
var second = countStirng[1];
UltraEdit.activeDocument.findReplace.find(second);
i = 0;
UltraEdit.clearClipboard();
while (UltraEdit.activeDocument.isFound())
{
if (UltraEdit.activeDocument.isFound()) {
i++;
}
UltraEdit.activeDocument.findReplace.find(second);
}if (i == 0){
UltraEdit.activeDocument.top();
UltraEdit.insertMode();
if (typeof(UltraEdit.columnModeOff) == "function") UltraEdit.columnModeOff();
else if (typeof(UltraEdit.activeDocument.columnModeOff) == "function") UltraEdit.activeDocument.columnModeOff();
UltraEdit.activeDocument.hexOff();
UltraEdit.activeDocument.findReplace.mode=0;
UltraEdit.activeDocument.findReplace.matchCase=false;
UltraEdit.activeDocument.findReplace.matchWord=false;
UltraEdit.activeDocument.findReplace.regExp=true;
UltraEdit.activeDocument.findReplace.searchDown=true;
UltraEdit.activeDocument.findReplace.searchInColumn=false;
UltraEdit.activeDocument.findReplace.preserveCase=false;
UltraEdit.activeDocument.findReplace.replaceAll=true;
UltraEdit.activeDocument.findReplace.replaceInAllOpen=false;
UltraEdit.activeDocument.findReplace.replace('<fig-count count="[0-9]+"/>', '<fig-count count="0"/>');
} else {
UltraEdit.activeDocument.top();
UltraEdit.insertMode();
if (typeof(UltraEdit.columnModeOff) == "function") UltraEdit.columnModeOff();
else if (typeof(UltraEdit.activeDocument.columnModeOff) == "function") UltraEdit.activeDocument.columnModeOff();
UltraEdit.activeDocument.hexOff();
UltraEdit.activeDocument.findReplace.mode=0;
UltraEdit.activeDocument.findReplace.matchCase=false;
UltraEdit.activeDocument.findReplace.matchWord=false;
UltraEdit.activeDocument.findReplace.regExp=true;
UltraEdit.activeDocument.findReplace.searchDown=true;
UltraEdit.activeDocument.findReplace.searchInColumn=false;
UltraEdit.activeDocument.findReplace.preserveCase=false;
UltraEdit.activeDocument.findReplace.replaceAll=true;
UltraEdit.activeDocument.findReplace.replaceInAllOpen=false;
UltraEdit.activeDocument.findReplace.replace('<fig-count count="[0-9]+"/>', '<fig-count count="'+i+'"/>');
}
}
function myReplace3()
{
UltraEdit.activeDocument.top();
var third = countStirng[2];
UltraEdit.activeDocument.findReplace.find(third);
i = 0;
UltraEdit.clearClipboard();
while (UltraEdit.activeDocument.isFound())
{
if (UltraEdit.activeDocument.isFound()) {
i++;
}
UltraEdit.activeDocument.findReplace.find(third);
}if (i == 0){
UltraEdit.activeDocument.top();
UltraEdit.insertMode();
if (typeof(UltraEdit.columnModeOff) == "function") UltraEdit.columnModeOff();
else if (typeof(UltraEdit.activeDocument.columnModeOff) == "function") UltraEdit.activeDocument.columnModeOff();
UltraEdit.activeDocument.hexOff();
UltraEdit.activeDocument.findReplace.mode=0;
UltraEdit.activeDocument.findReplace.matchCase=false;
UltraEdit.activeDocument.findReplace.matchWord=false;
UltraEdit.activeDocument.findReplace.regExp=true;
UltraEdit.activeDocument.findReplace.searchDown=true;
UltraEdit.activeDocument.findReplace.searchInColumn=false;
UltraEdit.activeDocument.findReplace.preserveCase=false;
UltraEdit.activeDocument.findReplace.replaceAll=true;
UltraEdit.activeDocument.findReplace.replaceInAllOpen=false;
UltraEdit.activeDocument.findReplace.replace('<table-count count="[0-9]+"/>', '<table-count count="0"/>');
} else {
UltraEdit.activeDocument.top();
UltraEdit.insertMode();
if (typeof(UltraEdit.columnModeOff) == "function") UltraEdit.columnModeOff();
else if (typeof(UltraEdit.activeDocument.columnModeOff) == "function") UltraEdit.activeDocument.columnModeOff();
UltraEdit.activeDocument.hexOff();
UltraEdit.activeDocument.findReplace.mode=0;
UltraEdit.activeDocument.findReplace.matchCase=false;
UltraEdit.activeDocument.findReplace.matchWord=false;
UltraEdit.activeDocument.findReplace.regExp=true;
UltraEdit.activeDocument.findReplace.searchDown=true;
UltraEdit.activeDocument.findReplace.searchInColumn=false;
UltraEdit.activeDocument.findReplace.preserveCase=false;
UltraEdit.activeDocument.findReplace.replaceAll=true;
UltraEdit.activeDocument.findReplace.replaceInAllOpen=false;
UltraEdit.activeDocument.findReplace.replace('<table-count count="[0-9]+"/>', '<table-count count="'+i+'"/>');
}
}
myReplace1();
myReplace2();
myReplace3();