Joining the dots: An automated method for constructing food webs from compendia of published interactions

Food webs are important tools for understanding how complex natural communities are structured and how they respond to environmental change. However their full potential has yet to be realised because of the huge amount of resources required to construct them de novo . Consequently, the current catalogue of networks that are suitable for rigorous and comparative analyses and theoretical development still suffers from a lack of standardisation and replication. Here, we present a novel R function, WebBuilder , which automates the construction of food webs from taxonomic lists


Introduction
Characterising food webs (networks representing trophic interactions between species) and other ecological networks (networks which represent any type of ecological interaction, such as pollination) can help us understand and, ultimately predict multispecies systems' responses to changes in environmental conditions (Thompson et al., 2012;Tylianakis et al., 2010). Food webs can reveal subtle but important changes in the biotic interactions that underpin ecosystem functioning, stability, and resilience to perturbationshigher-level phenomena that cannot be inferred from studying the nodes (i.e., species or populations) alone (Gray et al., 2014;Thompson et al., 2012).
Despite the many advantages of a network-based approach to ecology, significant challenges need to be overcome, particularly in terms of gathering interaction data. Interactions occur between individuals and data are often collected at this level: for example, via collection, rearing and identification of every leaf miner, and subsequent leaf miner parasitoid along a transect to build herbivore-parasitoid networks (Macfadyen et al., 2011;as in Memmott et al., 2000), or through dissecting and identifying consumer gut-contents via microscopy (as in Layer et al., 2013). Such laborious methods require substantial investment of time and resources, and it can take many thousands of lab hours to characterise just one food web, which even then may still be undersampled for links between its rarer members (see Table 1; e.g. Woodward et al., 2005;Olito and Fox, 2014). Many hundreds or thousands of individuals of each species are often needed to fully characterise the full set of feeding links within a food web (e.g. Ings et al., 2009), which is rarely practical given the financial and time restraints of research funding. In addition, such comprehensive sampling is often destructive and can impose undesirable disturbance on study systems. Consequently, empirical food webs are often incompletely described and constructed from relatively small sample sizes (e.g. Kaiser-Bunbury et al., 2010;Layer et al., 2013). This limits the conclusions that can be drawn and the number of comparable food webs that are available both across and within studies (Bascompte et al., 2003;e.g. Briand, 1983;Olesen et al., 2007) although exceptions to this exist (Bascompte et al., 2003;Cohen and Mulder, 2014). Most studies still have patchy and differing levels of sampling effort and taxonomic resolution, making meta-analyses difficult or even inappropriate: the ability to construct large numbers of realistic, comparable food webs across multiple systems would, therefore, help realise the true potential of network approaches (Gray et al., 2014).
Ecological networks are often constructed by incorporating species interactions from the published literature (Table 1) and many food webs are constructed entirely in this manner (e.g. Cohen and Mulder, 2014;Goldwasser et al., 1993;Havens, 1993;Strong and Leroux, 2014), while other food webs contain a blend of observational and extrapolated data Pocock et al., 2012b). By filling in 'missing' trophic interactions to a given species list, the implicit assumption is made that, if a given pair of species have been observed to interact at one site, they will interact in the same way at other sites where they co-occur (at least in terms of a feeding link between the species being realised, or not). Food webs built through this method are often referred to as 'summary' or 'cumulative' food webs as they represent all potential interactions (of a particular type, for instance trophic interactions within a food web) between species of a particular community, rather than a snapshot in time. As such, food webs built through this method are unsuitable for detecting changes in species feeding behaviour across sites or over time, but are highly effective for detecting broad macro-ecological trends such as changes in food web structure across environmental gradients (e.g. Layer et al., 2010a,b;Mulder and Elser, 2009;Piechnik et al., 2008).
This approach can be taken further, by assigning interactions of species on the basis of taxonomic similarity: i.e., species within the same genus are assumed to have identical links if a link has been established through direct observation for at least one congener (e.g. Goldwasser et al., 1993;Layer et al., 2010a,b). This process is often used when constructing summary food webs for species the interactions of which have not been fully characterised (e.g., as revealed from yield-effort curves) to minimise potential biases arising from under-sampling, i.e. including only observed links would otherwise significantly underestimate food web complexity, especially among the rarer and/or more obscure taxa (Woodward et al., 2010). Recent work (Eklof et al., 2012) has provided justification for this approach, by highlighting the strong influence that taxonomy has in determining the structure of food webs. Thus, given the prevalence of undersampling in even relatively well-described food webs, dietary data extrapolated from the literature and generalised taxonomically can potentially produce far more complete and realistic summary food webs than those that rely solely on observations made in a particular locale.
Despite the prevalence of these methods for constructing summary food webs in the literature (e.g. Cohen and Mulder, 2014;Goldwasser et al., 1993;Havens, 1993;Layer et al., 2010a,b;Pocock et al., 2012b;Strong and Leroux, 2014), there is still no standard method for inferring feeding interactions, resulting in inconsistencies among studies, even within the same ecosystem type. This is especially problematic because authors rarely state explicitly which links have been observed or extrapolated, or the source from which they have been drawn, or how closely the previously published interactions match those reported in their particular study, making replication impossible and preventing other researchers from scrutinising published interactions fully (but see Strong and Leroux, 2014).
Recent research has sought to develop predictive models of the structure of ecological networks (e.g. Eklof et al., 2012;Gravel et al., 2013;Olito and Fox, 2014;Rohr et al., 2010). Simple rules based on ecological theory have been used to model and predict the structure and topology of food webs, the most successful of which include deterministic models based on information on species' body sizes, for example the 'Difference', 'Ratio', and 'Difference/Ratio' models (Allesina, 2011) and the Allometric Diet Breadth Model (ADBM; Petchey et al., 2008) which incorporates allometric scaling and optimal foraging parameters. Whilst these models have been developed primarily to advance ecological theory, they provide a possible tool through which food webs could be built de novo in order to address questions about network structure across environmental gradients or scales. However, to achieve their best performance (proportion of correctly predicted links) these models require some prior knowledge about the number of links in the network. For instance, for the models mentioned above a researcher is required to go through a parameter optimisation procedure, by fixing the number of links, values of constants and exponents can be derived, by maximizing the number of links correctly predicted. When constructing a network for the first time for a particular system, a research would be required to fix the number of links to an expected value which would bias the network structure towards that which the researcher expected to find.
Additionally, recent work (Olito and Fox, 2014) has highlighted that while predictive models might perform well at predicting metrics of network structure, they tend to perform poorly at predicting pairwise interactions (e.g. Sáyago et al., 2013;Vázquez et al., 2009;Verdú and Valiente-Banuet, 2011;Vizentin-Bugoni et al., 2014), so whilst they may predict network structural metrics well, they are doing so for the wrong reason as the underlying biological mechanisms have not been Reliant on the quality of the data contained within the reference dataset. Can only be used to construct 'cumulative' or 'summary' food webs, i.e. temporal or spatial changes in feeding behaviour cannot be incorporated.
Hall and Raffaelli (1991) Goldwasser et al. (1993) Havens ( Olito and Fox (2014) fully incorporated into the predictive models . To the best of our knowledge, the models used here have not, up until now, been used to predict network structure de novo, as this is not the scenario for which they were developed. Given the limitations of constructing food webs from observation of interactions or predictive models, we need an automated, repeatable and reliable method of building local food webs that can be applied across studies and, ultimately, different ecosystem and network types. Here, we introduce a method, the WebBuilder function that assembles food webs by systematically assigning links for taxa based upon a given set of userdefined rules applied to a dataset of known trophic interactions. We provide an implementation of our method for the R statistical modelling language (R Core Team, 2013), building upon the methods and data structures provided by the Cheddar R package (Hudson et al., 2013). We tested the method on four highly resolved freshwater food webs which have had their interactions characterised through gut contents analysis, as these represent some of the most complete food webs described to date, as a test case for our proof-of-concept. Specifically, our key aims were to: 1. collate a dataset of trophic interactions in a standard format to act as an example system in which to test this method; 2. automate the process of constructing food webs from this reference dataset in a repeatable and reliable manner; 3. compare the performance of this method with the structure of food webs with 'known' interactions, i.e. those which have been built through observation of the interactions; and 4. compare the performance of this method with another way of predicting food web structure; the ADBM, Difference, Ratio and Difference/Ratio models.

Dataset of trophic interactions
We collated a dataset of 20,823 pairwise trophic interactions among species (or the next highest level of resolution available, usually genus), from 51 different data sources, most of which were primary literature (Table A.1, Appendix A). It contains trophic interactions between primarily UK freshwater species, including 203 producer taxa, 593 invertebrate taxa, 24 fish taxa, 10,348 producer-animal links, 9531 animal-animal links and 944 detritus-animal links. When the necessary data were not available in the original publications, we contacted the authors directly, where possible, to obtain the raw data. The taxonomy of every resource and consumer has been standardised through the Global Names Resolver (http://resolver.globalnames.biodinfo.org/) using the Global Biodiversity Information Facility dataset. For every resource-consumer link the taxonomy (species, genus, subfamily, family, order, class) of both is given, along with life-stage information, if relevant, and a literature reference for the source of the link. This dataset builds upon the collection assembled by Brose et al. (2005), and to the best of our knowledge, represents the largest standardised collection of trophic links for freshwater organisms. This dataset is available to download at https://sites.google.com/site/foodwebsdatabase/ (doi:10.5281/zenodo.13751) and is designed to be easily updated by the iterative addition of new data (details of how to submit new data to the dataset are given on the website), allowing its content to improve over time, in an analogous manner to molecular-based bioinformatics datasets. New data will be subjected to a quality assurance procedure prior to inclusion in the dataset. Specifically, all taxa will be parsed through Global Names Resolver (http://resolver.globalnames.biodinfo. org/) using the Global Biodiversity Information Facility dataset. Additionally the data will be eyeballed for irregularities. It is anticipated that this data will exists as an open access resource, and as such the community of researchers who access it will report any errors they find so they can be double checked and removed. New iterations of the dataset can be produced, hosted on the webpage alongside the original, and assigned a new DOI, allowing researchers to cite exactly which version of the dataset they have used for their research, allowing analyses to be repeated using identical versions to those cited in a given study, if required in the future.

The WebBuilder function
The method of constructing ecological networks by extrapolating from previously published interactions is implemented in a new R function -WebBuilder (see Appendix B for code). The user is required to provide the following; firstly a list of taxa (i.e. nodes) in the community of interest (step I, Fig. 1), this data can be gathered from multiple sources and could be in the form of survey or biomonitoring data. Secondly, for each node, the minimum level of taxonomic generalisation (explained below; step II), and the taxonomic classification of each node (step III). Lastly a registrya dataset of known trophic interactions, including taxonomic classification (step IV), as example of which is published here, but which can also be created by the user or obtained elsewhere. It is recommended that the user resolve the taxonomy of their taxa list and registry using the same procedure so as to ensure that taxa are matched correctly, if the user were using the registry provided here they would need to parse their taxa list through Global Names Resolver (http://resolver. globalnames.biodinfo.org/) using the Global Biodiversity Information Facility dataset. The function searches the registry for every possible combination of resource-consumer interactions (for N taxa there are N 2 possible trophic interactions) which match the provided taxa list given the specified level of taxonomic generalisation.
The minimum level of taxonomic generalisation determines the taxonomic rank at which matches are made, thus generalising the resources or consumers of the candidate node to the species, genus, subfamily, family, order etc. level, as specified in the input (step II, Fig.  1). For instance, a researcher might decide to ascribe the level of taxonomic generalisation of 'genus' to the mayfly Baetis fuscatus, allowing it to be matched with the more commonly studied species Baetis rhodani in the dataset, and take on the appropriate feeding interactions of that species, i.e. those which include taxa also present on the provided taxa list (see the first Scenario in Fig. 2). This level of taxonomic generalisation is selected based on knowledge of a candidate node's trophic interactions in relation to its sister taxa (i.e. if all members of the same taxonomic unit can be assumed to have the same trophic interactions or not), and this can be tailored depending on the resource/ consumer status of the node. For example, consumers of the larvae of the non-biting midge subfamily Tanypodinae tend to be trophic generalists and would likely consume other larvae of the family Chironomidae, while it is not likely that the resources of Tanypodinae larvae (which are predominantly predatory) would be shared by all Chironomidae larvae (many of which are grazers or filter feeders). Hence it would not be appropriate to assign the trophic generalisation level 'family' to both resource and consumer interactions of Chironomidae. Instead a researcher might ascribe the 'resource method' for Tanypodinae as 'family', but the 'consumer method' as 'subfamily' (see the second Scenario in Fig. 2). The function output contains references to the original empirical links, the number of matches that were found and the taxonomic level at which those matches were found, so links can be additionally screened and scrutinised post hoc, and analysis can be repeated easily because the function output contains the necessary information. Example R code is supplied (Appendix C).

Comparing the WebBuilder function with empirical food webs
The WebBuilder function was validated on a collection of highlyresolved stream food webs which have had their trophic interactions characterised through direct observation; Broadstone Stream (Woodward et al., 2010), Afon Hirnant (Gilljam et al., 2011;Woodward et al., 2010), Tadnoll Brook  and the summary food web for the  fuscatus is generalised to the genus level for both its consumer and resource links, this allows it to be matched with B. scambus in the registry and the Navicula tripunctata -B. fuscatus, and Cocconeis placentula -B. fuscatus links to be included in the output. Secondly in green, the taxa Tanypodinae are generalised to the family level for its resource links and subfamily level for its consumer links, allowing it to matched with all entries in the registry with the subfamily Tanypodinae and the Tanypodinae -S. trutta, and B. fuscatus -Tanypodinae links to be included in the output. replicated four reference Mill Stream side-channels Woodward et al., 2012). The replicates for the Mill Stream data were pooled to aid comparison with the other food webs, which were all constructed as a single aggregate food web. The Broadstone and Afon Hirnant food webs contained only trophic interactions between macro-invertebrates, the Tadnoll food web contained interactions between macro-invertebrates and fishes and the Mill Stream data contain interactions between macroinvertebrates, algae and detritus. When the WebBuilder function was used to generate the empirical food webs, in turn each respective local dataset was first removed from the global dataset, so each food web was generated in the absence of its own link information (to remove circularities).
The performance of the WebBuilder function was evaluated by calculating the True Skill Statistic (TSS; Allouche et al., 2006). This statistic was used as it can be digested into its component parts to provide information on the types of differences between the empirical and generated food webs, and builds upon the most commonly used metric which is simply the proportion of links correctly generated (e.g. Allesina, 2011;Petchey et al., 2008;Woodward et al., 2010). This statistic was chosen over likelihood based approaches because we were not interested so much in the efficiency of these predictive models, more the biological realism of the generated food webs . The TSS is calculated from the following formula: where a is the number of links which were correctly generated by the function (the True Positives Rate; TPR), b the number of links generated by the function but not observed empirically, c the number of links not generated by the function but were observed empirically and d the number of links neither generated by the function nor observed empirically. TSS score values range from −1 to 1, where a score of −1 represents a generated food web that is the inverse of the empirically observed one (no observed empirical links are seen in the generated food web, and every non-link in the empirical food web is present in the generated food web), and 1 representing a generated food web having the exact same links as the empirically observed one.
Each empirical food web was generated using the level of taxonomic generalisation considered most appropriate (see Appendix D), this mostly consisted of exact and genus level matches although some family and order matches were used. To test how the generated food webs compared to their empirical counterparts, a series of network metrics were calculated; number of links (L), linkage density (L/S; where S is the number of nodes), connectance (C, where C = L/S 2 ), generality (the average number of resources per consumer), vulnerability (the average number of consumers per resource), and proportion of top, intermediate and basal nodes (with cannibalistic links removed). The difference between the generated and empirical network metric was tested with paired Wilcoxon signed rank tests.
To test how the quality of the generated food webs varied with dataset size, the dataset was randomly subsampled, in sequential steps of 5% from 5 to 100%, of the original dataset size, and then used to generate each food web. Each subsample size was repeated five times and each empirical food web was generated in the absence of its own food web data as above, to remove circularities. For each node within each network, the same level of taxonomic generalisation was used as above.
To test how the quality of the pairwise interactions generated by the WebBuilder function varied with the level of taxonomic generalisation, each food web was built using exact, genus, family or order taxonomic generalisation for all nodes. The degree (the number of links into or out of a particular node), generality, and vulnerability for every node in the generated food web was compared with that in the empirical network. The difference between the two for every node was recorded so that a positive score represented interactions 'missed' by the WebBuilder function, and a negative score represented 'extra' interactions not found in the empirical food web. The distribution of these scores gives an indication of how well the WebBuilder function predicted pairwise interactions across the whole network: i.e., if, on average, it tended to 'miss' more interactions, or tended to pick up 'extra' interactions. To test if the mean was different from zero (indicating no difference in the quality of pairwise interactions between the generated and empirical food webs) a one sampled t-test was used.

Comparing the WebBuilder function to theoretical food web models
The performance of the WebBuilder function was compared with examples of some of the best-performing predictive models currently available: the 'Difference', 'Ratio' and 'Difference/Ratio' models (Allesina, 2011) as well as the Allometric Diet Breadth Model (ADBM; with "ratio" handling time, Petchey et al., 2008). The 'Difference', 'Ratio' and 'Difference/Ratio' models all generate food web links on the basis of body size, (either the difference between consumer body size and resource body size, the ratio between the two, or the difference multiplied by the ratio). The ADBM builds on this and incorporates allometries of body size and foraging behaviour of individual consumers to model food web structure (Allesina, 2011 for more detailed explanations; see Petchey et al., 2008). Detritus nodes were first excluded from the Mill Stream food web because these nodes had no body size or abundance data. For the 'Difference', 'Ratio' and 'Difference/Ratio' models two parameters required optimisation, a and b. For the ADBM we used parameter values for the mass to attack rate constant (a), resource mass to attack rate exponent (a i ) and consumer mass to attack rate exponent (a j ) from the literature (Rall et al., 2012) rather than through parameter optimisation as in Petchey et al. (2008), so as to simulate a situation for which the WebBuilder function was designed, where food webs are being generated for the first time with no prior knowledge of the system other than the species richness. For two parameters (mass to handling time constant, h.a; mass to handling time critical ratio, b) we were unable to find information in the literature with which to value these parameters, so went through the process of optimisation. For all models this was achieved by constructing food webs with a range of values for each parameter, and selecting those food webs which had a number of links that was within the range set by the WebBuilder function, i.e. if the WebBuilder function generated K links, and there were L empirical links and K-L = t we selected all possible solutions within the range L-t:L + t, to make the comparison with the WebBuilder function fair. Note that for some food webs the difference between L and K was large, leading to large variation in the Fig. 3. The quality of the generated food web increases with the size of the dataset. Fluctuations in the TSS score are caused by changes in the component parts of the TSS, i.e. while the TPR may increase as the dataset size increases, other metrics such as the FPR might also increase, causing the total TSS to fall (see Methods). Lines are fitted using a LOESS smoother (Cleveland et al., 1992), grey shading indicates the 95% confidence intervals. food web sizes generated by these models. Indeed for the Afon Hirnanlt food web this range fell below zero, and so the range was arbitrarily set to be the same proportional size as that of the Tadnoll food web, which had the next highest range. Parameter optimisation was conducted without using the connectance of the empirical food webs, hence although the same data have been used, results will vary from previous publications. Prior knowledge of the connectance of food webs would not be possible if a food web were being built de novo, so here we are using these models in a different way from their original application.

Comparing the WebBuilder function with empirical food webs
When we constructed food webs from random subsets of the dataset, the quality (as measured by TSS scores) of the generated food webs improved as the number of records in the dataset increased, allowing more complete resource and consumer interactions to be ascribed to each taxa (Fig. 3). The strength of this relationship was food web specific, for instance Broadstone and Afon Hirnant did not continue to improve beyond a dataset size of about 25%. These food webs are relatively simplistic compared to Tadnoll and Millstream, and so the WebBuilder function reached its optimum performance when generating these food webs with a fraction of the total dataset. Tadnoll and Millstream did not reach their asymptotes suggesting that more data is needed to improve upon the quality of their generated food webs.
The level of taxonomic generalisation for each node was important for the quality of the generated food web; if the taxonomy of a given node list was generalised too far (typically beyond the family level) then the ascribed links became unrepresentative and the food web become overconnected resulting in an increased FPR and lower TSS score (Fig. A.1, Appendix A). At the scale of individual trophic interactions, the difference in degree, generality and vulnerability was generally positive when matching taxa exactly or at the genus level, and becomes progressively more negative as the taxonomic generalisation increased, indicating that the WebBuilder function was 'missing' links when matching nodes exactly or at the genus level, and including progressively more links the further the taxonomy was generalised (Fig. 4). For Afon Hirnant and Tadnoll there was no significant difference in the generality of consumers between the generated and empirical food webs when taxa were matched at the genus level, and there was no significant difference in vulnerability of resources for the Tadnoll food web when match at the genus level. This suggests that matching taxa at the genus level for these food webs produces the most 'accurate' pairwise interactions. For all other food webs and levels of taxonomic generalisations the generated links were different from that of the empirical food web (Fig. 4).
The occurrence of each food web's nodes in the dataset is given in Table 2. The coverage of these within the reduced dataset (food web data were removed from the dataset when used to generate the food web for that site) varied between 1497 (Broadstone) and 6704 occurrences (Mill Stream) ( Table 2). Even at the family level some nodes from Broadstone, Afon Hirnant and Mill Stream were not represented in the dataset, meaning that those nodes needed to be generalised further still for the WebBuilder function to generate their links. These nodes tended to be rare taxa which were poorly represented in the dataset. The generated food webs (see Appendix S4 for the generated trophic links) had similar network metrics to the empirical food webs (Table 3), although the proportion of top nodes was consistently lower in the generated food webs, and the proportion of intermediate and basal nodes was consistently higher. All generated food web metrics were found to be similar to that of their empirical counterparts (paired

Table 2
The representation of the food web taxa within the full dataset and partial dataset (i.e., diet data gathered from a food web were excluded from the generation of its own inferred food web). Wilcoxon signed rank test, p = N 0.05). The TSS ranged from 0.405 (Broadstone) to 0.571 (Tadnoll Brook). Two food webs (Broadstone and Afon Hirnant) contained nodes that were found to have predatory links in the empirical food web but were not predicted to have any by the WebBuilder function, and vice versa many nodes distributed across all the food webs were predicted to have consumer links but were not found to have any empirically (Fig. 5).

Comparing the WebBuilder function method to theoretical food web models
The percentage of links correctly predicted (TPR) by the ADBM ranged from 12 to 43%, for the Difference model it was 0-46%, Ratio model it was 0-51% and the Difference/Ratio it was 0-54% (Fig. 6). All webs generated by the WebBuilder function had higher TPR and TSS Table 3 The number of links (L), linkage density (L/S, where S = number of nodes), the connectance (C, where C = L/S 2 ), generality, vulnerability, proportion of top, intermediate and basal species of the empirical and generated food webs. The performance of the WebBuilder function (relative to the original empirical food web) is summarised by the TSS statistic (which gives an overall measure of performance), and TPR (the proportion of links correctly generated). All food web metrics for the generated food webs were found to be similar to that of their empirical counterparts (paired Wilcoxon signed rank test, p = N 0.05).  5. Predation matrices for the empirical food webs compared to those generated by the AR method. Nodes are ordered by increasing body mass. A trophic link is represented by a point indicating that the taxon in that column consumes the taxon in that row. Links generated by the WebBuilder function are represented by empty circles, and those found empirically are represented by smaller, filled circles. scores than the median values for the Difference, Ratio and Difference/ Ratio models (Fig. 6). In general the WebBuilder function had higher TPR and TSS scores than the ADBM, however the TPR score for Tadnoll and Afon Hirnant were similar to the median ADBM TPR score for that particular food web (as opposed to the overall median). Additionally the TSS score for Tadnoll generated by the WebBuilder function was similar to the median ADBM TSS score (Fig. A.2, Appendix A).

Strengths and weaknesses of the WebBuilder function
Here we have demonstrated a systematic and reproducible method for building ecological networks from compilations of previously observed interactions. The WebBuilder function facilitates comparability across studies, re-analysis and data sharing. Although developed in the context of freshwater food webs, given its simplicity and generality the WebBuilder function could be easily applied to other systems, such as terrestrial food webs or even mutualistic networks. Plenty of other datasets already exist which could be exploited similarly to produce comparable, reproducible networks from marine and terrestrial systems (e.g., Barnes, 2008; Database of Insects and their Food Plants; http:// www.brc.ac.uk/dbif/).
The WebBuilder function is an effective tool for constructing summary ecological networks for the first time. The overall performance (TSS) of the WebBuilder function exceeded that of the ADBM, Difference, Ratio and Difference/Ratio models. The proportion of correctly predicted links (TPR) was similar to or exceeded that of the ADBM. The ADBM cannot predict links for nodes that have no body-size informationeither because it is not known or because the concept is meaningless for the node, such as detrital resources. This problem does not apply to the WebBuilder function. The ADBM, Difference, Ratio and Difference/Ratio models have been used to generate the food webs presented here before, and have performed better than we have achieved here (Allesina, 2011;Petchey et al., 2008;Woodward et al., 2010), however to achieve this accuracy the generated food webs were constrained to have the same connectance as the empirical food webs, an approach not available when building a food web for the first time. Indeed there were instances here that the TPR and TSS of modelled food webs exceeded that of the WebBuilder function, but from the range of possible food webs generated by these models, it is impossible to select the most 'accurate' one without knowledge of the expected number of links. The WebBuilder function does not rely on prior knowledge of the food web, only on the correct identification of the nodes, thusreducing biases and restrictions.
It is perhaps unfair to compare the performance of the WebBuilder function to that of the ADBM, Difference, Ratio and Difference/Ratio models due to the inherent differences in the mechanisms through which they operate, and indeed it is not our intention for this exercise to be taken as a criticism of these alternative approaches. Rather, we have compared them here in order to place the WebBuilder method in the broader context of some of other more widely-used predictive methods currently available. Comparing our approach with the performance of the ADBM essentially represents a test of, and a means of improving, our understanding of the mechanistic theory behind these trophic interactions. Comparing the food webs produced by our approach with empirical food webs represents a test of the quality of the underlying data held within the dataset of trophic interactions. The WebBuilder function should be used as tool with which to construct large collections of food webs with which to test our understanding of food web structure across environmental gradients. The WebBuilder function is particularly suited to constructing food webs for data-poor systems, e.g., where there is no information available about the abundance or body size of nodes, with the only information being a list of species present. Clearly the ADBM or other predictive models would not be suited to these conditions, as they were never designed to work in this way. The WebBuilder function, however, would be able to generate reasonably realistic food webs if given a reference dataset of relevant trophic interactions. The WebBuilder function is adaptive, and can be improved upon over time; for instance, by increasing the size and coverage of the dataset of interactions. Hence it requires a substantial amount of data to perform well, unlike the predictive models analysed here. These types of methods can be viewed as complementary: a researcher might use both in conjunction in order to harness the advantages of both to better predict food web structure: indeed we envisage combining the WebBuilder function and other predictive approaches in parallel to build and understand food webs.
The four food webs presented here are among the most highly resolved and complete freshwater food webs published to date, yet the links are still under-sampled for many nodes (Woodward et al., 2010), due to methodological issues and logistical constraints on sampling effort. The WebBuilder function can help to overcome these issues. Firstly, it can take many hundreds of individuals to characterise a species diet (Ings et al., 2009) and thus the interactions between rare consumers and rare resources are often under-sampled. The WebBuilder function helps to overcome this as rare interactions need only be observed once in the dataset of previously published interactions in order to be incorporated into applicable food webs as they are constructed: i.e., potentially the "global diet" of a species is held within the dataset, and can be expanded in future data collections. Secondly, the method of observing interactions often limits the types of interactions which can be characterised; for instance, the prey of suctorial predators (which are especially common in terrestrial ecosystems) cannot be identified through traditional gut gives an overall measure of the performance of the predictive method relative to empirical food webs, and varies between 1 (a generated food web that is exactly the same as the empirical food web) and −1 (a generated food web which is the exact inverse of the empirical food web). The TPR (True Positives Rate; bottom panel) is the proportion of generated food web links that were also found empirically, and varies between 0 (no links generated correctly) and 1 (all links generated correctly). A box plot of each set of values is given, indicating the range, quartile ranges and median of each set of values.
For the WebBuilder function only the individual scores for the four food webs are shown, for all others there are too many generated scores to be shown individually; ADBM (n = 508), Difference (n = 32,025), Ratio (n = 43,638) and Difference/Ratio (n = 41,602).
contents analysis, but if characterised through other means (e.g. laboratory trials or molecular sequencing) they can be included in the dataset and incorporated into generated food webs. For instance, two suctorial predators in the Broadstone food web (Platambus maculatus and Bezzia sp.) did not have their guts analysed for predatory links in the original study (Woodward et al., 2005) and so had been previously excluded from the food web (e.g. Petchey et al., 2008;Woodward et al., 2010), these nodes would have been predicted to prey upon other species by the WebBuilder function. This is due to the WebBuilder function generalising the taxonomy of these nodes, and their subsequent appearances in the dataset, as other studies have characterised the diets of these taxa. Some links in the dataset of trophic interactions were known from just a single data source, e.g. Cordulegaster boltonii as a consumer of Nemurella pictetii is known only from the Broadstone food web. Therefore, when we excluded self-referrential diet data, the WebBuilder function reconstruction of Broadstone did not predict a trophic link between C. boltonii and N. pictetii. We have not quantified how often this effect occurred.
As with other open-source datasets, anomalies will be ironed out as the dataset is enriched with more observations as it grows, and its coverage will improve over time.
Besides constructing food webs de novo, the WebBuilder function could be used to standardise a collection of networks gathered from different sources prior to analysis. This would effectively standardise the sampling effort for included interactions (although not for species richness or taxonomic resolution) and would remove spatially or temporally explicit interactions (or lack thereof). If the analysis was concerned with the structure of summary food webs from different locations and habitat types then this might be an appropriate first step.

Future directions
The realism of links generated by the WebBuilder function could be addressed by assessing the number of times a particular interaction appears in the dataset, as well as the number of times an interaction could have occurred but did not (i.e. species found at the same site but not found to interact). If a particular interaction has been observed many times across many systems, it is probably reasonable to assume it also occurs at other sites where those species co-exist. However, if it has only been observed rarely, or at a site with very different characteristics than the one in question (for instance contrasting environmental conditions, or significantly different community assemblages) this assumption might not be so reasonable. As the size of the dataset continues to grow, evaluation of whether links are realised or not will improve over time.
The WebBuilder function is designed to construct summary food webs, and ignores potential behavioural shifts of species, hence it is unsuitable for constructing temporally or spatially explicit food webs. Additional data such as abundance information could be used to weight interactions, this would, for instance, reduce the weight of interactions between rare species reducing their influence on food web structure and increasing the realism of the resulting food web. There is an increasing body of literature detailing the importance of weak and strong interactions within networks (e.g. Berlow et al., 2004;De Ruiter et al., 1995;Vazquez et al., 2007) and a multitude of methods already exist for determining interaction strengths in food webs (see Berlow et al., 2004) some of which can be employed alongside the WebBuilder function. Thus, despite the 'coarse' nature of food webs built in this way there is much potential for their use in ecological research, and by combining them with models such as those presented here potential mismatches arising from behavioural shifts could be highlighted.
It would be straightforward for the underlying code of the WebBuilder function to be extended to incorporate a range of traits that could influence the realisation of potential trophic interactions, other than phylogeny, such as life stage or body size. For instance, within freshwater food webs body size is an important determinant of trophic interactions, and food web structure predicted using body size alone may be more accurate than those predicted using phylogeny alone (Woodward et al., 2010). This could further increase the realism of the constructed food webs and hence their wider applicability and usefulness.
This dataset of trophic interactions was collated to test the performance of the WebBuilder function when predicting the structure of the four empirical UK freshwater food webs used here. It would be straightforward to extend the coverage of this dataset by augmenting it with data collected from other geographic regions. If this dataset is used to construct food webs in the future researchers will need to use their discretion to decide how applicable it is to their system. For instance, this initial version of the dataset does not provide good coverage of lentic species, or species from across Europe or other parts of the world. However, interaction data are being published at a rapidly accelerating rate (Ings et al., 2009) and this can be used to form an iterative feedback process, improving data quality over time; the presence of links predicted by the WebBuilder function can therefore be tested evermore rigorously in the future. Identifying underrepresented nodes in the dataset will help target further research more cost effectively: e.g., a great deal is known about the diet of a handful of often economically valuable species in the dataset (for instance, brown trout, Salmo trutta appears N3000 times), but very little is known about many others. Additionally, technologies such as those provided by recent advances in molecular sequencing will improve the efficiency of trophic interaction detection (Clare, 2014) and therefore the volume of data which can be incorporated into the dataset. We actively encourage researchers with suitable data to contribute them to this dataset. Exciting initiatives such as Global Biotic Interactions (Poelen et al., 2014), by incorporating necessary information such as the method through which an interaction was determined, could provide a global, open source repository of interaction data which the WebBuilder function could access through R. As more of these unknown links become known, nodes will not need to be generalised taxonomically in order to find matches in the dataset, the links generated will more closely match the known links for those species and therefore the quality of the ecological food webs generated by the WebBuilder function will improve.

Conclusions
We have demonstrated that the food webs generated here are comparable to empirically observed food webs and exceeded the accuracy of other potential methods of predicting freshwater food webs. This method could be used to build vast numbers of ecological networks from data that already exists, such as routine biomonitoring data which is collected in huge volumes in many parts of the world (e.g., Dutch soil biomonitoring data have recently been used to build a large collection of food webs; Cohen and Mulder, 2014). Producing collections of replicable networks is vital for advancing ecological network research beyond the largely unreplicated case-study approach that has dominated to date: the WebBuilder function approach presents a new robust and repeatable method that helps move us considerably closer to that goal.