History of nematode_mammal
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 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/nematode_mammal/__init__.py b/entries/nematode_mammal/__init__.py
index 6501f35..a3235a9 100644
--- a/entries/nematode_mammal/__init__.py
+++ b/entries/nematode_mammal/__init__.py
@@ -33,7 +33,7 @@ The network has the following properties:
tags = ['Biological', 'Food web', 'Unweighted', 'Metadata']
url = 'https://github.com/cjcarlson/brevity/tree/master/Figure%201%20Demo%20Networks'
citation = [('T. Dallas et al. "Gauging support for macroecological patterns in helminth parasites." Glob. Ecol. Biogeogr. 27, 1437–1447 (2018)', 'https://doi.org/10.1111/geb.12819')]
-icon_hash = '5d0d28f751da6551647736a8'
+date_added = '2020-09-26'
upstream_license = None
upstream_prefix = 'https://raw.githubusercontent.com/cjcarlson/brevity/master/Figure%201%20Demo%20Networks'
files = [('helminths.csv', None, 'csv')]
[entries] Prefix the properties in the descriptions with (Node), (Edge) or (Graph) 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/nematode_mammal/__init__.py b/entries/nematode_mammal/__init__.py
index 1b40b97..6501f35 100644
--- a/entries/nematode_mammal/__init__.py
+++ b/entries/nematode_mammal/__init__.py
@@ -25,11 +25,11 @@ Nodes are host and parasite species (the network is bipartite), and an edge conn
The network has the following properties:
-- `name`: the species name of the host or parasite.
-- `is_host`: whether the node is a host (otherwise it is a parasite).
-- `group`: for parasites, the parasite group (Trematoda, Nematoda, Cestoda or Acanthocephala); for hosts, the host group (e.g. Teleostei, Aves, Mammalia, or NA if not available).
-- `full_name` (edges): the full name of the parasite with taxonomic authority, as given in the record (it can vary between records of the same parasite, e.g. for synonyms or subspecies).
-- `locality` (edges): the locality of the record."""
+- (Node) `name`: the species name of the host or parasite.
+- (Node) `is_host`: whether the node is a host (otherwise it is a parasite).
+- (Node) `group`: for parasites, the parasite group (Trematoda, Nematoda, Cestoda or Acanthocephala); for hosts, the host group (e.g. Teleostei, Aves, Mammalia, or NA if not available).
+- (Edge) `full_name`: the full name of the parasite with taxonomic authority, as given in the record (it can vary between records of the same parasite, e.g. for synonyms or subspecies).
+- (Edge) `locality`: the locality of the record."""
tags = ['Biological', 'Food web', 'Unweighted', 'Metadata']
url = 'https://github.com/cjcarlson/brevity/tree/master/Figure%201%20Demo%20Networks'
citation = [('T. Dallas et al. "Gauging support for macroecological patterns in helminth parasites." Glob. Ecol. Biogeogr. 27, 1437–1447 (2018)', 'https://doi.org/10.1111/geb.12819')]
[entries] Remove unneeded code from the entries 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/nematode_mammal/__init__.py b/entries/nematode_mammal/__init__.py
index 667da33..1b40b97 100644
--- a/entries/nematode_mammal/__init__.py
+++ b/entries/nematode_mammal/__init__.py
@@ -46,7 +46,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] Fix parse bugs and improve the metadata of existing entries c996a0e
From a review of the dataset descriptions against the upstream sources and papers, and from user reports: - parse fixes (wrong edge direction or directedness, shifted or misnamed properties, merged node identities, duplicated or missing edges and nodes, wrong types), e.g. arxiv_citation (the HepTh dates were a copy of the HepPh ones; now from the KDD Cup 2003 data), eu_procurements, foursquare_global, hiv_transmission, genetic_multiplex, gnutella (adds the 05 snapshot), roadnet, macaque_neural, python_dependency - descriptions rewritten from the upstream sources, documenting every property - corrected titles, citations and DOIs, licences (ustream_license typo, the data's own terms), tags and ICON ids - url lists for entries with several sources or dataset pages - SocioPatterns entries moved to the site's new data location, with the daily networks of sp_infectious and sp_primary_school - the Michael Fire entries marked as orphans (served from the mirror) - redundant type forcings removed after the graph-tool coercion fixes
diff --git a/entries/nematode_mammal/__init__.py b/entries/nematode_mammal/__init__.py
index bed17a9..667da33 100644
--- a/entries/nematode_mammal/__init__.py
+++ b/entries/nematode_mammal/__init__.py
@@ -18,14 +18,23 @@
from .. import *
-title = "Global nematode–mammal interactions (2018)"
-description = """A global interaction web of interactions between nematodes and their host mammal species, extracted from the helminthR package and dataset. Nodes are annotated with species-level information.[^icon]
-[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
+title = "Global helminth–host associations (NHM, 2018)"
+description = """Global network of host–parasite associations between helminth parasites and their host species, obtained with the R package helminthR (T. Dallas), which queries the Host-Parasite Database of the Natural History Museum, London, a compilation of host–parasite records from the published literature. The data were used by T. Dallas and collaborators to examine macroecological patterns in helminth parasites, and were distributed as a demonstration network by C. J. Carlson. The data are not restricted to nematodes and mammals (as the name of the dataset suggests): the parasites are trematodes, nematodes, cestodes and acanthocephalans, and the hosts include fish, birds, mammals, reptiles, amphibians and invertebrates.
+
+Nodes are host and parasite species (the network is bipartite), and an edge connects a host to a parasite recorded on it. Each edge corresponds to one record of the database, which lists the locality of the record, so a host–parasite pair recorded at several localities is connected by several parallel edges (the 146,683 edges connect 61,597 distinct pairs).
+
+The network has the following properties:
+
+- `name`: the species name of the host or parasite.
+- `is_host`: whether the node is a host (otherwise it is a parasite).
+- `group`: for parasites, the parasite group (Trematoda, Nematoda, Cestoda or Acanthocephala); for hosts, the host group (e.g. Teleostei, Aves, Mammalia, or NA if not available).
+- `full_name` (edges): the full name of the parasite with taxonomic authority, as given in the record (it can vary between records of the same parasite, e.g. for synonyms or subspecies).
+- `locality` (edges): the locality of the record."""
tags = ['Biological', 'Food web', 'Unweighted', 'Metadata']
url = 'https://github.com/cjcarlson/brevity/tree/master/Figure%201%20Demo%20Networks'
citation = [('T. Dallas et al. "Gauging support for macroecological patterns in helminth parasites." Glob. Ecol. Biogeogr. 27, 1437–1447 (2018)', 'https://doi.org/10.1111/geb.12819')]
icon_hash = '5d0d28f751da6551647736a8'
-ustream_license = None
+upstream_license = None
upstream_prefix = 'https://raw.githubusercontent.com/cjcarlson/brevity/master/Figure%201%20Demo%20Networks'
files = [('helminths.csv', None, 'csv')]
@@ -50,8 +59,8 @@ def parse(alts=None):
g = Graph(directed=False)
g.vp.name = g.new_vp("string")
- g.vp.full_name = g.new_vp("string")
- g.vp.locality = g.new_vp("string")
+ g.ep.full_name = g.new_ep("string")
+ g.ep.locality = g.new_ep("string")
g.vp.group = g.new_vp("string")
g.vp.is_host = g.new_vp("bool")
@@ -69,11 +78,13 @@ def parse(alts=None):
if t is None:
t = ps[row[2]] = g.add_vertex()
g.vp.name[t] = row[2]
- g.add_edge(s, t)
+ e = g.add_edge(s, t)
g.vp.is_host[s] = True
- g.vp.full_name[s] = row[3]
- g.vp.group[s] = row[4]
- g.vp.locality[s] = row[5]
- g.vp.group[t] = row[6]
+ g.ep.full_name[e] = row[3]
+ g.ep.locality[e] = row[5]
+ g.vp.group[t] = row[4]
+ # host group; one host is listed with both a group and NA
+ if g.vp.group[s] in ("", "NA"):
+ g.vp.group[s] = row[6]
yield alt, g
Update copyright information 73a4f0d
diff --git a/entries/nematode_mammal/__init__.py b/entries/nematode_mammal/__init__.py
index 37cf90c..bed17a9 100644
--- a/entries/nematode_mammal/__init__.py
+++ b/entries/nematode_mammal/__init__.py
@@ -1,7 +1,7 @@
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
-# Copyright (C) 2020-2024 Tiago de Paula Peixoto <tiago@skewed.de>
+# 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
Update copyright information 3d288ea
diff --git a/entries/nematode_mammal/__init__.py b/entries/nematode_mammal/__init__.py
index b5c0fdb..37cf90c 100644
--- a/entries/nematode_mammal/__init__.py
+++ b/entries/nematode_mammal/__init__.py
@@ -1,7 +1,7 @@
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
-# Copyright (C) 2020-2023 Tiago de Paula Peixoto <tiago@skewed.de>
+# Copyright (C) 2020-2024 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
Update copyright information 8d005ae
diff --git a/entries/nematode_mammal/__init__.py b/entries/nematode_mammal/__init__.py
index a19592d..b5c0fdb 100644
--- a/entries/nematode_mammal/__init__.py
+++ b/entries/nematode_mammal/__init__.py
@@ -1,7 +1,7 @@
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
-# Copyright (C) 2021 Tiago de Paula Peixoto <tiago@skewed.de>
+# Copyright (C) 2020-2023 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
Update copyright info db2efcc
diff --git a/entries/nematode_mammal/__init__.py b/entries/nematode_mammal/__init__.py
index e92956b..a19592d 100644
--- a/entries/nematode_mammal/__init__.py
+++ b/entries/nematode_mammal/__init__.py
@@ -1,7 +1,7 @@
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
-# Copyright (C) 2020 Tiago de Paula Peixoto <tiago@skewed.de>
+# Copyright (C) 2021 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
Update citations to use DOIs e878874
diff --git a/entries/nematode_mammal/__init__.py b/entries/nematode_mammal/__init__.py
index 09a5c5c..e92956b 100644
--- a/entries/nematode_mammal/__init__.py
+++ b/entries/nematode_mammal/__init__.py
@@ -23,7 +23,7 @@ description = """A global interaction web of interactions between nematodes and
[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
tags = ['Biological', 'Food web', 'Unweighted', 'Metadata']
url = 'https://github.com/cjcarlson/brevity/tree/master/Figure%201%20Demo%20Networks'
-citation = [('T. Dallas et al. "Gauging support for macroecological patterns in helminth parasites." Glob. Ecol. Biogeogr. 27, 1437–1447 (2018)', 'https://onlinelibrary.wiley.com/doi/full/10.1111/geb.12819')]
+citation = [('T. Dallas et al. "Gauging support for macroecological patterns in helminth parasites." Glob. Ecol. Biogeogr. 27, 1437–1447 (2018)', 'https://doi.org/10.1111/geb.12819')]
icon_hash = '5d0d28f751da6551647736a8'
ustream_license = None
upstream_prefix = 'https://raw.githubusercontent.com/cjcarlson/brevity/master/Figure%201%20Demo%20Networks'
Add nematode_mammal e04a83d
diff --git a/entries/nematode_mammal/__init__.py b/entries/nematode_mammal/__init__.py
new file mode 100644
index 0000000..09a5c5c
--- /dev/null
+++ b/entries/nematode_mammal/__init__.py
@@ -0,0 +1,79 @@
+#! /usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2020 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 = "Global nematode–mammal interactions (2018)"
+description = """A global interaction web of interactions between nematodes and their host mammal species, extracted from the helminthR package and dataset. Nodes are annotated with species-level information.[^icon]
+[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
+tags = ['Biological', 'Food web', 'Unweighted', 'Metadata']
+url = 'https://github.com/cjcarlson/brevity/tree/master/Figure%201%20Demo%20Networks'
+citation = [('T. Dallas et al. "Gauging support for macroecological patterns in helminth parasites." Glob. Ecol. Biogeogr. 27, 1437–1447 (2018)', 'https://onlinelibrary.wiley.com/doi/full/10.1111/geb.12819')]
+icon_hash = '5d0d28f751da6551647736a8'
+ustream_license = None
+upstream_prefix = 'https://raw.githubusercontent.com/cjcarlson/brevity/master/Figure%201%20Demo%20Networks'
+files = [('helminths.csv', None, 'csv')]
+
+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
+ if isinstance(fnames, str):
+ fnames = [fnames]
+ with ExitStack() as stack:
+ fs = [stack.enter_context(open_upstream_file(name, fn, "r", encoding="ISO-8859-1")) for fn in fnames]
+
+ g = Graph(directed=False)
+
+ g.vp.name = g.new_vp("string")
+ g.vp.full_name = g.new_vp("string")
+ g.vp.locality = g.new_vp("string")
+ g.vp.group = g.new_vp("string")
+ g.vp.is_host = g.new_vp("bool")
+
+ hs = {}
+ ps = {}
+ reader = csv.reader(fs[0])
+
+ next(reader)
+ for row in reader:
+ s = hs.get(row[1], None)
+ if s is None:
+ s = hs[row[1]] = g.add_vertex()
+ g.vp.name[s] = row[1]
+ t = ps.get(row[2], None)
+ if t is None:
+ t = ps[row[2]] = g.add_vertex()
+ g.vp.name[t] = row[2]
+ g.add_edge(s, t)
+ g.vp.is_host[s] = True
+ g.vp.full_name[s] = row[3]
+ g.vp.group[s] = row[4]
+ g.vp.locality[s] = row[5]
+ g.vp.group[t] = row[6]
+
+ yield alt, g