logo Netzschleuder network catalog, repository, and centrifuge

History of host_pathogen_eid2

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/host_pathogen_eid2/__init__.py b/entries/host_pathogen_eid2/__init__.py
index 6c2f409..0f88642 100644
--- a/entries/host_pathogen_eid2/__init__.py
+++ b/entries/host_pathogen_eid2/__init__.py
@@ -36,7 +36,7 @@ The networks have the following properties:
 tags = ['Biological', 'Public Health', 'Weighted', 'Metadata', 'Multigraph']
 url = 'https://doi.org/10.1038/sdata.2015.49'
 citation = [('M. Wardeh, C. Risley, M. K. McIntyre, C. Setzkorn, M. Baylis, "Database of host-pathogen and related species interactions, and their global distribution." Scientific Data 2, 150049 (2015)', 'https://doi.org/10.1038/sdata.2015.49')]
-icon_hash = '56a85c8e26855e083a2f7950'
+date_added = '2026-10-25'
 upstream_license = ('Creative Commons Attribution 4.0 International (CC BY 4.0)', 'https://creativecommons.org/licenses/by/4.0/')
 upstream_prefix = 'https://ndownloader.figshare.com/files'
 # SpeciesInteractions_EID2.csv, LocationInteractions_EID2.csv
[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/host_pathogen_eid2/__init__.py b/entries/host_pathogen_eid2/__init__.py
index 59e68fb..6c2f409 100644
--- a/entries/host_pathogen_eid2/__init__.py
+++ b/entries/host_pathogen_eid2/__init__.py
@@ -26,10 +26,13 @@ description = """Networks of interactions between species, where one (the "cargo
 
 The networks have the following properties:
 
-- `species` nodes: `name`, the species name; `cargo_class` and `carrier_class`, the taxonomic classification of the species when it appears as a cargo (e.g. "Bacteria", "Virus", "Helminth") or as a carrier (e.g. "Human", "Domestic", "Mammal", "Higher Plants"), or empty if the species does not appear in that role. The carrier category "Domestic" comprises 46 species of domesticated mammals and birds in Europe, so that a few species have different cargo and carrier classifications.
-- `locations` nodes: `name`, the species or country name; `is_country`, whether the node is a country (otherwise a species); `classification`, the taxonomic classification of the species (empty for countries).
-- Edges (both networks): `sequences`, the number of nucleotide sequences supporting the interaction; `publications`, the number of PubMed publications supporting the interaction. The lists of sequence and publication identifiers in the source data are not included.
-- `locations` edges: `region`, the region of the country (empty if the record refers to the country as a whole)."""
+- (Node) `name`: in `species`, the species name; in `locations`, the species or country name.
+- (Node) `cargo_class`, `carrier_class` (`species`): the taxonomic classification of the species when it appears as a cargo (e.g. "Bacteria", "Virus", "Helminth") or as a carrier (e.g. "Human", "Domestic", "Mammal", "Higher Plants"), or empty if the species does not appear in that role. The carrier category "Domestic" comprises 46 species of domesticated mammals and birds in Europe, so that a few species have different cargo and carrier classifications.
+- (Node) `is_country` (`locations`): whether the node is a country (otherwise a species).
+- (Node) `classification` (`locations`): the taxonomic classification of the species (empty for countries).
+- (Edge) `sequences`: the number of nucleotide sequences supporting the interaction.
+- (Edge) `publications`: the number of PubMed publications supporting the interaction. The lists of sequence and publication identifiers in the source data are not included.
+- (Edge) `region` (`locations`): the region of the country (empty if the record refers to the country as a whole)."""
 tags = ['Biological', 'Public Health', 'Weighted', 'Metadata', 'Multigraph']
 url = 'https://doi.org/10.1038/sdata.2015.49'
 citation = [('M. Wardeh, C. Risley, M. K. McIntyre, C. Setzkorn, M. Baylis, "Database of host-pathogen and related species interactions, and their global distribution." Scientific Data 2, 150049 (2015)', 'https://doi.org/10.1038/sdata.2015.49')]
[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/host_pathogen_eid2/__init__.py b/entries/host_pathogen_eid2/__init__.py
index 937d5b1..59e68fb 100644
--- a/entries/host_pathogen_eid2/__init__.py
+++ b/entries/host_pathogen_eid2/__init__.py
@@ -48,7 +48,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] New entry: host_pathogen_eid2 by Tiago de Paula Peixoto 2e62b68
diff --git a/entries/host_pathogen_eid2/__init__.py b/entries/host_pathogen_eid2/__init__.py
new file mode 100644
index 0000000..937d5b1
--- /dev/null
+++ b/entries/host_pathogen_eid2/__init__.py
@@ -0,0 +1,98 @@
+#! /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 = "Host-pathogen interactions and pathogen locations (EID2, 1950-2012)"
+description = """Networks of interactions between species, where one (the "cargo") is likely to be a pathogen, parasite or other organism carried by the other (the "carrier", e.g. a host), and of the countries where species were found, from the ENHanCEd Infectious Diseases database (EID2) of Wardeh et al. The interactions were automatically extracted from the metadata of the NCBI Nucleotide sequence database (the organism of a sequence and its host) and from the PubMed literature database (publications mentioning both species, or a species and a location), based on evidence published between 1950 and 2012. Organism names were disambiguated with the NCBI Taxonomy database, and only organisms identified at the species or subspecies level are included; locations were disambiguated using GeoNames. The datasets were extracted from EID2 in 2015.
+
+- `species`: directed network of species, where an edge goes from a cargo species to a carrier species. A species may appear both as a cargo and a carrier. A few cargo-carrier pairs appear more than once in the data, and are kept as parallel edges.
+- `locations`: bipartite network of species and countries, where an edge connects a species to a country where it was found. Some records refer to a region (first-level administrative division) of the country, in which case it is stored as an edge property, so that a species and country can be connected by more than one edge.
+
+The networks have the following properties:
+
+- `species` nodes: `name`, the species name; `cargo_class` and `carrier_class`, the taxonomic classification of the species when it appears as a cargo (e.g. "Bacteria", "Virus", "Helminth") or as a carrier (e.g. "Human", "Domestic", "Mammal", "Higher Plants"), or empty if the species does not appear in that role. The carrier category "Domestic" comprises 46 species of domesticated mammals and birds in Europe, so that a few species have different cargo and carrier classifications.
+- `locations` nodes: `name`, the species or country name; `is_country`, whether the node is a country (otherwise a species); `classification`, the taxonomic classification of the species (empty for countries).
+- Edges (both networks): `sequences`, the number of nucleotide sequences supporting the interaction; `publications`, the number of PubMed publications supporting the interaction. The lists of sequence and publication identifiers in the source data are not included.
+- `locations` edges: `region`, the region of the country (empty if the record refers to the country as a whole)."""
+tags = ['Biological', 'Public Health', 'Weighted', 'Metadata', 'Multigraph']
+url = 'https://doi.org/10.1038/sdata.2015.49'
+citation = [('M. Wardeh, C. Risley, M. K. McIntyre, C. Setzkorn, M. Baylis, "Database of host-pathogen and related species interactions, and their global distribution." Scientific Data 2, 150049 (2015)', 'https://doi.org/10.1038/sdata.2015.49')]
+icon_hash = '56a85c8e26855e083a2f7950'
+upstream_license = ('Creative Commons Attribution 4.0 International (CC BY 4.0)', 'https://creativecommons.org/licenses/by/4.0/')
+upstream_prefix = 'https://ndownloader.figshare.com/files'
+# SpeciesInteractions_EID2.csv, LocationInteractions_EID2.csv
+files = [('2196534', 'species', None),
+         ('2081622', 'locations', 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 fnames, alt, fmt in files:
+        if alts is not None and alt not in alts:
+            continue
+        with open_upstream_file(name, fnames, "r") as f:
+            rows = list(csv.DictReader(f))
+        if alt == "species":
+            g = Graph(directed=True)
+            g.ep.sequences = g.new_ep("int")
+            g.ep.publications = g.new_ep("int")
+            g.vp.name = g.add_edge_list([(r["Cargo"], r["Carrier"],
+                                          int(r["Sequences count"]),
+                                          int(r["Publications count"]))
+                                         for r in rows], hashed=True,
+                                        hash_type="string",
+                                        eprops=[g.ep.sequences, g.ep.publications])
+            vs = {g.vp.name[v]: v for v in g.vertices()}
+            g.vp.cargo_class = g.new_vp("string")
+            g.vp.carrier_class = g.new_vp("string")
+            for r in rows:
+                g.vp.cargo_class[vs[r["Cargo"]]] = r["Cargo classification"]
+                g.vp.carrier_class[vs[r["Carrier"]]] = r["Carrier classification"]
+        else:
+            g = Graph(directed=False)
+            g.vp.name = g.new_vp("string")
+            g.vp.is_country = g.new_vp("bool")
+            g.vp.classification = g.new_vp("string")
+            g.ep.sequences = g.new_ep("int")
+            g.ep.publications = g.new_ep("int")
+            g.ep.region = g.new_ep("string")
+            vs = {}
+            def get_v(n, is_country):
+                v = vs.get((n, is_country))
+                if v is None:
+                    v = vs[(n, is_country)] = g.add_vertex()
+                    g.vp.name[v] = n
+                    g.vp.is_country[v] = is_country
+                return v
+            for r in rows:
+                s = get_v(r["Species"], False)
+                g.vp.classification[s] = r["Species classification"]
+                c = get_v(r["Country"], True)
+                e = g.add_edge(s, c)
+                g.ep.sequences[e] = int(r["Sequences count"])
+                g.ep.publications[e] = int(r["Publications count"])
+                g.ep.region[e] = r["Region"]
+        yield alt, g