logo Netzschleuder network catalog, repository, and centrifuge

History of reef_fish_atlantic

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/reef_fish_atlantic/__init__.py b/entries/reef_fish_atlantic/__init__.py
index b3db97f..478602e 100644
--- a/entries/reef_fish_atlantic/__init__.py
+++ b/entries/reef_fish_atlantic/__init__.py
@@ -39,7 +39,7 @@ citation = [('S. R. Floeter, W. Krohling, J. L. Gasparini, C. E. L. Ferreira, I.
             ('D. Mouillot et al., "Functional over-redundancy and high functional vulnerability in global fish faunas on tropical reefs." Proceedings of the National Academy of Sciences 111, 13757-13762 (2014)', 'https://doi.org/10.1073/pnas.1317625111'),
             ('A. P. Allen, J. F. Gillooly, J. H. Brown, "Linking the global carbon cycle to individual metabolism." Functional Ecology 19, 202-213 (2005)', 'https://doi.org/10.1111/j.1365-2435.2005.00952.x'),
             ('M. Cantor, M. M. Pires, F. M. D. Marquitti, R. L. G. Raimundo, E. Sebastián-González, P. P. Coltri, S. I. Perez, D. R. Barneche, D. Y. C. Brandt, K. Nunes, F. G. Daura-Jorge, S. R. Floeter, P. R. Guimarães Jr., "Nestedness across biological scales." PLoS ONE 12(2), e0171691 (2017)', 'https://doi.org/10.1371/journal.pone.0171691')]
-icon_hash = None
+date_added = '2026-10-25'
 upstream_license = None
 upstream_prefix = 'https://bitbucket.org/maucantor/unodf_analyses/raw/cef0977496fcb93ec72d20d8c37f0dd46b9f18be/data'
 files = [('met_gen_scmass.txt', 'genera', None),
[entries] Prefix the properties in the descriptions with (Node), (Edge) or (Graph) by Tiago de Paula Peixoto bc3dbbd
The lists of properties at the end of the descriptions marked edge
properties with "Edge" but left node properties unmarked, or grouped
them in "Nodes: `a`, ...; `b`, ..." items, so the kind of a property
was often unclear. Every item now starts with (Node), (Edge) or (Graph),
followed by the property names, a colon and the explanation, one item
per property or group of properties; qualifications (kinds of nodes,
networks) follow the names in parentheses. Properties that were only
named got a short explanation, and a few items that named the wrong
kind of property were corrected.
diff --git a/entries/reef_fish_atlantic/__init__.py b/entries/reef_fish_atlantic/__init__.py
index b6adf55..b3db97f 100644
--- a/entries/reef_fish_atlantic/__init__.py
+++ b/entries/reef_fish_atlantic/__init__.py
@@ -29,8 +29,9 @@ A node is either a site (community) or a group of fishes, and an edge connects a
 
 The networks have the following properties:
 
-- Nodes: `is_site`, whether the node is a site (otherwise it is a group of fishes); `name`, the name of the site (e.g. "abrolhos", "florida_keys") or of the group: the genus name in `genera`, or the functional group code of the source in the other networks (traits separated by underscores, e.g. "1_c2" or "1_c2_1_3", with codes not explained in the source).
-- Edges: `weight`, the size-corrected biomass of the group in the site."""
+- (Node) `is_site`: whether the node is a site (otherwise it is a group of fishes).
+- (Node) `name`: the name of the site (e.g. "abrolhos", "florida_keys") or of the group: the genus name in `genera`, or the functional group code of the source in the other networks (traits separated by underscores, e.g. "1_c2" or "1_c2_1_3", with codes not explained in the source).
+- (Edge) `weight`: the size-corrected biomass of the group in the site."""
 tags = ['Biological', 'Weighted', 'Metadata']
 url = 'https://bitbucket.org/maucantor/unodf_analyses'
 citation = [('S. R. Floeter, W. Krohling, J. L. Gasparini, C. E. L. Ferreira, I. R. Zalmon, "Reef fish community structure on coastal islands of the southeastern Brazil: the influence of exposure and benthic cover." Environmental Biology of Fishes 78, 147-160 (2007)', 'https://doi.org/10.1007/s10641-006-9084-6'),
[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/reef_fish_atlantic/__init__.py b/entries/reef_fish_atlantic/__init__.py
index 165ed82..b6adf55 100644
--- a/entries/reef_fish_atlantic/__init__.py
+++ b/entries/reef_fish_atlantic/__init__.py
@@ -53,7 +53,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] New entry: reef_fish_atlantic by Tiago de Paula Peixoto 5416a64
diff --git a/entries/reef_fish_atlantic/__init__.py b/entries/reef_fish_atlantic/__init__.py
new file mode 100644
index 0000000..165ed82
--- /dev/null
+++ b/entries/reef_fish_atlantic/__init__.py
@@ -0,0 +1,81 @@
+#! /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 .. import *
+
+title = 'Western Atlantic reef fish communities (2014)'
+description = """Weighted bipartite networks of the occurrence of reef fish groups in 24 reef communities along the Western Atlantic (2 in the North-western Atlantic, 5 in the Caribbean and 17 in the South-western Atlantic, mostly along the Brazilian coast and oceanic islands), from the reef-fish community database of S. R. Floeter, D. R. Barneche and collaborators. Fishes were surveyed by underwater visual census in strip transects (20 m x 2 m) on shallow reefs (depth < 20 m), where all individuals (536,378 in total) were counted, their total length estimated in 10-cm bins, and identified to species. The data were compiled by M. Cantor and collaborators for a study of nestedness across levels of biological organization, and are distributed in the repository of that study (files `met_gen_scmass.txt`, `met_sd_scmass.txt` and `met_sdms_scmass.txt`). The species are grouped either taxonomically or into functional groups (combinations of traits, following D. Mouillot and collaborators):
+
+- `genera`: 161 genera.
+- `diet_size`: 40 functional groups combining diet and body size class.
+- `diet_size_mobility_school`: 122 functional groups combining diet, body size class, mobility and school size.
+
+A node is either a site (community) or a group of fishes, and an edge connects a group to a site where it was recorded, weighted by its abundance in the site measured by size-corrected body mass (following A. P. Allen and collaborators, as in the study of Barneche et al.), which accounts for the biological turnover among individuals of different mass and for differences in size structure among communities. The units are not stated in the source. (Cantor et al. projected these matrices onto the fish groups using the Bray-Curtis similarity of their abundances across sites.)
+
+The networks have the following properties:
+
+- Nodes: `is_site`, whether the node is a site (otherwise it is a group of fishes); `name`, the name of the site (e.g. "abrolhos", "florida_keys") or of the group: the genus name in `genera`, or the functional group code of the source in the other networks (traits separated by underscores, e.g. "1_c2" or "1_c2_1_3", with codes not explained in the source).
+- Edges: `weight`, the size-corrected biomass of the group in the site."""
+tags = ['Biological', 'Weighted', 'Metadata']
+url = 'https://bitbucket.org/maucantor/unodf_analyses'
+citation = [('S. R. Floeter, W. Krohling, J. L. Gasparini, C. E. L. Ferreira, I. R. Zalmon, "Reef fish community structure on coastal islands of the southeastern Brazil: the influence of exposure and benthic cover." Environmental Biology of Fishes 78, 147-160 (2007)', 'https://doi.org/10.1007/s10641-006-9084-6'),
+            ('D. R. Barneche, M. Kulbicki, S. R. Floeter, A. M. Friedlander, J. Maina, A. P. Allen, "Scaling metabolism from individuals to reef-fish communities at broad spatial scales." Ecology Letters 17, 1067-1076 (2014)', 'https://doi.org/10.1111/ele.12309'),
+            ('D. Mouillot et al., "Functional over-redundancy and high functional vulnerability in global fish faunas on tropical reefs." Proceedings of the National Academy of Sciences 111, 13757-13762 (2014)', 'https://doi.org/10.1073/pnas.1317625111'),
+            ('A. P. Allen, J. F. Gillooly, J. H. Brown, "Linking the global carbon cycle to individual metabolism." Functional Ecology 19, 202-213 (2005)', 'https://doi.org/10.1111/j.1365-2435.2005.00952.x'),
+            ('M. Cantor, M. M. Pires, F. M. D. Marquitti, R. L. G. Raimundo, E. Sebastián-González, P. P. Coltri, S. I. Perez, D. R. Barneche, D. Y. C. Brandt, K. Nunes, F. G. Daura-Jorge, S. R. Floeter, P. R. Guimarães Jr., "Nestedness across biological scales." PLoS ONE 12(2), e0171691 (2017)', 'https://doi.org/10.1371/journal.pone.0171691')]
+icon_hash = None
+upstream_license = None
+upstream_prefix = 'https://bitbucket.org/maucantor/unodf_analyses/raw/cef0977496fcb93ec72d20d8c37f0dd46b9f18be/data'
+files = [('met_gen_scmass.txt', 'genera', None),
+         ('met_sd_scmass.txt', 'diet_size', None),
+         ('met_sdms_scmass.txt', 'diet_size_mobility_school', None)]
+
+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
+        with open_upstream_file(name, fname, "r") as f:
+            rows = [line.rstrip("\r\n").split("\t") for line in f
+                    if line.strip()]
+        sites = rows[0][1:]
+        groups = [r[0] for r in rows[1:]]
+        A = numpy.array([[float(x) for x in r[1:]] for r in rows[1:]])
+        g = Graph(directed=False)
+        g.add_vertex(len(groups) + len(sites))
+        g.vp.is_site = g.new_vp("bool")
+        g.vp.name = g.new_vp("string")
+        for i, x in enumerate(groups):
+            g.vp.name[i] = x
+        for j, x in enumerate(sites):
+            v = len(groups) + j
+            g.vp.is_site[v] = True
+            g.vp.name[v] = x
+        i, j = numpy.nonzero(A)
+        g.ep.weight = g.new_ep("double")
+        g.add_edge_list(numpy.column_stack((i, len(groups) + j, A[i, j])),
+                        eprops=[g.ep.weight])
+        yield alt, g