logo Netzschleuder network catalog, repository, and centrifuge

History of coastal_parasite_webs

The changes to the source code of this entry in the repository, newest first, each with the differences it made to the entry's files. They are also listed on GitLab.

[entries] Add the date when each entry was added, and remove icon_hash by Tiago de Paula Peixoto beff7c9
The dates are those of the commits that first added the entries' files
(2020-08-11 for the entries of the initial commit); renamed entries keep
the date of their first name.

Changed: none
diff --git a/entries/coastal_parasite_webs/__init__.py b/entries/coastal_parasite_webs/__init__.py
index 9a82b2d..d7b5c1a 100644
--- a/entries/coastal_parasite_webs/__init__.py
+++ b/entries/coastal_parasite_webs/__init__.py
@@ -57,7 +57,7 @@ tags = ['Biological', 'Food web', 'Unweighted', 'Metadata']
 url = 'https://doi.org/10.5061/dryad.b8r5c'
 citation = [('J. A. Dunne, K. D. Lafferty, A. P. Dobson, R. F. Hechinger, A. M. Kuris, N. D. Martinez, J. P. McLaughlin, K. N. Mouritsen, R. Poulin, K. Reise, D. B. Stouffer, D. W. Thieltges, R. J. Williams, C. D. Zander, "Parasites affect food web structure primarily through increased diversity and complexity." PLoS Biology 11(6), e1001579 (2013)', 'https://doi.org/10.1371/journal.pbio.1001579'),
             ('J. A. Dunne, K. D. Lafferty, A. P. Dobson, R. F. Hechinger, A. M. Kuris, N. D. Martinez, J. P. McLaughlin, K. N. Mouritsen, R. Poulin, K. Reise, D. B. Stouffer, D. W. Thieltges, R. J. Williams, C. D. Zander, "Data from: Parasites affect food web structure primarily through increased diversity and complexity." Dryad (2013)', 'https://doi.org/10.5061/dryad.b8r5c')]
-icon_hash = '56a85c8e26855e083a2f7942'
+date_added = '2026-10-25'
 upstream_license = ('Creative Commons CC0 1.0 Universal', 'https://creativecommons.org/publicdomain/zero/1.0/')
 # Zip file of the dataset version (the individual file downloads require an
 # access token)
[entries] Remove unneeded code from the entries by Tiago de Paula Peixoto 2c69f19
Unneeded "global files" statements, unused imports and variables,
f-strings without placeholders, duplicate keys in foodweb_little_rock
(keeping the order and the values used), and the second definition of
get_lines() in twitter_higgs. Nothing changes in the networks or
descriptions.

Changed: none
diff --git a/entries/coastal_parasite_webs/__init__.py b/entries/coastal_parasite_webs/__init__.py
index 934b0e2..9a82b2d 100644
--- a/entries/coastal_parasite_webs/__init__.py
+++ b/entries/coastal_parasite_webs/__init__.py
@@ -99,7 +99,6 @@ def fetch_upstream(force=False):
 @coerce_props()
 @annotate()
 def parse(alts=None):
-    global files
     name = __name__.split(".")[-1]
     for fname, alt, fmt in files:
         if alts is not None and alt not in alts:
[entries] Use American spelling in the descriptions by Tiago de Paula Peixoto 802d564
British spellings in the titles and descriptions of 69 entries (e.g.
labelled, organisation, millimetres, centres, anonymised, neighbours,
analysed, modelled, colour, licence) are replaced by the American ones.
Proper names keep their spelling (Otago Harbour, the Centre for Water
Systems, the Centre jeunesse de Montréal, the Dutch Ministry of Defence),
as do quoted upstream terms, citations, and property names.
diff --git a/entries/coastal_parasite_webs/__init__.py b/entries/coastal_parasite_webs/__init__.py
index 7a19d3d..934b0e2 100644
--- a/entries/coastal_parasite_webs/__init__.py
+++ b/entries/coastal_parasite_webs/__init__.py
@@ -24,7 +24,7 @@ description = """Seven coastal marine or estuarine food webs that include metazo
 
 The original webs represent the life stages of parasites with complex life cycles (e.g. the cercariae, metacercariae and adults of trematodes) as separate nodes. In these versions, the life stages of each parasite species, and their links, were aggregated into a single node. Nodes are therefore species (or coarser taxa, functional groups and non-living resources, such as detritus and carrion), and a directed edge points from a consumer to its resource (prey or host). Self-loops represent cannibalism.
 
-Each network contains the most complete version of the web (with parasites and concomitant links), and the edge property `link_type` identifies the nested subsets that correspond to the three versions of each web analysed in the source:
+Each network contains the most complete version of the web (with parasites and concomitant links), and the edge property `link_type` identifies the nested subsets that correspond to the three versions of each web analyzed in the source:
 
 - `"free-living"`: links among free-living taxa only (the free-living web).
 - `"parasitic"`: the additional links of the web with parasites but without concomitant links, i.e. parasites consuming their hosts, free-living taxa consuming parasites (targeted predation, e.g. on free-living parasite stages), and parasite–parasite links. The Ythan Estuary web only has parasite–host links here.
[entries] New entry: coastal_parasite_webs by Tiago de Paula Peixoto 26cc9b3
diff --git a/entries/coastal_parasite_webs/__init__.py b/entries/coastal_parasite_webs/__init__.py
new file mode 100644
index 0000000..7a19d3d
--- /dev/null
+++ b/entries/coastal_parasite_webs/__init__.py
@@ -0,0 +1,147 @@
+#! /usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2020-2026 Tiago de Paula Peixoto <tiago@skewed.de>
+#
+# This program is free software: you can redistribute it and/or modify it under
+# the terms of the GNU Affero General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option) any
+# later version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
+# details.
+#
+# You should have received a copy of the GNU Affero General Public License along
+# with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+from openpyxl import load_workbook
+from .. import *
+
+title = "Coastal food webs with metazoan parasites (2013)"
+description = """Seven coastal marine or estuarine food webs that include metazoan parasites, in the species-level (aggregated) versions compiled by J. A. Dunne and colleagues for a comparative analysis of how parasites affect food web structure. Three webs are from the North American Pacific coast, compiled by R. F. Hechinger and colleagues: Carpinteria Salt Marsh (California, USA), Estero de Punta Banda and Bahía Falsa in Bahía San Quintín (both in Baja California, Mexico). Three are from Europe and New Zealand, compiled by a second research group: Flensburg Fjord (Baltic Sea, between Germany and Denmark), Sylt Tidal Basin (North Sea, between Germany and Denmark) and Otago Harbour (Dunedin, New Zealand). The seventh is the Ythan Estuary web (North Sea, near Aberdeen, Scotland) of M. Huxham, S. Beaney and D. Raffaelli (1996). The parasite data were mostly obtained by dissecting individuals of the free-living species sampled in each habitat, supplemented with the literature for the same or nearby sites and with inferences from host and parasite biology; some groups (e.g. protozoans and bacteriophages) are not, or only poorly, identified.
+
+The original webs represent the life stages of parasites with complex life cycles (e.g. the cercariae, metacercariae and adults of trematodes) as separate nodes. In these versions, the life stages of each parasite species, and their links, were aggregated into a single node. Nodes are therefore species (or coarser taxa, functional groups and non-living resources, such as detritus and carrion), and a directed edge points from a consumer to its resource (prey or host). Self-loops represent cannibalism.
+
+Each network contains the most complete version of the web (with parasites and concomitant links), and the edge property `link_type` identifies the nested subsets that correspond to the three versions of each web analysed in the source:
+
+- `"free-living"`: links among free-living taxa only (the free-living web).
+- `"parasitic"`: the additional links of the web with parasites but without concomitant links, i.e. parasites consuming their hosts, free-living taxa consuming parasites (targeted predation, e.g. on free-living parasite stages), and parasite–parasite links. The Ythan Estuary web only has parasite–host links here.
+- `"concomitant"`: concomitant predation links, i.e. predators consuming the parasites of their prey, inferred by assuming that a predator eats all the parasites of infected prey. In the Ythan Estuary web, this set also contains all the links of free-living taxa to parasites and the parasite–parasite links, and in the three Californian webs it also contains a few (8 to 11) links among free-living taxa.
+
+The networks are:
+
+| Network | Location | Nodes (parasites) | free-living | parasitic | concomitant |
+|---|---|---|---|---|---|
+| `bahia_falsa` | Bahía Falsa, Baja California | 171 (52) | 1,077 | 1,157 | 1,486 |
+| `carpinteria` | Carpinteria Salt Marsh, California | 165 (58) | 970 | 1,217 | 1,521 |
+| `punta_banda` | Estero de Punta Banda, Baja California | 214 (76) | 1,657 | 1,677 | 2,319 |
+| `flensburg` | Flensburg Fjord, Germany/Denmark | 123 (46) | 579 | 389 | 438 |
+| `otago` | Otago Harbour, New Zealand | 142 (19) | 1,206 | 281 | 357 |
+| `sylt` | Sylt Tidal Basin, Germany/Denmark | 161 (35) | 1,052 | 898 | 1,055 |
+| `ythan` | Ythan Estuary, Scotland | 133 (42) | 420 | 177 | 794 |
+
+The `bahia_falsa`, `carpinteria` and `punta_banda` networks are derived from the life-stage resolved webs in the entry `california_estuaries`, and `flensburg` from the one in the entry `flensburg_fjord`; the ones here differ by the aggregation of parasite life stages into species, and contain fewer node attributes. An earlier version of the Carpinteria Salt Marsh web (Lafferty et al. 2006) is the network `food_web_lafferty` of the entry `iwdb`, and is also included in `gateway_foodwebs`. In the Ythan Estuary web, the species 100 of the original data, an animal without resources, was removed together with its only link; the remaining nodes were not renumbered.
+
+Node properties:
+
+- `node_id`: the identifier of the node in the source (in the Ythan web, 100 is missing).
+- `name`: the name of the taxon or resource.
+- `is_parasite`: whether the node is a parasite taxon (type 2 in the source) or a free-living taxon or non-living resource (type 1).
+
+Edge properties:
+
+- `link_type`: the version of the web in which the link first appears (`"free-living"`, `"parasitic"` or `"concomitant"`, see above)."""
+tags = ['Biological', 'Food web', 'Unweighted', 'Metadata']
+url = 'https://doi.org/10.5061/dryad.b8r5c'
+citation = [('J. A. Dunne, K. D. Lafferty, A. P. Dobson, R. F. Hechinger, A. M. Kuris, N. D. Martinez, J. P. McLaughlin, K. N. Mouritsen, R. Poulin, K. Reise, D. B. Stouffer, D. W. Thieltges, R. J. Williams, C. D. Zander, "Parasites affect food web structure primarily through increased diversity and complexity." PLoS Biology 11(6), e1001579 (2013)', 'https://doi.org/10.1371/journal.pbio.1001579'),
+            ('J. A. Dunne, K. D. Lafferty, A. P. Dobson, R. F. Hechinger, A. M. Kuris, N. D. Martinez, J. P. McLaughlin, K. N. Mouritsen, R. Poulin, K. Reise, D. B. Stouffer, D. W. Thieltges, R. J. Williams, C. D. Zander, "Data from: Parasites affect food web structure primarily through increased diversity and complexity." Dryad (2013)', 'https://doi.org/10.5061/dryad.b8r5c')]
+icon_hash = '56a85c8e26855e083a2f7942'
+upstream_license = ('Creative Commons CC0 1.0 Universal', 'https://creativecommons.org/publicdomain/zero/1.0/')
+# Zip file of the dataset version (the individual file downloads require an
+# access token)
+upstream_prefix = 'https://datadryad.org/api/v2/versions/3810'
+files = [('download:zip:Dunne2013PBioSupData.xlsx', 'bahia_falsa', None),
+         ('download:zip:Dunne2013PBioSupData.xlsx', 'carpinteria', None),
+         ('download:zip:Dunne2013PBioSupData.xlsx', 'punta_banda', None),
+         ('download:zip:Dunne2013PBioSupData.xlsx', 'flensburg', None),
+         ('download:zip:Dunne2013PBioSupData.xlsx', 'otago', None),
+         ('download:zip:Dunne2013PBioSupData.xlsx', 'sylt', None),
+         ('download:zip:Dunne2013PBioSupData.xlsx', 'ythan', None)]
+
+# alt -> (column block in the species list sheet, links sheet)
+webs = {"bahia_falsa": (0, "Bahia Falsa links"),
+        "carpinteria": (1, "Carpinteria Salt Marsh links"),
+        "punta_banda": (2, "Estero de Punta Banda links"),
+        "flensburg": (3, "Flensburg Fjord links"),
+        "otago": (4, "Otago Harbor links"),
+        "sylt": (5, "Sylt Tidal Basin links"),
+        "ythan": (6, "Ythan Estuary links")}
+
+link_types = ["free-living", "parasitic", "concomitant"]
+
+def read_links(rows, c):
+    # Two-column (consumer, resource) lists; the Sylt sheet has summary
+    # formulas below the data, so stop at the first non-numeric row
+    edges = []
+    for r in rows[1:]:
+        if not isinstance(r[c], int) or not isinstance(r[c + 1], int):
+            break
+        edges.append((r[c], r[c + 1]))
+    return edges
+
+def fetch_upstream(force=False):
+    return fetch_upstream_files(__name__.split(".")[-1], upstream_prefix, files,
+                                force)
+
+@cache_network()
+@coerce_props()
+@annotate()
+def parse(alts=None):
+    global files
+    name = __name__.split(".")[-1]
+    for fname, alt, fmt in files:
+        if alts is not None and alt not in alts:
+            continue
+
+        k, sheet = webs[alt]
+        with open_upstream_file(name, fname, "rb", seekable=True) as f:
+            wb = load_workbook(f, read_only=True)
+            species = list(wb.worksheets[1].iter_rows(values_only=True))
+            links = list(wb[sheet].iter_rows(values_only=True))
+            wb.close()
+        assert species[1][4 * k: 4 * k + 3] == ("ID", "Type", "Name")
+
+        g = Graph(directed=True)
+        g.vp.node_id = g.new_vp("int")
+        g.vp.name = g.new_vp("string")
+        g.vp.is_parasite = g.new_vp("bool")
+        g.ep.link_type = g.new_ep("string")
+
+        vmap = {}
+        for r in species[2:]:
+            i, t, n = r[4 * k: 4 * k + 3]
+            if i is None:
+                continue
+            v = g.add_vertex()
+            vmap[i] = v
+            g.vp.node_id[v] = i
+            g.vp.name[v] = str(n).strip()
+            assert t in (1, 2)
+            g.vp.is_parasite[v] = t == 2
+
+        # the three web versions are nested: free-living <= parasitic <=
+        # concomitant
+        seen = set()
+        for j, lt in enumerate(link_types):
+            edges = read_links(links, 3 * j)
+            assert seen <= set(edges)
+            for s, t in edges:
+                if (s, t) in seen:
+                    continue
+                seen.add((s, t))
+                e = g.add_edge(vmap[s], vmap[t])
+                g.ep.link_type[e] = lt
+
+        yield alt, g