logo Netzschleuder network catalog, repository, and centrifuge

History of california_estuaries

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/california_estuaries/__init__.py b/entries/california_estuaries/__init__.py
index 4253834..30b701c 100644
--- a/entries/california_estuaries/__init__.py
+++ b/entries/california_estuaries/__init__.py
@@ -75,7 +75,7 @@ According to the source, the data are freely available for non-commercial scient
 tags = ['Biological', 'Food web', 'Unweighted', 'Metadata']
 url = 'https://esapubs.org/archive/ecol/E092/066/default.htm'
 citation = [('R. F. Hechinger, K. D. Lafferty, J. P. McLaughlin, B. L. Fredensborg, T. C. Huspeni, J. Lorda, P. K. Sandhu, J. C. Shaw, M. E. Torchin, K. L. Whitney, A. M. Kuris, "Food webs including parasites, biomass, body sizes, and life stages for three California/Baja California estuaries." Ecology 92(3), 791 (2011)', 'https://doi.org/10.1890/10-1383.1')]
-icon_hash = None
+date_added = '2026-10-25'
 upstream_license = None
 upstream_prefix = 'https://esapubs.org/archive/ecol/E092/066'
 files = [(('All_Data_Files.zip:Metaweb_Nodes.txt',
[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/california_estuaries/__init__.py b/entries/california_estuaries/__init__.py
index f4d6714..4253834 100644
--- a/entries/california_estuaries/__init__.py
+++ b/entries/california_estuaries/__init__.py
@@ -145,7 +145,6 @@ def fetch_upstream(force=False):
 @coerce_props()
 @annotate()
 def parse(alts=None):
-    global files
     name = __name__.split(".")[-1]
     for fnames, 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/california_estuaries/__init__.py b/entries/california_estuaries/__init__.py
index 044d8d7..f4d6714 100644
--- a/entries/california_estuaries/__init__.py
+++ b/entries/california_estuaries/__init__.py
@@ -21,7 +21,7 @@ import io
 from .. import *
 
 title = "California estuary food webs with parasites (2011)"
-description = """Food webs of three estuaries of the Pacific coast of California and Baja California, including parasites (infectious agents), life stages, body sizes and biomasses, compiled by R. F. Hechinger and colleagues: Carpinteria Salt Marsh, California, USA (CSM, 61 ha, data from 2003 to 2008), Estero de Punta Banda, Baja California, Mexico (EPB, 707 ha, 1992 to 2005), and Bahía Falsa in Bahía San Quintín, Baja California, Mexico (BSQ, 144 ha, 1994 to 2005). Most nodes and their body sizes and biomasses come from a stratified random sampling of the intertidal zone of each estuary (including birds, fishes and plankton), which quantified the plants and animals larger than about 1 mm and many infectious agents (mostly metazoan parasites, such as trematodes, cestodes, nematodes and acanthocephalans, but also some microbes); this was complemented with published sources and additional sampling of unrepresented groups. Nodes are species, or life stages of species with complex life cycles (e.g. the parthenitae, cercariae, metacercariae and adults of trematodes, or the larvae and adults of polychaetes and bivalves, each of which is a separate node), as well as some aggregated assemblages (e.g. phytoplankton, benthic diatoms, meiofauna) and non-living resources (detritus, carrion). A directed edge goes from a consumer to its resource (prey or host). The links include 21 possible types of interaction (13 of which occur in the data), covering four general kinds of interaction: predators consuming prey, parasites consuming hosts, predators consuming parasites, and parasites consuming parasites. Note that some link types do not represent resource dependencies (e.g. "concurrent predation on symbionts", i.e. a predator consuming the parasites of its prey, "trophic transmission", "commensalism"), and may need to be excluded from some analyses. Free-living links were constructed by extending the earlier Carpinteria Salt Marsh web of Lafferty et al. (2006), which this one supplants (the earlier web is the network `food_web_lafferty` of the entry `iwdb`, and is also included in `gateway_foodwebs`): links were assumed to occur in the other estuaries when the nodes co-occur, and links of new nodes were modelled after similar nodes of the earlier web, and then modified based on the literature and observations; most parasite links were directly observed. Some groups are missing or under-represented, such as plant parasites, bird and fish ectoparasites, flying insects, protists, viruses, fungi and bacteria.
+description = """Food webs of three estuaries of the Pacific coast of California and Baja California, including parasites (infectious agents), life stages, body sizes and biomasses, compiled by R. F. Hechinger and colleagues: Carpinteria Salt Marsh, California, USA (CSM, 61 ha, data from 2003 to 2008), Estero de Punta Banda, Baja California, Mexico (EPB, 707 ha, 1992 to 2005), and Bahía Falsa in Bahía San Quintín, Baja California, Mexico (BSQ, 144 ha, 1994 to 2005). Most nodes and their body sizes and biomasses come from a stratified random sampling of the intertidal zone of each estuary (including birds, fishes and plankton), which quantified the plants and animals larger than about 1 mm and many infectious agents (mostly metazoan parasites, such as trematodes, cestodes, nematodes and acanthocephalans, but also some microbes); this was complemented with published sources and additional sampling of unrepresented groups. Nodes are species, or life stages of species with complex life cycles (e.g. the parthenitae, cercariae, metacercariae and adults of trematodes, or the larvae and adults of polychaetes and bivalves, each of which is a separate node), as well as some aggregated assemblages (e.g. phytoplankton, benthic diatoms, meiofauna) and non-living resources (detritus, carrion). A directed edge goes from a consumer to its resource (prey or host). The links include 21 possible types of interaction (13 of which occur in the data), covering four general kinds of interaction: predators consuming prey, parasites consuming hosts, predators consuming parasites, and parasites consuming parasites. Note that some link types do not represent resource dependencies (e.g. "concurrent predation on symbionts", i.e. a predator consuming the parasites of its prey, "trophic transmission", "commensalism"), and may need to be excluded from some analyses. Free-living links were constructed by extending the earlier Carpinteria Salt Marsh web of Lafferty et al. (2006), which this one supplants (the earlier web is the network `food_web_lafferty` of the entry `iwdb`, and is also included in `gateway_foodwebs`): links were assumed to occur in the other estuaries when the nodes co-occur, and links of new nodes were modeled after similar nodes of the earlier web, and then modified based on the literature and observations; most parasite links were directly observed. Some groups are missing or under-represented, such as plant parasites, bird and fish ectoparasites, flying insects, protists, viruses, fungi and bacteria.
 
 The entry contains four networks:
 
@@ -69,7 +69,7 @@ Edge properties (`metaweb` only):
 
 Edge properties (estuary webs only):
 
-- `evidence`: the evidence for the link ("observed": directly observed in the field, in gut contents or in parasitological examinations; "inferred": observed at other localities or in experiments, or based on expert opinion; "modeled": modelled after the interactions of similar species; "speculated": inferred from general knowledge of the taxon; empty if not given); `evidence_notes`: notes on the evidence.
+- `evidence`: the evidence for the link ("observed": directly observed in the field, in gut contents or in parasitological examinations; "inferred": observed at other localities or in experiments, or based on expert opinion; "modeled": modeled after the interactions of similar species; "speculated": inferred from general knowledge of the taxon; empty if not given); `evidence_notes`: notes on the evidence.
 
 According to the source, the data are freely available for non-commercial scientific use, given the appropriate citation."""
 tags = ['Biological', 'Food web', 'Unweighted', 'Metadata']
[entries] New entry: california_estuaries by Tiago de Paula Peixoto 7633e1c
diff --git a/entries/california_estuaries/__init__.py b/entries/california_estuaries/__init__.py
new file mode 100644
index 0000000..044d8d7
--- /dev/null
+++ b/entries/california_estuaries/__init__.py
@@ -0,0 +1,228 @@
+#! /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/>.
+
+import csv
+import io
+from .. import *
+
+title = "California estuary food webs with parasites (2011)"
+description = """Food webs of three estuaries of the Pacific coast of California and Baja California, including parasites (infectious agents), life stages, body sizes and biomasses, compiled by R. F. Hechinger and colleagues: Carpinteria Salt Marsh, California, USA (CSM, 61 ha, data from 2003 to 2008), Estero de Punta Banda, Baja California, Mexico (EPB, 707 ha, 1992 to 2005), and Bahía Falsa in Bahía San Quintín, Baja California, Mexico (BSQ, 144 ha, 1994 to 2005). Most nodes and their body sizes and biomasses come from a stratified random sampling of the intertidal zone of each estuary (including birds, fishes and plankton), which quantified the plants and animals larger than about 1 mm and many infectious agents (mostly metazoan parasites, such as trematodes, cestodes, nematodes and acanthocephalans, but also some microbes); this was complemented with published sources and additional sampling of unrepresented groups. Nodes are species, or life stages of species with complex life cycles (e.g. the parthenitae, cercariae, metacercariae and adults of trematodes, or the larvae and adults of polychaetes and bivalves, each of which is a separate node), as well as some aggregated assemblages (e.g. phytoplankton, benthic diatoms, meiofauna) and non-living resources (detritus, carrion). A directed edge goes from a consumer to its resource (prey or host). The links include 21 possible types of interaction (13 of which occur in the data), covering four general kinds of interaction: predators consuming prey, parasites consuming hosts, predators consuming parasites, and parasites consuming parasites. Note that some link types do not represent resource dependencies (e.g. "concurrent predation on symbionts", i.e. a predator consuming the parasites of its prey, "trophic transmission", "commensalism"), and may need to be excluded from some analyses. Free-living links were constructed by extending the earlier Carpinteria Salt Marsh web of Lafferty et al. (2006), which this one supplants (the earlier web is the network `food_web_lafferty` of the entry `iwdb`, and is also included in `gateway_foodwebs`): links were assumed to occur in the other estuaries when the nodes co-occur, and links of new nodes were modelled after similar nodes of the earlier web, and then modified based on the literature and observations; most parasite links were directly observed. Some groups are missing or under-represented, such as plant parasites, bird and fish ectoparasites, flying insects, protists, viruses, fungi and bacteria.
+
+The entry contains four networks:
+
+- `metaweb`: the "metaweb" compiled from the nodes of all three estuaries (500 nodes, belonging to 314 species), with all 11,270 links projected to occur given the co-occurrence of the nodes. Of these, 9,247 are present in at least one of the estuaries, and the remaining 2,023 are hypothetical links between nodes that do not co-occur in any of the estuaries.
+- `carpinteria`: the web of Carpinteria Salt Marsh.
+- `punta_banda`: the web of Estero de Punta Banda.
+- `bahia_falsa`: the web of Bahía Falsa in Bahía San Quintín.
+
+The estuary webs are the subsets of the metaweb present in each estuary. Versions of the three estuary webs aggregated by species (with the life stages of each parasite merged into a single node, and fewer node attributes) are in the entry `coastal_parasite_webs`. The node "roots" (belowground biomass of the terrestrial plants) has no links, but is included because of its biomass. There are two self-loops (cannibalism) in the metaweb.
+
+Node properties (all networks):
+
+- `node_id`: the node identifier in the source, consistent across all four networks.
+- `species_id`: the species identifier, shared by the nodes corresponding to different life stages of the same species; `stage_id`: the life stage within the species, where 1 is the adult, and higher numbers are younger stages (with a meaning that depends on the group, e.g. for trematodes 2 = parthenitae); `stage`: the name of the life stage ("adult", "larva", "pupa", "cercaria", "metacercaria", "parthenitae", "procercoid", "plerocercoid", or empty for non-living nodes).
+- `name`: the working name of the node (common name, scientific name or descriptive name).
+- `organismal_group`: a broad group of organisms (e.g. "trematode", "bird", "fish", "snail", "plant", "detritus").
+- `node_type`: what the node represents ("taxon", "life stage" or "detritus").
+- `resolution`: the lowest taxonomic level that the node represents (e.g. "Species", "Genus", "Family", "assemblage"); `resolution_notes`: notes on the resolution.
+- `feeding`: whether the node is "feeding", "nonfeeding" (e.g. detritus and non-feeding life stages, such as cercariae) or an "autotroph".
+- `lifestyle_stage` and `lifestyle_species`: whether the life stage, or the species as a whole, is "free-living", "infectious", "commensal" or "non-living".
+- `consumer_strategy`: the consumer strategy of the life stage ("predator", "micropredator", "macroparasite", "parasitic castrator", "pathogen", "parasitoid", "trophically transmitted parasite", "detritivore", "autotroph", "nonfeeding", or empty for non-living nodes).
+- `mobility`: the short-term mobility of the free-living nodes ("low", "intermediate" or "high"; empty if not given).
+- `kingdom`, `phylum`, `subphylum`, `class`, `subclass`, `order`, `suborder`, `family`, `genus`, `specific_epithet`: the taxonomy of the node (empty if not given).
+- `notes`: notes on the node.
+
+Node properties (`metaweb` only):
+
+- `in_csm`, `in_epb`, `in_bsq`: whether the node is present in the respective estuary.
+
+Node properties (estuary webs only, specific to the estuary; numeric values are NaN when not given):
+
+- `residency`: the long-term residency of the free-living nodes ("resident" or "migrant"; empty if not given).
+- `body_size`: the mean body mass of an individual, in grams of wet weight (including hard parts, such as shells); `body_size_sd`: its standard deviation; `body_size_n`: the number of individuals measured; `body_size_estimation`: the method used to estimate the body size ("population": from the individuals sampled in the estuary; "species": from the literature, voucher specimens or volumetric estimates; "approximation": approximated from the body size of other nodes); `body_size_notes`: notes on the estimate.
+- `abundance`: the mean density of individuals (number per hectare); `abundance_cl`: its 95% confidence limit, as given in the source; `abundance_df`: the degrees of freedom of the confidence limit (fractional, due to the stratified sampling).
+- `biomass`: the mean biomass density, in kg (wet weight) per hectare; `biomass_cl`: its 95% confidence limit; `biomass_df`: the degrees of freedom of the confidence limit; `biomass_estimation`: the method used to estimate the biomass (e.g. "quantification, estuary-wide sampling", "quantified apportionment", "approximation, ratio", "field experience"; see Table 2B of the metadata of the source); `biomass_notes`: notes on the estimate.
+
+Edge properties (all networks):
+
+- `link_type`: the type of interaction, one of "predation", "micropredation", "parasitic castration", "pathogen infection", "macroparasitism", "parasitoid infection", "commensalism", "trophically transmitted parasitism", "concurrent predation on symbionts", "trophic transmission", "predation on free-living non-feeding stage", "detritivory" and "parasite intraguild antagonism" (see Table 3C of the metadata of the source for definitions); `link_type_id`: the corresponding numeric code of the source.
+- `present_csm`, `present_epb`, `present_bsq`: whether the link is present in the respective estuary (in the estuary webs, these indicate whether the link is also present in the other estuaries).
+
+Edge properties (`metaweb` only):
+
+- `present_any`: whether the link is present in at least one of the estuaries.
+
+Edge properties (estuary webs only):
+
+- `evidence`: the evidence for the link ("observed": directly observed in the field, in gut contents or in parasitological examinations; "inferred": observed at other localities or in experiments, or based on expert opinion; "modeled": modelled after the interactions of similar species; "speculated": inferred from general knowledge of the taxon; empty if not given); `evidence_notes`: notes on the evidence.
+
+According to the source, the data are freely available for non-commercial scientific use, given the appropriate citation."""
+tags = ['Biological', 'Food web', 'Unweighted', 'Metadata']
+url = 'https://esapubs.org/archive/ecol/E092/066/default.htm'
+citation = [('R. F. Hechinger, K. D. Lafferty, J. P. McLaughlin, B. L. Fredensborg, T. C. Huspeni, J. Lorda, P. K. Sandhu, J. C. Shaw, M. E. Torchin, K. L. Whitney, A. M. Kuris, "Food webs including parasites, biomass, body sizes, and life stages for three California/Baja California estuaries." Ecology 92(3), 791 (2011)', 'https://doi.org/10.1890/10-1383.1')]
+icon_hash = None
+upstream_license = None
+upstream_prefix = 'https://esapubs.org/archive/ecol/E092/066'
+files = [(('All_Data_Files.zip:Metaweb_Nodes.txt',
+           'All_Data_Files.zip:Metaweb_Links.txt'), 'metaweb', None),
+         (('All_Data_Files.zip:CSMweb_Nodes.txt',
+           'All_Data_Files.zip:CSMweb_Links.txt'), 'carpinteria', None),
+         (('All_Data_Files.zip:EPBweb_Nodes.txt',
+           'All_Data_Files.zip:EPBweb_Links.txt'), 'punta_banda', None),
+         (('All_Data_Files.zip:BSQweb_Nodes.txt',
+           'All_Data_Files.zip:BSQweb_Links.txt'), 'bahia_falsa', None)]
+
+# (property name, column header) of the node columns that do not depend on
+# the estuary (the columns that are empty in all files are omitted)
+node_cols = [("species_id", "SpeciesID"), ("stage_id", "StageID"),
+             ("stage", "Stage"), ("name", "WorkingName"),
+             ("organismal_group", "OrganismalGroup"), ("node_type", "NodeType"),
+             ("resolution", "Resolution"),
+             ("resolution_notes", "ResolutionNotes"), ("feeding", "Feeding"),
+             ("lifestyle_stage", "Lifestyle(stage)"),
+             ("lifestyle_species", "Lifestyle(species)"),
+             ("consumer_strategy", "ConsumerStrategy(stage)"),
+             ("mobility", "Mobility"), ("kingdom", "Kingdom"),
+             ("phylum", "Phylum"), ("subphylum", "Subphylum"),
+             ("class", "Class"), ("subclass", "Subclass"), ("order", "Order"),
+             ("suborder", "Suborder"), ("family", "Family"),
+             ("genus", "Genus"), ("specific_epithet", "SpecificEpithet"),
+             ("notes", "NodeNotes")]
+
+# node columns specific to each estuary
+system_cols = [("residency", "Residency"), ("body_size", "BodySize(g)"),
+               ("body_size_sd", "BodySizeSD"), ("body_size_n", "BodySizeN"),
+               ("body_size_estimation", "BodySizeEstimation"),
+               ("body_size_notes", "BodySizeNotes"),
+               ("abundance", "Abundance(no./ha)"),
+               ("abundance_cl", "Abundance95%CL"),
+               ("abundance_df", "AbundanceDF"),
+               ("biomass", "Biomass(kg/ha)"), ("biomass_cl", "Biomass95%CL"),
+               ("biomass_df", "BiomassDF"),
+               ("biomass_estimation", "BiomassEstimation"),
+               ("biomass_notes", "BiomassNotes")]
+
+int_cols = {"species_id", "stage_id"}
+float_cols = {"body_size", "body_size_sd", "body_size_n", "abundance",
+              "abundance_cl", "abundance_df", "biomass", "biomass_cl",
+              "biomass_df"}
+
+systems = ["CSM", "EPB", "BSQ"]
+
+def read_table(f):
+    # Some files are in UTF-16 (with a byte order mark), others in cp1252
+    data = f.read()
+    if data[:2] in (b"\xff\xfe", b"\xfe\xff"):
+        text = data.decode("utf-16")
+    else:
+        text = data.decode("cp1252")
+    rows = list(csv.reader(io.StringIO(text, newline=""), delimiter="\t"))
+    header = [c.strip() for c in rows[0]]
+    rows = [[x.strip() for x in r] for r in rows[1:]
+            if any(x.strip() for x in r)]
+    return {c: i for i, c in enumerate(header)}, rows
+
+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 fnames, alt, fmt in files:
+        if alts is not None and alt not in alts:
+            continue
+        with ExitStack() as stack:
+            fn, fl = [stack.enter_context(open_upstream_file(name, f, "rb"))
+                      for f in fnames]
+            col, rows = read_table(fn)
+            lcol, links = read_table(fl)
+
+        metaweb = alt == "metaweb"
+        cols = node_cols if metaweb else node_cols + system_cols
+
+        # In the metaweb, each node appears once for every estuary where it
+        # is present, with estuary-specific body sizes, biomasses and
+        # residencies; the remaining columns are the same for all estuaries
+        node_rows = {}
+        node_systems = {}
+        for r in rows:
+            nid = int(r[col["NodeID"]])
+            node_rows.setdefault(nid, r)
+            node_systems.setdefault(nid, set()).add(r[col["System"]])
+            if not metaweb and len(node_systems[nid]) > 1:
+                raise ValueError(f"node {nid} repeated in {fnames[0]}")
+
+        ids = sorted(node_rows.keys())
+        vidx = {nid: i for i, nid in enumerate(ids)}
+        g = Graph(len(ids), directed=True)
+
+        g.vp.node_id = g.new_vp("int")
+        for pname, c in cols:
+            if pname in int_cols:
+                ptype = "int"
+            elif pname in float_cols:
+                ptype = "double"
+            else:
+                ptype = "string"
+            g.vp[pname] = g.new_vp(ptype)
+        if metaweb:
+            for s in systems:
+                g.vp[f"in_{s.lower()}"] = g.new_vp("bool")
+
+        for nid in ids:
+            v = g.vertex(vidx[nid])
+            r = node_rows[nid]
+            g.vp.node_id[v] = nid
+            for pname, c in cols:
+                x = r[col[c]]
+                if pname in int_cols:
+                    g.vp[pname][v] = int(x)
+                elif pname in float_cols:
+                    g.vp[pname][v] = float(x) if x != "" else numpy.nan
+                else:
+                    g.vp[pname][v] = x
+            if metaweb:
+                for s in systems:
+                    g.vp[f"in_{s.lower()}"][v] = s in node_systems[nid]
+
+        g.ep.link_type = g.new_ep("string")
+        g.ep.link_type_id = g.new_ep("int")
+        present = [(f"present_{s.lower()}", f"PresentAt{s}") for s in systems]
+        if metaweb:
+            present.append(("present_any", "PresentAtAnyEstuary"))
+        else:
+            g.ep.evidence = g.new_ep("string")
+            g.ep.evidence_notes = g.new_ep("string")
+        for pname, c in present:
+            g.ep[pname] = g.new_ep("bool")
+
+        for r in links:
+            e = g.add_edge(vidx[int(r[lcol["ConsumerNodeID"]])],
+                           vidx[int(r[lcol["ResourceNodeID"]])])
+            g.ep.link_type[e] = r[lcol["LinkType"]]
+            g.ep.link_type_id[e] = int(r[lcol["LinkTypeID"]])
+            for pname, c in present:
+                g.ep[pname][e] = r[lcol[c]] == "1"
+            if not metaweb:
+                g.ep.evidence[e] = r[lcol["LinkEvidence"]]
+                g.ep.evidence_notes[e] = r[lcol["LinkEvidenceNotes"]]
+        yield alt, g