We first inferred the evolutionary history of 287 RABV sequences (3080 nt; encompassing the whole N, P and intergenic G-L region) sampled from Algeria, Morocco, Tunisia and the Spanish territories from North Africa (Ceuta and Melilla) between 1986 and 2008. All these viruses are assigned to the Africa 1 genotype (relevant epidemiological information for all RABV isolates analysed in this study is presented in Table S1 in Supporting Information S1
). We estimated the timescale of this evolutionary history using a Bayesian Markov chain Monte Carlo (MCMC) approach 
. The most recent common ancestor of all the North African RABV sampled here was estimated to have existed between 1878–1945, supporting previous suggestions that dog RABV was periodically responsible for local sporadic epidemics in the middle of the 19th century 
, and that rabies became enzootic in this entire region during the 20th century. More generally, this timescale is consistent with the expanding European colonial influence in North Africa 
. This analysis also revealed distinct phylogenetic lineages in Algeria, Morocco and Tunisia, indicating that viruses generally grouped according to their country of origin (). This result is unexpected if the virus is only dispersed through the local movement of animals as observed in wildlife rabies 
as these would not respect geo-political boundaries. Indeed, we found only a few exceptions to the country-specific clustering, such as two Algerian sequences within the Moroccan clade and four Moroccan sequences in the Algerian clade. The Africa 1 clade is therefore consistent with the general phylogeographic pattern observed for dog RABV at reasonably large geographic scales; a series of spatially distinct clusters that experience relatively little contact among them 
MCC tree of 287 sequences of the Africa 1 clade, estimated from the N, P and G-L genes and intergenic regions of dog RABV, and showing the spatial structure of the viral lineages.
To analyze intra-country patterns of viral transmission in more detail, we considered a stochastic diffusion process among the 20 (Algeria) and 28 (Morocco) sampling localities for which most data were available ( and Figure S1 in Supporting Information S1
). We quantified the degree of spatial admixture using a modified Association Index (AI, 
), and by summarizing the number of inferred transitions to each location within Algeria and Morocco () based on an analysis in which rates of diffusion between each pair of locations were estimated. Although these analyses reveal that there is still significant spatial structure within each country (p<0.001), the AIs are considerably higher (0.67 [0.62–0.73] and 0.55 [0.51–0.63] for Algeria and Morocco, respectively) than those found for rabies at a larger spatial scale (e.g., 0.087 [0.043–0.132] for the Africa 2 lineage in Central and West Africa) 
, indicating weaker spatial structure at the within-country level. The summaries of transitions to each location generally identify multiple independent introductions of viruses in each location from which several samples were obtained (). Overall, the number of independent transitions to densely sampled locations is lower in Morocco than Algeria, in agreement with the lower AI for Morocco. Taken together with the strong spatial structure across countries, these results suggest that a relatively fluid RABV diffusion process within countries is restricted by geopolitical boundaries at larger scales.
Road network, accessibility and sampling locations of RABV samples.
Transition summaries to each location in Algeria and Morocco.
To identify the factors that may explain RABV spread, we incorporated several potential predictors as relative diffusion rates among each pair of locations, and tested these against equal rates of diffusion. Specifically, we considered geographical distances (great-circle distances), human population size, road distances and spatial accessibility measures. Road distances were derived from transport network data () and demonstrated a strong correlation with great-circle distances (r
0.96). More detailed landscape features, which may imply multiple, direct and indirect pathways connecting the different localities sampled in this study, were represented by accessibility data. These data reflect the travel time to the nearest major city using road/track-based travel 
and were less correlated with geographical distances (r
0.61). We employed circuit theory to translate the accessibility landscape into an origin-destination distance matrix (the so-called ‘isolation by resistance model’) 
. We also tested a simple gravity model of viral spread that, in the absence of real dog population sizes for the locations involved, was based on human population sizes for the discrete as a proxy. Finally, we also used population sizes in a landscape approach, similar to accessibility measures, to construct a population surface matrix 
Marginal likelihood estimates of the model fit of these different predictors suggested that RABV spatial dynamics are best described by road distances (). This was consistent across both countries and again supports human-assisted dispersal of rabies-infected dogs. As expected by their high correlation, geographical distances provided only a marginally lower fit compared to road distances. Only the population surface provided inconsistent results between both countries; whereas this model competes with road distances in Algeria, the population surface did not provide a good fit to the Moroccan data (Figure S2 in Supporting Information S1
). Although accessibility did not seem to explain RABV diffusion as well, we note that all samples were obtained from relatively accessible parts of Morocco and Algeria.
Marginal (log) likelihood estimates for the fit of different phylogeographic diffusion predictors in Algeria and Morocco.
To quantify and compare the dissemination process with previous results, we estimated the rate of RABV gene flow among the sampled isolates using ‘Markov jump’ counts 
of location state transitions and their reward-associated distances between locations across each branch. The posterior average rate of viral gene flow among localities estimated for Algeria was 26 km/yr (95% highest probability density interval: 18–34) and 33 (23–43) km/yr based on great circle distances and road distances, respectively. Somewhat higher viral gene flow rate estimates were obtained for Morocco with 42 (26–58) km/yr and 51 (34–72) km/yr for great circle distances and road distances, respectively. We note that the rates of viral gene flow estimated here are highly dependent of the scale of sampling such that comparison may only prove useful at the same geographic scale. However, these estimates were 2.7 to 4.4 times higher than those recorded in established enzootic situations in wildlife animals 
, again suggestive of human-mediated transmission. Although it is theoretically possible that these relatively high rates reflect epidemic waves periodically moving through this geographical region 
, particularly since similar rates have been observed in wild carnivores during epidemic spread 
, such waves were not observed in the geographical areas studied here and where the virus appears to be largely enzootic.
The occasional mixing of sequences from different locations at the tips of the inferred tree () is suggestive of long distance spread in relatively little time (6 months to one year). To quantify such rapid and long distance spread, we summarized the posterior distribution of distances covered along individual branches (). We focused on branches along which inferred location state changes occurred in a time period of less than 1 year, and between 1 and 2 years. As a control, we analysed the branches without inferred state changes; as expected these all had negligible Markov jump count distances (not shown). Across the posterior distribution of trees, we observed between 5 and 13 branches per tree that have a time length less than 2 years and cover a distance of more than 200 km, and 12 to 13 branches that cover a distance of about 100 km (). Importantly, our ability to clearly detect long-distance movement is limited to branches representing short evolutionary times; longer branches could also harbour such events, providing an explanation for the relatively high average rates of viral gene flow.
Short-time virus gene flow events in Algeria and Morocco.
The rates of viral gene flow we estimate among the sampled isolates from Algeria and Morocco contrast with those of spatial RABV movement in an African dog population that should experience very limited human-mediated dissemination of rabid dogs 
. In this case, the spatial dispersal of single RABV infections was estimated to be predominantly less than 2 km (and always smaller than 20 km). Considering that the average incubation period of RABV is between 22 to 29 days 
, it is clear that such long distances as those recorded in our study could only be achieved with at least some human intervention. To investigate more formally how the RABV distribution we observe in Algeria and Morocco contrasts with the patterns of spread we would expect from transmission dynamics in African dogs alone (i.e. without human intervention), we simulated a phylogeodynamic process based on epidemiological parameters obtained from detailed analyses of rabies transmission biology 
. In particular, we considered epidemiologically informed virus movement over all evolutionary histories in the posterior distribution resulting from our phylodynamic inference (see Supplementary Information). In our spatial simulation we analyze cases in which (i) each new infection takes a random direction in continuous space, or (ii) subsequent infections consistently take the same direction (). Although the latter may not be very realistic, it should resemble virus movement along roads. For both Algeria and Morocco, spatial diffusion is initiated at the centre of the sampling locations, such that the process has the largest probability to cover these locations a priori
. When assuming up to one year of movement these simulations clearly show that RABV could not have spread to the same extent as shown by the current sampling in Algeria and Morocco if the virus was simply being transmitted by dog dispersal alone. Even if we enforce a year of successive RABV transmissions in the same direction, which is highly implausible given the observed dynamics of dog RABV in a local setting 
, the simulations still do not attain the observed spatial RABV spread. In addition, the distances realized by dispersal in random directions along branches less than 2 years were all less than 60 km, which is far more restricted than estimated for the real data ().
Spatial simulation based on the inferred evolutionary histories and epidemiological parameters of rabies spread in Algeria (A) and Morocco (B).
Rabies is a prime example of an infectious disease in which dispersal can be exacerbated by animal movement mediated by humans. This is illustrated by raccoon rabies in Virginia, USA 
, dog rabies in Indonesia in Flores Island 
, in Bali (F.X. Meslin, Personal communication) and in parts of Europe 
. Each epidemic resulted in enormous expenditure on rabies post exposure prophylaxis in humans and animal vaccination programs 
. Importantly, our study allows us to quantify rates of viral gene flow among sampled dog isolates (between 18 and 72 km/yr) in a mixed geographic and socio-economic landscape, such as those characterized by Algeria and Morocco where there is currently little dog vaccination. In addition, our analysis suggests that the human-mediated dispersal of infected dogs is likely to continue to play a major role in the transmission of RABV in geographical areas where it has been present for many years. Indeed, our observations of administrative borders that restrict a relatively fluid pattern of spread, the occasional long-distance movement of viruses to particular countries, and the fit between spatial dynamics and road distances, all point to the displacement of rabies-infected dogs by humans.
Understanding the frequency and distance of movements of potentially infected animals is of paramount importance in predicting the spread of viral infections 
. In addition, such information has important implications for disease control; understanding the conditions under which the containment of wildlife 
and dog rabies can reliably be achieved will assist in the long term goal of eliminating animal RABV. In particular, that humans mediate the transmission of RABV among dogs in North Africa requires that intervention procedures are implemented more rapidly than in situations in which humans play little or no role in viral transmission. The high cost associated with surveillance underscores the importance of sampling design and the development of cost-effective monitoring and testing approaches 
. In addition, this study illustrates the power of phylogeographic approaches 
to identify the factors responsible for the spread of major animal and zoonotic pathogens. By integrating spatial dynamics with temporal inferences, the Bayesian analysis utilized here constitutes a powerful new tool that may complement traditional epidemiological methods in studying the effects of human behaviour on the evolution of zoonotic viruses.