DOI: 10.5281/zenodo.17200384
title: Data and Code for Meta-analysis of Host Manipulation

description: Data

data_final.csv          

Effect sizes with information on each observation

parasite                         Parasite species or genus

host                               Host species

parasite_stage              Parasite developemental stage

host_origin                   Host origin

infection                       Infection procedure

behavior_details          Details on recorded behavior/ phenotype

predator_type              Type of predator present if any

behavior_type              detailed behavioral categoris

behavior_type1            broader behavioral categories used for analysis

effect_on_predation    Expected effect on predation; 1 indcates increased predation in infected individuals, -1 indicates decreased predation in infected individuals; compared to uninfected individuals

CN                                 Sample size, uninfected

IN                                  Sample size infected

Ntot                               total sample size

CMean                          average value for uninfected

Cerr                               error for uninfected

IMean                           average value for infected

Ierr                                error for infected

mean                             type of mean

error                              type of error

effect_size                    value of effect size

type_effect_size           effect size meassure used

values_remarks            remarks on values

paper_id                       unique paper identifier

ref_long                        reference

year                               publication year

remarks                         

stage_assumed             stage not entirely clear

study_excluded            1= yes; 0=no

exclusion_reason         categorized exclusion reson if study was excluded

exclusion_reason_details    detailed exclusion reason

predator_type1            broader categories for predator type used in the final analysis

data_host.csv          

host                               Host species

genus                            Host genus

family                            Host family

habitat_cat                   habitat category

habitat2                        additional information on habitat

host_group1                 host group based on phylogeny

length_cm                     host length in cm

mass                              host mass

life_span_mean            average host lifespan in years

TL                                  trophic level

data_para.csv                     

host                               Host species

parasite                         Parasite species or genus

genus                            parasite genus

family                            parasite family

parasite_group             parasite group

parathenic                    1= yes; 0=no

encysted                       1= yes; 0=no

site                                infection site

dev time (days)             developemental time

next host                       

length                            parasite length in mm

width                             parasite width in mm

remarks                         

data_host1.csv              

File produced by add_host_para_data.Rmd; same as data_host, but proportion of trophic interactions as predator added

data_out.csv                  

File produced by data_preparation.Rmd; combines data_final with host and parasite data and adds effect sizes and cleans up some factors

host_tree.RData & host_tree.tre

Host tree generated by phylogenetic_tree.Rmd in .RData format (as used by the scripts) and in Newick format for better compatibility

para_tree.RData & para_tree.tre

Parasite tree generated by phylogenetic_tree.Rmd in .RData format (as used by the scripts) and in Newick format for better compatibility

 

Workflow and files for data analysis

Data preparation     

add_host_para_data.Rmd    prepares host data by adding proportion of trophic interactions; takes data_host.csv and returns data_hos1.csv

data_preparation.Rmd         Calculates effect sizes and cleans up some factors and comones data on observations with host and parasite data; takes data_final, data_host1.csv and data_para.csv and returns data_out

phylogenetic_tree.Rmd        takes data_out and creates phylogenetic trees for hosts and parasites used in thsi analysis; returns host_tree.Rdata and para_tree.RData

Data analysis

All subsequent files take data_out and  host_tree.Rdata and para_tree.Rdata as input

run_auto_all.Rmd     runs the entire analysis for the full data set with all parasite stages

run_auto_mat2.Rmd runs the entire analysis for the a data set with only mature parasites

run_auto_imat2.Rmd            runs the entire analysis for the a data set with only immature parasites

run_auto_predation_susceptibility2.Rmd  runs the entire analysis for data that directly meassures predation susceptibility only

run_auto_no_outl5_all.Rmd runs the entire analysis after the removel of outliers for the full data set with all parasite stages

run_auto_no_outl5_mat2.Rmd       runs the entire analysis after the removel of outliers for the a data set with only mature parasites

run_auto_no_outl5_imat2.Rmd      runs the entire analysis after the removel of outliers for the a data set with only immature parasites

 

Custom scripts and functions        

preparation and functions contain costum code and function required by the scripts mentioned above to prepare the data and run the entire analysis. These scripts expect them to be located in folders called “preparations” and “functions” respectively.

preparations: 

data.R final data preparations and checks prior to analysis

libraries.R       loads necessary libraries

plots.R             sets a theme for all plots in ggplot2

tables1.R        prepares formating for tables if they are written directly to word

functions:       

calc_I2_brms.R          Calculate heterogenetiy (I2) following brms models

check_brms_model_v2.R            runs some diagnostics on brms models

compare_brms_models1_v2.R   compares two brms models using loo_compare

diagnose.R     produces diagnostic plots fro brms models

funnel_plot.R, funnel3.R       produce a funnel plot

get_emmean.R, get_emmean_cor2.R, get_emmean_cor2_extra1.R       obtain estimated marginal means using emmeans

get_loos.R      calculate loo and svae within brms model for later use

get_outls.R     obtain outliers

overall_comparison_to_table.R       create a nice looking table from different compairons between brms models

plot_forest.R  creates a simple forest plot

plot_inter_behave_pred.R   creates a forest plot for the interaction between behavior and predator

plot_single_effect_combi2.R            plot the effect of differenc factors within a model and combine

plot_single_effect1.R plots the effect of a single effect in the model

radnefs1.R      obtain estimates for random effects

redo_fact_plot4.R     Creates final plots for factors in brms model

run_brms_model1_v2.R run the actual brms model

run_complete_v2.R         Combines the entire analysis; i.e. running brms models, comparing them to a less complicated model, obtaining estimated marginal means and basic plots for models of interest