Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Map of the Uganda road network, created using the R programming language

We want to evaluate the seriousness of the threat posed by the recent ebola outbreak in western Uganda. The outbreak appeared in Kigadi, a small village in the Kibaale district. The disease was first confirmed by the government on 28 July. By 11 Aug, Medecins Sans Frontieres epidemiologist Dr Paul Roddy said the disease was under control, with no new deaths in August. It will be classified as contained if there are no confirmed cases by middle September. In total, 19 people died from the disease in the outbreak.

The disease spreads between people by contact with contaminated body fluids. Transmission, then, is slow (in comparison to disease with aerosol transmission, i.e. influenza). We reasoned that if the disease was to spread to other communities, the most likely route would be along roadways.

We obtained a shapefile describing the Uganda road network from Humanitarian Response. We plot it as follows:

### use the maptools library
require(maptools)

## plot it
plot(ugnat,lwd=3)
plot(ugroads[ugroads$RDLNTYPETX==”Unpaved Trails/Footpaths”,],add=TRUE,lwd=1,col=’lightgray’) plot(ugroads[ugroads$RDLNTYPETX==”Tracks trails or footpaths”,],add=TRUE,lwd=1,col=’lightgray’)
plot(ugroads[ugroads$RDLNTYPETX==”Secondary road”,],add=TRUE,lwd=2,col=’burlywood3′) plot(ugroads[ugroads$RDLNTYPETX==”Primary and secondary roads”,],add=TRUE,lwd=3,col=’burlywood3′)
plot(ugroads[is.na(ugroads$RDLNTYPETX),],add=TRUE,lwd=2,col=’burlywood3′) plot(ugroads[ugroads$RDLNTYPETX==”Connector”,],add=TRUE,lwd=2,col=’burlywood3′)
dev.off()

Converting it to a graph requires matching endpoints of the roads. Simple enough, except that the road coordinates are buried three classes deep in the data structure. We write two utility functions:

return([email protected][indx][[1]]@Lines[[1]]@coords[1,])}

gttail <- function(indx){
return(tail([email protected][indx][[1]]@Lines[[1]]@coords,n=1))}

mkhash <- function(coord){
return(paste(coord[1],coord[2],sep=’_’))}

Then, to make the graph

}

gr <- graph.edgelist(edges,directed=FALSE)

where the hash function pastes together the x and y coordinates of an endpoint. The resulting graph has 2011 nodes and 1992 edges. The maximum degree node has degree 7 (if one allows a maximum of one edge between any two nodes). Almost half of the nodes have degree one — they are terminal. Analysis of the graph shows that none of the nodes have strong spreading power, whether measured by expected reach, path counting, degree, or k-shell.

The model has obvious limitations. Nodes are road junctures, not population centers. No allowance is made for road length or size. our conclusion should be taken with a grain of salt.

Conclusion: The disease is a local tragedy, but is unlikely to become a national one.