-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathChapter2.Rtex
1502 lines (1008 loc) · 72.5 KB
/
Chapter2.Rtex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
%--------------------------------------------------------------------------------------------------------------------------------%
% Code and text for "Understanding how population structure affects pathogen richness in a mechanistic model of bat populations"
% Chapter 3 of thesis "The role of population structure and size in determining bat pathogen richness"
% by Tim CD Lucas
%
% NB The file is numbered Chapter2 as this was previously Chapter 2 in the thesis.
%
%---------------------------------------------------------------------------------------------------------------------------------%
%%begin.rcode settings, echo = FALSE, cache = FALSE, message = FALSE, results = 'hide'
####################################
### Important simulation options ###
####################################
# Compilation options
# Run simulations? This will take many hours
runAllSims <- FALSE
# Save raw simulation output
# This will take ~10GB or so.
# If false, summary statistics of each simulation are saved instead.
saveData <- FALSE
# How many cores do you want to use to run simulations?
nCores <- 7
##########################
### End options ###
##########################
opts_chunk$set(cache.path = '.Ch2Cache/')
source('misc/theme_tcdl.R')
source('misc/KnitrOptions.R')
theme_set(theme_grey() + theme_tcdl)
%%end.rcode
%%begin.rcode libs, cache = FALSE, result = FALSE
# My package. For running and analysing Epidemiological sims.
# /~https://github.com/timcdlucas/metapopepi
library(MetapopEpi)
# Data manipulations
library(reshape2)
library(dplyr)
# Calc confidence intervals (could probably do with broom instead now.)
library(binom)
# To tidy up stats models/tests
library(broom)
# Run simulations in parallel
library(parallel)
# Plotting
library(ggplot2)
library(palettetown)
library(cowplot)
%%end.rcode
\section{Abstract}
%\tmpsection{One or two sentences providing a basic introduction to the field}
% comprehensible to a scientist in any discipline.
%\lettr{A}n increasingly large proportion of emerging human diseases comes from animals.
%These diseases have a huge impact on human health, healthcare systems and economic development.
The chance that a new zoonosis will come from any particular wild host species increases with the number of pathogen species occurring in that host species.
Comparative, phylogenetic studies have shown that host-species traits such as population density and population structure correlate with pathogen richness
However, the mechanisms by which these factors control pathogen richness in wild animal species remain unclear.
%
%
%\tmpsection{Two to three sentences of more detailed background}
% comprehensible to scientists in related disciplines.
% Add mechanistic vs empirical
Typically it is assumed that well-connected, unstructured populations (that therefore have a high basic reproductive number, $R_0$) promote the invasion of new pathogens and therefore increase pathogen richness. However, this assumption is largely untested in the multipathogen context.
In the presence of inter-pathogen competition, the opposite effect might occur; increased population structure may increase pathogen richness by reducing the effects of competition.
A more mechanistic understanding of how population structure affects pathogen richness could discriminate between these two broad hypotheses.
Here I have examined one mechanism by which increased population structure may cause greater pathogen richness.
I used simulations to test whether increased population structure could increase the probability that a newly evolved pathogen would invade into a population already infected with an identical, endemic pathogen.
I tested this hypothesis using individual-based, metapopulation networks parameterised to mimic wild bat populations as bats have highly varied social structures and have recently been implicated in a number of high profile diseases such as Ebola, SARS, Hendra and Nipah.
In a metapopulation, dispersal rate and the number of links between colonies can both affect population structure.
I tested whether either of these factors could increase the probability that a pathogen would invade and persist in the population.
I found that, at intermediate transmission rates, increasing dispersal rate significantly increased the probability of a newly evolved pathogen invading into the metapopulation.
However, there was very limited evidence that the number of links between colonies affected pathogen invasion probability.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Introduction}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Possible structure (each number a sep. paragraph):
%1. zoonotics bad, need to predict spillover, factors controlling pathogen richness unknown
%2. results from comparative studies (including mammal and bat ones), explaining why population structure is important
%3. limitations of comparative studies (including highlighting that empirical and mechanistic approaches would give different predictions) that and need a more mechanistic approach
%4. description of the possible mechanisms for population structure - explaining why focusing on reduction of competition mechanisms
%5. results from analytical models so far and limitations of the approach
%6. what is needed now
%7. what your focus is (including a bit about bat focus)
%8. 'here I show..' what you found briefly to lead into methods
\tmpsection{General Intro}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% A basic introduction to the field,
% comprehensible to a scientist in any discipline.
%1. zoonotics bad, need to predict spillover, factors controlling pathogen richness unknown
\tmpsection{Why is pathogen richness? important?}
Over 60\% of emerging infectious diseases have an animal source \cite{jones2008global, smith2014global}.
Zoonotic pathogens can be highly virulent \cite{luby2009recurrent, lefebvre2014case} and can have huge public health impacts \cite{granich2015trends}, economic costs \cite{knobler2004learning} and slow down international development \cite{ebolaWorldbank}.
Therefore understanding and predicting changes in the process of zoonotic spillover is a global health priority \cite{taylor2001risk}.
The number of pathogen species hosted by a wild animal species affects the chance that a disease from that species will infect humans \cite{wolfe2000deforestation}.
However, the factors that control the number of pathogen species in a wild animal population are still unclear \cite{metcalf2015five}; in particular our mechanistic understanding of how population processes inhibit or promote pathogen richness is poor.
\tmpsection{Specific Intro}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% more detailed background}
% comprehensible to scientists in related disciplines.
\tmpsection{We know some factors that correlate with pathogen richness}
%population density, longevity, body size and population structure
%2. results from comparative studies (including mammal and bat ones), explaining why population structure is important
%3. limitations of comparative studies (including highlighting that empirical and mechanistic approaches would give different predictions) that and need a more mechanistic approach
In comparative studies, a number of host traits have been shown to correlate with pathogen richness including body size \cite{kamiya2014determines, arneberg2002host}, population density \cite{nunn2003comparative, arneberg2002host} and range size \cite{bordes2011impact, kamiya2014determines}.
A further factor that may affect pathogen richness is population structure.
In comparative studies it is often assumed that factors that promote fast disease spread should promote high pathogen richness; the faster a new pathogen spreads through a population, the more likely it is to persist \cite{nunn2003comparative, morand2000wormy, poulin2014parasite, poulin2000diversity, altizer2003social}.
However, this assumption ignores competitive mechanisms such as cross-immunity and depletion of susceptible hosts.
If competitive mechanisms are strong, endemic pathogens in populations with high $R_0$ will be able to easily out-compete invading pathogens.
Only if competitive mechanisms are weak will high $R_0$ enable the invasion of new pathogens and allow higher pathogen richness.
Overall, the evidence from comparative studies indicates that increased population structure correlates with higher pathogen richness.
This conclusion is based on studies using a number of measures of population structure: genetic measures, the number of subspecies, the shape of species distributions and social group size (Chapter~\ref{ch:empirical}, \cites{vitone2004body, maganga2014bat, turmelle2009correlates}).
However, there are a number of studies that contradict this conclusion \cite{gay2014parasite, bordes2007rodent, ezenwa2006host}.
Comparative studies are often contradictory due to small sample sizes, noisy data and because empirical relationships often do not extrapolate well to other taxa.
Furthermore, multicollinearity between many traits also makes it hard to clearly distinguish which factors are important \cite{nunn2015infectious}.
However, meta-analyses can be used to combine studies to help generalise conclusions \cite{kamiya2014determines}.
%3. limitations of comparative studies (including highlighting that empirical and mechanistic approaches would give different predictions) that and need a more mechanistic approach
Furthermore, knowing which factors correlate with pathogen richness does not tell us if, or how, they causally control pathogen richness.
This lack of a solid mechanistic understanding of these processes prevents predictions of how wild populations will respond to perturbations such as increased human pressure and global change.
As habitats fragment we expect wild populations to change in a number of ways including becoming smaller and less well connected \cite{andren1994effects, cushman2012separating}.
As multiple population-level factors are likely to change simultaneously due to global change, the correlative relationships examined in comparative studies are unlikely to effectively predict future changes in pathogen richness.
Mechanistic models are needed to project how these highly non-linear disease systems will respond to the multiple, simultaneous stressors affecting them.
\tmpsection{Network structure has been studied}
%5. results from analytical models so far and limitations of the approach
%4. description of the possible mechanisms for population structure - explaining why focusing on reduction of competition mechanisms
There are a number of mechanisms by which population structure could increase pathogen richness.
Firstly, population structure may reduce competition between pathogens.
In analytical models of well-mixed populations competitive exclusion has been predicted \cite{ackleh2003competitive, bremermann1989competitive, martcheva2013competitive, qiu2013vector, allen2004sis}.
In models where competitive exclusion occurs in well-mixed populations, population structure has sometimes been shown to allow coexistence \cite{qiu2013vector, allen2004sis, nunes2006localized, garmer2016multistrain}.
Alternatively, population structure may promote the evolution of new strains within a species \cite{buckee2004effects}, reduce the rate of pathogen extinction \cite{rand1995invasion} or increase the probability of pathogen invasion from other host species \cite{nunes2006localized}.
These separate mechanisms have not been examined and it is difficult to see how they could be distinguished through comparative methods.
%Competing epidemics, or two pathogens spreading at the same time in a population, is a well studied area \cite{poletto2013host, poletto2015characterising, karrer2011competing}.
%This area is related to the study of pathogen richness in that they indicate that dynamics of multiple pathogens in a population do depend on population %structure.
%However, the results for short term epidemic competition do not directly transfer to the study of long term disease persistence.
%6. what is needed now
\tmpsection{The gap}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% One sentence clearly stating the general problem
% being addressed by this particular study.
% By this stage, must have defined/introduced all terms used within.
Currently, the literature contains very abstract, simplified models \cite{qiu2013vector, allen2004sis, garmer2016multistrain, may1994superinfection}.
These cannot be easily applied to real data.
They also do not easily give quantitative predictions of pathogen richness; typically they predict either no pathogen coexistence \cite{bremermann1989competitive, martcheva2013competitive} or infinite pathogen richness \cite{may1994superinfection}.
Models that can give quantitative predictions of pathogen richness in wild populations are more applicable to real-world issues such as zoonotic disease surveillance.
While predicting an absolute value of pathogen richness for a wild species is likely to be impossible, models that attempt to rank species from highest to lowest pathogen richness are still useful for prioritising species for surveillance.
This requires a middle ground of model complexity.
\tmpsection{What I did}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%7. what your focus is (including a bit about bat focus)
In order to capture this middle ground, I have used metapopulation models.
Unlike two-patch models that are used to add population structure while keeping model complexity to a minimum \cite{qiu2013vector, allen2004sis, garmer2016multistrain}, the metapopulations used here split the population into multiple subpopulations.
I have used two independent variables that alter population structure: dispersal rate and metapopulation network topology.
I have studied the invasion of new pathogens as a mechanism for increasing pathogen richness.
In particular I have focused on studying the invasion of a newly evolved pathogen that is therefore identical in epidemiological parameters to the endemic pathogen.
Furthermore, this close evolutionary relationship means that competition via cross-immunity is strong.
\tmpsection{Why bats}
The metapopulations were parameterised to broadly mimic wild bat populations.
Population structure has already been found to correlate with pathogen richness in bats (Chapter~\ref{ch:empirical}, \cites{gay2014parasite, maganga2014bat, turmelle2009correlates}).
Furthermore, bats have an unusually large variety of social structures.
Colony sizes range from ten to 1 million individuals \cite{jones2009pantheria} and colonies can be very stable \cite{kerth2011bats, mccracken1981social}.
This strong colony fidelity means they fit the assumptions of metapopulations well.
Bats have also, over the last decade, become a focus for disease research \cite{calisher2006bats, hughes2007emerging}.
The reason for this focus is that they have been implicated in a number of high profile diseases including Ebola, SARS, Hendra and Nipah \cite{calisher2006bats, li2005bats}.
%8. 'here I show..' what you found briefly to lead into methods
\tmpsection{What I found}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% One sentence summarising the main result
% (with the words “here we show” or their equivalent).
Here I found that, given the assumptions of a metapopulation, increased dispersal significantly increased the probability of invasion of new pathogens.
Furthermore, structured populations nearly always had a lower probability of pathogen invasion than fully-mixed populations of equal size.
The topology of the network did not strongly affect the probability of pathogen invasion as long as the population was not completely unconnected.
Overall, I found significant evidence that reduced population structure increases the probability of invasion of a new pathogen, implying a role for the generation of pathogen richness more generally.
\begin{figure}[t]
\centering
\includegraphics[width=0.5\textwidth]{imgs/SIRoption1.pdf}
\caption[Schematic of the SIR model used]{
Schematic of the SIR model used.
Individuals are in one of five classes, susceptible (orange, $S$), infected with Pathogen 1, Pathogen 2 or both (blue, $I_1, I_2, I_{12}$) or recovered and immune from further infection (green, $R$).
Transitions between epidemiological classes occur as indicated by solid arrows.
Vital dynamics (births and deaths) are indicated by dashed arrows.
Parameter symbols for transitions are indicated.
Note that individuals in $I_{12}$ move into $R$, not back to $I_1$ or $I_2$.
That is, recovery from one pathogen causes immediate recovery from the other pathogen.
}
\label{f:sir}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Methods}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
\subsection{Two pathogen SIR model}
I developed a multipathogen, SIR compartment model with individuals being classed as susceptible, infected or recovered with immunity (Figure~\ref{f:sir}).
Susceptible individuals are counted in class $S$ (see Table~\ref{t:params} for a list of symbols and values used).
There are three infected classes, $I_1$, $I_2$ and $I_{12}$, being individuals infected with Pathogen 1, Pathogen 2 or both respectively.
Recovered individuals, $R$, are immune to both pathogens, even if they have only been infected with one (i.e.\ there is complete cross-immunity).
Furthermore, recovery from one pathogen moves an individual straight into the recovered class, even if the individual is infected with both pathogens (Figure~\ref{f:sir}).
This modelling choice allows the model to be easily expanded to include more than two pathogens, though this study is restricted to two pathogens.
The assumption of immediate recovery from all other diseases is likely to be reasonable.
Any up-regulation of innate immune response will affect both pathogens equally.
Furthermore, as the pathogens are identical, any acquired immunity would also affect both pathogens equally.
The coinfection rate (the rate at which an infected individual is infected with a second pathogen) is adjusted compared to the infection rate by a factor $\alpha$.
As in \textcite{castillo1989epidemiological}, low values of $\alpha$ imply lower rates of coinfection.
In particular, $\alpha = 0$ indicates no coinfections, $\alpha = 1$ indicates that coinfections happen at the same rate as first infections while $\alpha > 1$ indicates that coinfections occur more readily than first infections.
\begin{figure}[t]
{\centering
\subfloat[Minimally connected\label{fig:fullyConnected}]{
\includegraphics[width=0.45\textwidth]{imgs/minimallyConnected.pdf}
}
\subfloat[Fully connected
\label{fig:minimallyConnected}]{
\includegraphics[width=0.45\textwidth]{imgs/fullyConnected.pdf}
}
}
\caption[Network topologies used to compare network connectedness]{
The two network topologies used to test whether network connectedness influences a pathogen's ability to invade.
A) Animals can only disperse to neighbouring colonies.
B) Dispersal can occur between any colonies.
Blue circles are colonies of \SI{3000} individuals.
Dispersal only occurs between colonies connected by an edge (black line).
The dispersal rate is held constant between the two topologies.
}
\label{f:net}
\end{figure}
In the application of long term existence of pathogens it is necessary to include vital dynamics (births and deaths) as the SIR model without vital dynamics has no endemic state.
Birth and death rates ($\Lambda$ and $\mu$) are set as being equal meaning the population does not systematically increase or decrease.
The population size does however change as a random walk.
New born individuals enter the susceptible class.
Infection and coinfection were assumed to cause no extra mortality as for a number of viruses, bats show no clinical signs of infection \cite{halpin2011pteropid, deThoisy2016bioecological}.
%In humans, coinfection generally worsens health \cite{griffiths2011nature} but as there are
\tmpsection{Metapopulation}
\begin{table}[tb]
\centering
\caption[All symbols used in Chapters~\ref{ch:sims1} and \ref{ch:sims2}]{A summary of all symbols used in Chapters~\ref{ch:sims1} and \ref{ch:sims2} along with their units and default values.
The justifications for parameter values are given in Section~\ref{s:paramSelect}.}
\begin{tabular}{@{}lp{6cm}p{2.9cm}r@{}}
\toprule
Symbol & Explanation & Units & Value\\
\midrule
$\rho$ & Number of pathogens && 2\\
$x, y$ & Colony index &&\\
$p$ & Pathogen index i.e.\ $p\in\{1,2\}$ for pathogens 1 and 2 & &\\
$q$ & Disease class i.e.\ $q\in\{1,2,12\}$&\\
$S_x$ & Number of susceptible individuals in colony $x$ &&\\
$I_{qx}$ & Number of individuals infected with disease(s) $q \in \{1, 2, 12\}$ in colony $x$ &&\\
$R_x$ & Number of individuals in colony $x$ in the recovered with immunity class &&\\
$N$ & Total Population size && 30,000\\
$m$ & Number of colonies&& 10\\
$n$ & Colony size && 3,000\\
$a$ & Area & \si{\square\kilo\metre}& 10,000\\
$\beta$ & Transmission rate & & 0.1 -- 0.4\\
$\alpha$ & Coinfection adjustment factor & & 0.1\\
$\gamma$ & Recovery rate & year$^{-1}.$individual$^{-1}$ & 1\\
$\xi$ & Dispersal rate & year$^{-1}.$individual$^{-1}$ & 0.001--0.1\\
$\Lambda$ & Birth rate & year$^{-1}.$individual$^{-1}$ & 0.05\\
$\mu$ & Death rate & year$^{-1}.$individual$^{-1}$ & 0.05\\
$k_x$ & Degree of node $x$ (number of colonies that individuals from colony $x$ can disperse to). &&\\
$\delta$ & Waiting time until next event & years &\\
$e_i$ & The rate at which event $i$ occurs & year$^{-1}$&\\
\bottomrule
\end{tabular}
\label{t:params}
\end{table}
The population is modelled as a metapopulation, being divided into a number of subpopulations (colonies).
This model is an intermediate level of complexity between fully-mixed populations and contact networks.
There is ample evidence that bat populations are structured to some extent.
This evidence comes from the existence of subspecies, measurements of genetic dissimilarity and ecological studies \cite{kerth2011bats, mccracken1981social, burns2014correlates, wilson2005mammal}.
Therefore a fully mixed population is a large oversimplification.
However, trying to study the contact network relies on detailed knowledge of individual behaviour which is rarely available.
The metapopulation is modelled as a network with colonies being nodes and dispersal between colonies being indicated by edges (Figure~\ref{f:net}).
Individuals within a colony interact randomly so that the colony is fully mixed.
Dispersal between colonies occurs at a rate $\xi$.
Individuals can only disperse to colonies connected to theirs by an edge in the network.
The rate of dispersal is not affected by the number of edges a colony has (known as the degree of the colony and denoted $k$).
Therefore, the dispersal rate from a colony $y$ with degree $k_y$ to colony $x$ is $\xi / k_y$.
Note this rate is not affected by the degree and size of colony $x$.
\tmpsection{Stochastic simulations}
I examined this model using stochastic, continuous-time simulations implemented in \emph{R} \cite{R}.
The implementation is available as an \emph{R} package on GitHub \cite{metapopepi}.
The model can be written as a continuous-time Markov chain.
The Markov chain contains the random variables $((S_x)_{x = 1\ldots m}, (I_{x, q})_{x =1\ldots m,\:q \in \{1, 2, 12\}}, (R_x)_{x = 1\ldots m})$.
Here, $(S_x)_{x = 1\ldots m}$ is a length $m$ vector of the number of susceptibles in each colony.
$(I_{x, q})_{x =1\ldots m, q \in \{1, 2, 12\}}$ is a length $m \times 3$ vector describing the number of individuals of each disease class ($q \in \{1, 2, 12\}$) in each colony.
Finally, $(R_x)_{x = 1\ldots m}$ is a length $m$ vector of the number of individuals in the recovered class.
The model is a Markov chain where extinction of both pathogen species and extinction of the host species are absorbing states.
The expected time for either host to go extinct is much larger than the duration of the simulations.
At any time, suppose the system is in state $((s_x), (i_{x,q}), (r_x))$.
At each step in the simulation we calculate the rate at which each possible event might occur.
One event is then randomly chosen, weighted by its rate
\begin{align}
p(\text{event } i) = \frac{e_i}{\sum_j e_j},
\end{align}
where $e_i$ is the rate at which event $i$ occurs and $\sum_j e_j$ is the sum of the rates of all possible events.
Finally, the length of the time step, $\delta$, is drawn from an exponential distribution
\begin{align}
\delta \sim \operatorname{Exp}\left(\sum_j e_j \right).
\end{align}
We can now write down the rates of all events.
%I defined $I^+_p$ to be the sum of all classes that are infectious with pathogen $p$, for example $I^+_1 = I_1 + I_{12}$.
Assuming asexual reproduction, that all classes reproduce at the same rate and that individuals are born into the susceptible class we get
\begin{align}
s_x \rightarrow s_x + 1 \;\;\;\text{at a rate of}\;\; \Lambda\left( s_{x}+\sum_q i_{qx} + r_{x}\right)
\end{align}
where $s_x \rightarrow s_x + 1$ is the event that the number of susceptibles in colony $x$ will increase by 1 (a single birth) and $\sum_q i_{qx}$ is the sum of all infection classes $q~\in~\{1, 2, 12\}$.
The rates of death, given a death rate $\mu$, and no increased mortality due to infection, are given by
\begin{align}
s_x \rightarrow s_x-1 &\;\;\;\text{at a rate of}\;\; \mu s_x, \\
i_{qx} \rightarrow i_{qx}-1 &\;\;\text{at a rate of}\;\; \mu i_{qx},\\
r_x \rightarrow r_x-1 &\;\;\;\text{at a rate of}\;\; \mu r_x.
\end{align}
I modelled transmission as being density-dependent.
This assumption was more suitable than frequency-dependent transmission as I was modelling a disease transmitted by saliva or urine in highly dense populations confined to caves, buildings or potentially a small number of tree roosts.
I was notably not modelling a sexually transmitted disease (STD) as spillover of STDs from bats to humans is likely to be rare.
Infection of a susceptible with either Pathogen 1 or 2 is therefore given by
\begin{align}
i_{1x} \rightarrow i_{1x}+1,\;\;\; s_x \rightarrow s_x-1 &\;\;\text{at a rate of}\;\; \beta s_x\left(i_{1x} + i_{12x}\right),\\
i_{2x} \rightarrow i_{2x}+1,\;\;\; s_x \rightarrow s_x-1 &\;\;\text{at a rate of}\;\; \beta s_x\left(i_{2x} + i_{12x}\right),
\end{align}
while coinfection, given the coinfection adjustment factor $\alpha$, is given by
\begin{align}
i_{12,x} \rightarrow i_{12,x}+1,\;\;\; i_{1x} \rightarrow i_{1x}-1 &\;\;\text{at a rate of}\;\; \alpha\beta i_{1x}\left(i_{2x} + i_{12x}\right),\\
i_{12,x} \rightarrow i_{12,x}+1,\;\;\; i_{2x} \rightarrow i_{2x}-1 &\;\;\text{at a rate of}\;\; \alpha\beta i_{2x}\left(i_{1x} + i_{12x}\right).
\end{align}
Note that lower values of $\alpha$ give lower rates of infection as in \textcite{castillo1989epidemiological}.
The rate of migration from colony $y$ (with degree $k_y$) to colony $x$, given a dispersal rate $\xi$ is given by
\begin{align}
s_x \rightarrow s_x+1,\;\;\; s_y \rightarrow s_y-1 &\;\;\text{at a rate of}\;\; \frac{\xi s_y}{k_y},\\
i_{qx} \rightarrow i_{qx}+1,\;\;\; i_{qy} \rightarrow i_{qy}-1 &\;\;\text{at a rate of}\;\; \frac{\xi i_{qy}}{k_y},\\
r_x \rightarrow r_x+1,\;\;\; r_y \rightarrow r_y-1 &\;\;\text{at a rate of}\;\; \frac{\xi r_y}{k_y}.
\end{align}
Note that the dispersal rate does not change with infection.
As above, this is due to the low virulence of bat viruses.
Finally, recovery from any infectious class occurs at a rate $\gamma$
\begin{align}
i_{qx} \rightarrow i_{qx}-1,\;\; r_x \rightarrow r_x+1 \;\;\text{at a rate of}\;\; \gamma i_{qx}.
\end{align}
%%begin.rcode SimLengths
# These apply to both topo and disp sims. And probably should apply to extinction sims if I include them.
# How long should the simulation last?
nEvent <- 8e5
# When should the invading pathogen be added.
invadeT <- 3e5
%%end.rcode
% ------------------------------------------------------------------ %
% Dispersal Sims
% ------------------------------------------------------------------ %
%%begin.rcode DispSimsFuncs
#################################
# Dispersal sim definitions #
#################################
# How often should the population be sampled. Only sampled populations are saved.
sample <- 1000
# How many simulations to run?
each <- 100
nDispSims <- 12 * each
# Define our simulation function.
fullSim <- function(x){
dispVec <- rep(c(0.001, 0.01, 0.1), each = nDispSims/3 +1)
disp <- dispVec[x]
tranVec <- rep(c(0.1, 0.2, 0.3, 0.4 ), nDispSims/3 + 1)
tran <- tranVec[x]
# Set seed (this is set within each parallel simulation to prevent reusing random numbers).
simSeed <- paste0(seed, x)
set.seed(simSeed)
# Make the population.
p <- makePop(model = 'SIR', events = nEvent, nColonies = 10, nPathogens = 2, recovery = 1, sample = sample, dispersal = disp, birth = 0.05, death = 0.05, crossImmunity = 0.1, meanColonySize = 3000, infectDeath = 0, transmission = tran, maxDistance = 100, colonySpatialDistr = 'circle')
# Seed endemic pathogen.
for(i in 1:10){
p <- seedPathogen(p, 2, n = 200, diffCols = FALSE)
}
# Burn in simulation
p <- runSim(p, end = invadeT)
# Seed invading pathogen.
p$I[2, 1, (invadeT + 1) %% sample] <- 5
# Recalculate rates of each event after seeding.
p <- transRates(p, (invadeT + 1) %% sample)
# Continue simulation
p <- runSim(p, start = invadeT + 1, end = 'end')
# Was the invasion succesful?
invasion <- findDisDistr(p, 2)[1] > 0
# Save summary stats
d <- data.frame(transmission = NA)
d$transmission <- p$parameters['transmission']
d$dispersal <- p$parameters['dispersal']
d$nExtantDis <- sum(findDisDistr(p, 2) > 0)
d$singleInf <- findCoinfDistr(p, 2)[2]
d$doubleInf <- findCoinfDistr(p, 2)[3]
d$nColonies <- p$parameters['nColonies']
d$nPathogens <- p$parameters['nPathogens']
d$meanK <- sum(p$adjacency != 0 )/p$parameters['nColonies']
d$maxDistance <- p$parameters['maxDistance']
d$nEvents <- p$parameters['events']
message(paste0("finished ", x, ". Invasion: ", invasion ))
if(saveData){
file <- paste0('data/Chapter2/DispSims/DispSim_', formatC(x, width = 4, flag = '0'), '.RData')
save(p, file = file)
}
rm(p)
return(d)
}
%%end.rcode
%%begin.rcode runDispSim, eval = runAllSims, cache = TRUE
# Create and set seed (seed object is used to set seed in each seperate simulation.'
seed <- 33355
set.seed(seed)
# If we want to save the data, make a directory for it.
if(saveData){
dir.create('data/Chapter2/DispSims/')
}
# Run sims.
z <- mclapply(1:nDispSims, . %>% fullSim, mc.preschedule = FALSE, mc.cores = nCores)
z <- do.call(rbind, z)
# Save summary data.
write.csv(z, file = 'data/Chapter2/DispSims.csv')
%%end.rcode
%%begin.rcode extraMidBeta, eval = runAllSims
nExtraSims <- 150
# Define our simulation function.
fullSim <- function(x){
dispVec <- rep(c(0.001, 0.01, 0.1), each = nExtraSims/3 + 1)
disp <- dispVec[x]
tranVec <- rep(c(0.2, 0.3), nExtraSims/2 + 1)
tran <- tranVec[x]
# Set seed (this is set within each parallel simulation to prevent reusing random numbers).
simSeed <- paste0(seed, x)
set.seed(simSeed)
# Make the population.
p <- makePop(model = 'SIR', events = nEvent, nColonies = 10, nPathogens = 2, recovery = 1, sample = sample, dispersal = disp, birth = 0.05, death = 0.05, crossImmunity = 0.1, meanColonySize = 3000, infectDeath = 0, transmission = tran, maxDistance = 100, colonySpatialDistr = 'circle')
# Seed endemic pathogen.
for(i in 1:10){
p <- seedPathogen(p, 2, n = 200, diffCols = FALSE)
}
# Burn in simulation
p <- runSim(p, end = invadeT)
# Seed invading pathogen.
p$I[2, 1, (invadeT + 1) %% sample] <- 5
# Recalculate rates of each event after seeding.
p <- transRates(p, (invadeT + 1) %% sample)
# Continue simulation
p <- runSim(p, start = invadeT + 1, end = 'end')
# Was the invasion succesful?
invasion <- findDisDistr(p, 2)[1] > 0
# Save summary stats
d <- data.frame(transmission = NA)
d$transmission <- p$parameters['transmission']
d$dispersal <- p$parameters['dispersal']
d$nExtantDis <- sum(findDisDistr(p, 2) > 0)
d$singleInf <- findCoinfDistr(p, 2)[2]
d$doubleInf <- findCoinfDistr(p, 2)[3]
d$nColonies <- p$parameters['nColonies']
d$nPathogens <- p$parameters['nPathogens']
d$meanK <- sum(p$adjacency != 0 )/p$parameters['nColonies']
d$maxDistance <- p$parameters['maxDistance']
d$nEvents <- p$parameters['events']
# Time until extinction
invadePath <- colSums(p$sample[2, , (2 + invadeT / sample):(dim(p$sample)[3])]) +
colSums(p$sample[4, , (2 + invadeT / sample):(dim(p$sample)[3])])
d$extinctionTime <- cumsum(p$sampleWaiting)[min(which(invadePath == 0)) + (2 + invadeT / sample)]
d$totalTime <- sum(p$sampleWaiting)
d$survivalTime <- d$extinctionTime - cumsum(p$sampleWaiting)[(2 + invadeT / sample)]
d$pathInv <- sum(p$sample[c(1, 4), , dim(p$sample)[3]])
message(paste0("finished ", x, ". Invasion: ", invasion ))
rm(p)
return(d)
}
# Create and set seed (seed object is used to set seed in each seperate simulation.'
seed <- 787
set.seed(seed)
# Run sims.
z <- mclapply(1:600, . %>% fullSim, mc.preschedule = FALSE, mc.cores = nCores)
z <- do.call(rbind, z)
# Save summary data.
write.csv(z, file = 'data/Chapter2/extraMidBeta.csv')
%%end.rcode
% ------------------------------------------------------------------ %
% Topology Sims
% ------------------------------------------------------------------ %
%%begin.rcode TopoSimsFuncs
#################################
# Topology sim definitions #
#################################
# How many simulations to run?
nTopoSims <- 8 * each
# Define our simulation function.
fullSim <- function(x){
# Chose maxdistance so that we get either fully connected or circle networks.
mxDis <- rep(c(40, 200), each = nTopoSims/2 + 1)[x]
# Chose transmission rates.
tranVec <- rep(c(0.1, 0.2, 0.3, 0.4), nTopoSims/4 + 1)
tran <- tranVec[x]
# Set seed (this is set within each parallel simulation to prevent reusing random numbers).
simSeed <- paste0(seed, x)
set.seed(simSeed)
# Make the population.
p <- makePop(model = 'SIR', events = nEvent, nColonies = 10, nPathogens = 2, recovery = 1, sample = sample, dispersal = 0.01, birth = 0.05, death = 0.05, crossImmunity = 0.1, meanColonySize = 3000, infectDeath = 0, transmission = tran, maxDistance = mxDis, colonySpatialDistr = 'circle')
# Seed endemic pathogen.
for(i in 1:10){
p <- seedPathogen(p, 2, n = 200, diffCols = FALSE)
}
# Burn in simulation
p <- runSim(p, end = invadeT)
# Seed invading pathogen.
p$I[2, 1, (invadeT + 1) %% sample] <- 5
# Recalculate rates of each event after seeding.
p <- transRates(p, (invadeT + 1) %% sample)
# Continue simulation
p <- runSim(p, start = invadeT + 1, end = 'end')
# Was the invasion succesful?
invasion <- findDisDistr(p, 2)[1] > 0
# Save summary stats
d <- data.frame(transmission = NA)
d$transmission <- p$parameters['transmission']
d$dispersal <- p$parameters['dispersal']
d$nExtantDis <- sum(findDisDistr(p, 2) > 0)
d$singleInf <- findCoinfDistr(p, 2)[2]
d$doubleInf <- findCoinfDistr(p, 2)[3]
d$nColonies <- p$parameters['nColonies']
d$nPathogens <- p$parameters['nPathogens']
d$meanK <- sum(p$adjacency != 0 )/p$parameters['nColonies']
d$maxDistance <- p$parameters['maxDistance']
d$nEvents <- p$parameters['events']
message(paste0("finished ", x, ". Invasion: ", invasion ))
if(saveData){
file <- paste0('data/Chapter2/TopoSims/TopoSim_', formatC(x, width = 4, flag = '0'), '.RData')
save(p, file = file)
}
rm(p)
return(d)
}
%%end.rcode
%%begin.rcode runTopoSim, eval = runAllSims, cache = TRUE
# Create and set seed (seed object is used to set seed in each seperate simulation.'
seed <- 1230202
set.seed(seed)
# If we want to save the data, make a directory for it.
if(saveData){
dir.create('data/Chapter2/TopoSims/')
}
# Run sims.
z <- mclapply(1:nTopoSims, . %>% fullSim, mc.preschedule = FALSE, mc.cores = nCores)
z <- do.call(rbind, z)
# Save summary data.
write.csv(z, file = 'data/Chapter2/TopoSims.csv')
%%end.rcode
% ------------------------------------------------------------------ %
% Unstructured Sims
% ------------------------------------------------------------------ %
%%begin.rcode unstructuredSimsFuncs
#################################
# Topology sim definitions #
#################################
# How many simulations to run?
nUnstructuredSims <- 4 * each
# Define our simulation function.
fullSim <- function(x){
# Chose transmission rates.
tranVec <- rep(c(0.1, 0.2, 0.3, 0.4), nUnstructuredSims/4 + 1)
tran <- tranVec[x]
# Set seed (this is set within each parallel simulation to prevent reusing random numbers).
simSeed <- paste0(seed, x)
set.seed(simSeed)
# Make the population.
p <- makePop(model = 'SIR', events = nEvent, nColonies = 2, nPathogens = 2, recovery = 1, sample = sample, dispersal = 0.0, birth = 0.05, death = 0.05, crossImmunity = 0.1, meanColonySize = 29800, infectDeath = 0, transmission = tran, maxDistance = 120, colonySpatialDistr = 'circle')
# Seed endemic pathogen.
p$I[2, 2, 1] <- 200
p$I[1, 1, 1] <- 0
# Recalculate rates of each event after seeding.
p <- transRates(p, 1)
# Burn in simulation
p <- runSim(p, end = invadeT)
# Seed invading pathogen.
p$I[3, 2, (invadeT + 1) %% sample] <- 5
# Recalculate rates of each event after seeding.
p <- transRates(p, (invadeT + 1) %% sample)
# Continue simulation
p <- runSim(p, start = invadeT + 1, end = 'end')
# Was the invasion succesful?
invasion <- findDisDistr(p, 2)[1] > 0
# Save summary stats
d <- data.frame(transmission = NA)
d$transmission <- p$parameters['transmission']
d$dispersal <- p$parameters['dispersal']
d$nExtantDis <- sum(findDisDistr(p, 2) > 0)
d$singleInf <- findCoinfDistr(p, 2)[2]
d$doubleInf <- findCoinfDistr(p, 2)[3]
d$nColonies <- p$parameters['nColonies']
d$nPathogens <- p$parameters['nPathogens']
d$meanK <- sum(p$adjacency != 0 )/p$parameters['nColonies']
d$maxDistance <- p$parameters['maxDistance']
d$nEvents <- p$parameters['events']
message(paste0("finished ", x, ". Invasion: ", invasion ))
if(saveData){
file <- paste0('data/Chapter2/UnstructuredSims/UnstructuredSims_', formatC(x, width = 4, flag = '0'), '.RData')
save(p, file = file)
}
rm(p)
return(d)
}
%%end.rcode
%%begin.rcode runUnstructuredSim, eval = runAllSims, cache = TRUE
# Create and set seed (seed object is used to set seed in each seperate simulation.'
seed <- 13
set.seed(seed)
# If we want to save the data, make a directory for it.
if(saveData){
dir.create('data/Chapter2/UnstructuredSims/')
}
# Run sims.
z <- mclapply(1:nUnstructuredSims, . %>% fullSim, mc.preschedule = FALSE, mc.cores = nCores)
z <- do.call(rbind, z)
# Save summary data.
write.csv(z, file = 'data/Chapter2/unstructuredSims.csv')
%%end.rcode
%%begin.rcode noDispSimsFuncs
#################################
# Topology sim definitions #
#################################
# How many simulations to run?
nNoDispSims <- 4 * each
# Define our simulation function.
fullSim <- function(x){
# Chose transmission rates.
tranVec <- rep(c(0.1, 0.2, 0.3, 0.4), nNoDispSims/4 + 1)
tran <- tranVec[x]
# Set seed (this is set within each parallel simulation to prevent reusing random numbers).
simSeed <- paste0(seed, x)
set.seed(simSeed)
# Make the population.
p <- makePop(model = 'SIR', events = nEvent, nColonies = 2, nPathogens = 2, recovery = 1, sample = sample, dispersal = 0.0, birth = 0.05, death = 0.05, crossImmunity = 0.1, meanColonySize = 2800, infectDeath = 0, transmission = tran, maxDistance = 120, colonySpatialDistr = 'circle')
# Seed endemic pathogen.
p$I[2, 2, 1] <- 200
p$I[1, 1, 1] <- 0
# Recalculate rates of each event after seeding.
p <- transRates(p, 1)
# Burn in simulation
p <- runSim(p, end = invadeT)
# Seed invading pathogen.
p$I[3, 2, (invadeT + 1) %% sample] <- 5
# Recalculate rates of each event after seeding.
p <- transRates(p, (invadeT + 1) %% sample)
# Continue simulation
p <- runSim(p, start = invadeT + 1, end = 'end')
# Was the invasion succesful?
invasion <- findDisDistr(p, 2)[1] > 0
# Save summary stats
d <- data.frame(transmission = NA)
d$transmission <- p$parameters['transmission']
d$dispersal <- p$parameters['dispersal']
d$nExtantDis <- sum(findDisDistr(p, 2) > 0)
d$singleInf <- findCoinfDistr(p, 2)[2]
d$doubleInf <- findCoinfDistr(p, 2)[3]
d$nColonies <- p$parameters['nColonies']
d$nPathogens <- p$parameters['nPathogens']
d$meanK <- sum(p$adjacency != 0 )/p$parameters['nColonies']
d$maxDistance <- p$parameters['maxDistance']
d$nEvents <- p$parameters['events']
d$path2 <- sum(p$sample[c(2, 4), , dim(p$sample)[3]])
# Time until extinction
invadePath <- colSums(p$sample[2, , (2 + invadeT / sample):(dim(p$sample)[3])]) +
colSums(p$sample[4, , (2 + invadeT / sample):(dim(p$sample)[3])])
d$extinctionTime <- cumsum(p$sampleWaiting)[min(which(invadePath == 0)) + (2 + invadeT / sample)]
d$totalTime <- sum(p$sampleWaiting)
d$survivalTime <- d$extinctionTime - cumsum(p$sampleWaiting)[(2 + invadeT / sample)]
message(paste0("finished ", x, ". Invasion: ", invasion ))
rm(p)
return(d)
}
%%end.rcode
%%begin.rcode runNoDispSims, eval = runAllSims, cache = FALSE
# Create and set seed (seed object is used to set seed in each seperate simulation.'
seed <- 19
set.seed(seed)
# Run sims.
z <- mclapply(1:nNoDispSims, . %>% fullSim, mc.preschedule = FALSE, mc.cores = nCores)
z <- do.call(rbind, z)
# Save summary data.
write.csv(z, file = 'data/Chapter2/noDispSims.csv')
%%end.rcode
\subsection{Parameter selection}
\label{s:paramSelect}
The fixed parameters were chosen to roughly reflect realistic wild bat populations.
The death rate $\mu$ was set as 0.05 per year giving a generation time of 20 years.
The birth rate $\Lambda$ was set to be equal to $\mu$.
This yields a population that does not systematically increase or decrease.
However, the size of each colony changes as a random walk.
Given the length of the simulations, colonies were very unlikely to go extinct (Figure~\ref{fig:plotsNoInvade2}).
The starting size of each colony was set to \si{3000}.
This is appropriate for many bat species \cite{jones2009pantheria}, especially the large, frugivorous \emph{Pteropodidae} that have been particularly associated with recent zoonotic diseases.
The recovery rate $\gamma$ was set to one, giving an average infection duration of one year.
This is therefore a long lasting infection but not a chronic infection.
It is very difficult to directly estimate infection durations in wild populations but it seems that these infections might sometimes be long lasting \cite{peel2012henipavirus, plowright2015ecological}.
However, other studies have found much shorter infectious periods \cite{amengual2007temporal}.
These shorter infections are not studied further here. %todo consider readding this. " as preliminary simulations found that they could not persist in the relatively small populations being modelled here."
Four values of the transmission rate $\beta$ were used, 0.1, 0.2, 0.3 and 0.4.
These values were chosen to cover the range of behaviours, from very high probabilities of invasion of the second pathogen, to very low probabilities.
All simulations were run under all four transmission rates as this is such a fundamental parameter.