Code from: Costs of parasite generalism revealed by abundance patterns across mammalian hosts
Data files
Sep 24, 2025 version files 83.47 MB
-
abundOverHostSet.Rmd
6.68 KB
-
abundPhylo.Rmd
6.60 KB
-
bestHost.Rmd
8.58 KB
-
bodyMassSim.Rmd
1.36 KB
-
compCorr.Rmd
3.36 KB
-
dataPrep.Rmd
13.02 KB
-
dietSim.Rmd
944 B
-
EltonTraits.csv
42 KB
-
fitnessDecay.Rmd
2.02 KB
-
g1.Rmd
6.65 KB
-
geogOverlap.Rmd
2.24 KB
-
get_bestHost.Rda
6.57 KB
-
get_delBM.Rda
5.65 KB
-
get_delBMLog.Rda
8.17 KB
-
get_dietSim.Rda
48.14 KB
-
get_nEcos.Rda
1.50 KB
-
get_nri.Rda
5.81 KB
-
get_Olaps.Rda
48.15 KB
-
get_pdw.Rda
55.67 KB
-
get_pdwBestWorstPi.Rda
9.33 KB
-
get_taxTree.Rda
2.71 KB
-
get_txInfo.Rda
3.36 KB
-
GMPD_main.csv
6.71 MB
-
makeTaxTreePara.Rmd
10.34 KB
-
PanTHERIA_1-0_WR05_Aug2008.txt
2.36 MB
-
phylogenetic_abundPhylo.Rmd
5.91 KB
-
phylogenetic_bestHost.Rmd
10.80 KB
-
phylogenetic_fitnessDecay.Rmd
1.64 KB
-
phylogenetic_predGlobAbund.Rmd
4.53 KB
-
phyloRetained
783 B
-
phyloRetained2.csv
1.48 KB
-
predGlobAbund.Rmd
4.54 KB
-
README.md
5.05 KB
-
ultrametric.newick
3.42 KB
-
WR_2005_ST.txt
403.15 KB
-
wwf_terr_ecos.dbf
8.02 MB
-
wwf_terr_ecos.htm
31.91 KB
-
wwf_terr_ecos.lyr
38.91 KB
-
wwf_terr_ecos.prj
145 B
-
wwf_terr_ecos.sbn
138.51 KB
-
wwf_terr_ecos.sbx
6.56 KB
-
wwf_terr_ecos.shp
65.28 MB
-
wwf_terr_ecos.shp.xml
23.98 KB
-
wwf_terr_ecos.shx
115.76 KB
Abstract
Most parasites are able to infect several host species, yet generalism is anticipated to be a costly strategy. Parasite abundance provides an important indicator of fitness because it is promoted by longevity and fecundity, which are correlated with a parasite’s basic reproductive number. Using a global database of parasitic helminths of terrestrial mammals, we show that the abundance of parasitic helminths is phylogenetically structured across helminth species. High parasite abundance can be achieved through three separate components: infecting abundant host species, having a high infection success (prevalence), or achieving high parasite abundance within host individuals (infection intensity). Both phylogenetically specialist and generalist strategies can reach high abundances, but through different strategies. Specialist parasites achieve higher abundance than generalists on their principal host species but rely on host relatedness to infect multiple species. For generalist parasites, geographic overlap with, and diet similarity to principal host species are better predictors of parasite abundance. This study characterizes constraints on parasite host range and provides novel context to evaluate the potential for parasites to establish in new host species.
https://doi.org/10.5061/dryad.18931zd5j
These code and data files reproduce analyses in the above-named manuscript. Code files are enumerated and named below. In this README, each code file additionally contains a bullet point list of what it does. Each bullet point begins with a key verb (Reads, Sources, Loads, Saves, Creates). With the exception of "Creates", these verbs refer to typical R functions ("load", "read_csv", etc.). "Creates" typically refers to the creation of a figure or statistic(s), but occasionally to a data product used on the fly or for inspection. Further details can be obtained from annotated code chunks within the files. Some code chunks can take a long time to run. In these cases, we supply an alternate code chunk (immediately following) that loads the data product as an R data file (.Rda). All required Rda files are included.
1. dataPrep
- reads in GMPD ("gmpd_main.csv")
- reads in PanTHERIA ("PanTHERIA_1-0_WR05_Aug2008.txt")
- reads in mammal phylogeny ("WR_2005_ST.txt")
- GMPD metadata available here: https://esajournals.onlinelibrary.wiley.com/doi/full/10.1002/ecy.1799
- PanTHERIA metadata available here: https://esajournals.onlinelibrary.wiley.com/doi/10.1890/08-1494.1
- Mammal phylogeny available here: https://doi.org/10.1038/nature05634
- creates check that no HP combos refer to intermediate (ungulate) hosts
- creates theta
- creates nri (i.e. "get_nri.Rda", which is loaded in other files)
2. g1
- sources dataPrep
- creates figS1
3. compCorr
- sources dataPrep
- creates figS2 [correlations of abund/components]
4. makeTaxTreePara
- sources dataPrep
- saves get_txInfo
- saves get_taxTree
5. abundPhylo
- sources dataPrep
- creates abund
- loads get_txInfo
- creates abouheif.moran test
- reads "PhyloRetained2.csv", a hand-typed text file that designates which parasite species from the taxonomic analysis are retained in the phylogenetic analysis (used to annotate fig1)
- creates fig1
6. predGlobAbund
- reads "GMPD_main.csv" (see 1. for metadata)
- reads ecoregions (described in, and available via, https://doi.org/10.1641/0006-3568(2001)051[0933:TEOTWA]2.0.CO;2) via file "wwf_terr_ecos.shp" (note these standard ESRI shapefiles require supporting files with same name and extensions dbf, htm, lyr, prj, sbn, sbx, shp.xml, shx
- sources dataPrep
- saves get_nEcos
- creates abund [also done in abundPhylo]
- loads get_txInfo
- creates fig2
- creates pgls stat test [globAbun~nEco+nHost+z]
7. bestHost
- sources dataPrep
- creates best
- saves get_bestHost
- loads get_taxTree
- creates fig3
- creates figS3
- creates pgls stat tests [best~z]
8. fitnessDecay
- sources dataPrep
- loads get_txInfo
- creates figS4
- creates pgls stat test [evenness~z]
9. dietSim
- sources dataPrep
- reads EltonTraits (metadata available at: https://esajournals.onlinelibrary.wiley.com/doi/10.1890/13-1917.1) via "EltonTraits.csv"
- saves get_dietSim
10. geogOverlap
- sources dataPrep
- reads IUCN layers (metadata available at: https://www.iucnredlist.org/resources/spatial-data-download)
- creates areaOverlap for species pairs
- saves get_Olaps
- loads get_Olaps
11. bodyMassSim
- sources dataPrep
- reads Pantheria (see 1. for metadata)
- saves get_delBM
- saves get_delBMLog
12. abundOverHostSet
- sources dataPrep
- reads in mammal phylogeny (see 1. for details)
- loads get_dietSim
- loads get_Olaps
- loads get_delBM
- loads get_delBMLog
- creates pdw (i.e. saves as "get_pdw.Rda")
- creates pdw.best.worst.pi (i.e. saves as "get_pdwBestWorstPi.Rda")
- creates fig4
- creates lm stat tests [delZpi~pd|olap|diet|bm]
13. phylogenetic_abundPhylo
- sources dataPrep
- reads phyloRetained (list of parasite species typed manually that are retained from taxonomic analysis in the phylogenetic analysis)
- reads ultrametric.newick (Regular Newick file format of parasite phylogenetic tree explained in supplementary material)
14. phylogenetic_predGlobAbundance
- sources dataPrep
- reads wwf_terr_ecos.shp
- reads ultrametric.newick (Regular Newick file format of parasite phylogenetic tree explained in supplementary material)
- creates fig S6
15. phylogenetic_bestHost
- sources dataPrep
- reads ultrametric.newick (Regular Newick file format of parasite phylogenetic tree explained in supplementary material)
- creates figs S7 & S8
16. phylogenetic_fitnessDecay
- sources dataPrep
- reads ultrametric.newick (Regular Newick file format of parasite phylogenetic tree explained in supplementary material)
- creates fig S9
The underlying data is the Global Mammal Parasite Database, specifically v 2.0: http://dx.doi.org/10.1002/ecy.1799
It has been processed using a series of scripts in R (actually Rmd) which are archived in this repository
