logo Netzschleuder network catalog, repository, and centrifuge

History of chad_dogs

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/chad_dogs/__init__.py b/entries/chad_dogs/__init__.py
index 4db7ea7..b7b774f 100644
--- a/entries/chad_dogs/__init__.py
+++ b/entries/chad_dogs/__init__.py
@@ -50,7 +50,7 @@ tags = ['Social', 'Animal', 'Offline', 'Weighted', 'Metadata']
 url = 'https://doi.org/10.5061/dryad.7v62484'
 citation = [('J. K. Wilson-Aggarwal, L. Ozella, M. Tizzoni, C. Cattuto, G. J. F. Swan, T. Moundai, M. J. Silk, J. A. Zingeser, R. A. McDonald, "High-resolution contact networks of free-ranging domestic dogs Canis familiaris and implications for transmission of infection." PLOS Neglected Tropical Diseases 13(7), e0007565 (2019)', 'https://doi.org/10.1371/journal.pntd.0007565'),
             ('J. K. Wilson-Aggarwal, L. Ozella, M. Tizzoni, C. Cattuto, G. J. F. Swan, T. Moundai, M. J. Silk, J. A. Zingeser, R. A. McDonald, "Data from: High-resolution contact networks of free-ranging domestic dogs Canis familiaris and implications for transmission of infection." Dryad (2019)', 'https://doi.org/10.5061/dryad.7v62484')]
-icon_hash = '5d371396f7b45cae7430a257'
+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/chad_dogs/__init__.py b/entries/chad_dogs/__init__.py
index 183be44..4db7ea7 100644
--- a/entries/chad_dogs/__init__.py
+++ b/entries/chad_dogs/__init__.py
@@ -75,7 +75,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/chad_dogs/__init__.py b/entries/chad_dogs/__init__.py
index 2c01f12..183be44 100644
--- a/entries/chad_dogs/__init__.py
+++ b/entries/chad_dogs/__init__.py
@@ -20,7 +20,7 @@ from openpyxl import load_workbook
 from .. import *
 
 title = "Free-ranging dog contact networks in rural Chad (2016)"
-description = """Contact networks of free-ranging domestic dogs (*Canis familiaris*) in two rural settlements along the Chari River, in the Guelendeng district of Chad, recorded between 24 June and 12 July 2016 by J. K. Wilson-Aggarwal and colleagues to study the transmission of infections such as rabies. Each settlement comprises two neighbouring villages: Kakale (Kakale-Mberi and Awine) and Magrao (Magrao and Sawata). All dogs were owned and associated with a household; with the consent of the owners, all dogs except puppies (younger than 6 months) were fitted with collars carrying a GPS unit and a wearable proximity sensor (of the OpenBeacon/SocioPatterns design), which exchanges low-power radio packets and detects close-range contacts (within about 1 to 1.5 m). Data from the first and last day of deployment in each village, as well as corrupted sensors and anomalous signals, were discarded.
+description = """Contact networks of free-ranging domestic dogs (*Canis familiaris*) in two rural settlements along the Chari River, in the Guelendeng district of Chad, recorded between 24 June and 12 July 2016 by J. K. Wilson-Aggarwal and colleagues to study the transmission of infections such as rabies. Each settlement comprises two neighboring villages: Kakale (Kakale-Mberi and Awine) and Magrao (Magrao and Sawata). All dogs were owned and associated with a household; with the consent of the owners, all dogs except puppies (younger than 6 months) were fitted with collars carrying a GPS unit and a wearable proximity sensor (of the OpenBeacon/SocioPatterns design), which exchanges low-power radio packets and detects close-range contacts (within about 1 to 1.5 m). Data from the first and last day of deployment in each village, as well as corrupted sensors and anomalous signals, were discarded.
 
 Nodes are dogs, and an undirected edge connects two dogs that were in contact at least once. Since the dogs were collared for different numbers of days, the edge weight is the average duration of contact per day: the total duration of the contacts between the two dogs (in seconds), divided by the shorter of the two monitoring periods (in days), and then $\\log_{10}$-transformed.
 
@@ -36,7 +36,7 @@ Node properties:
 - `household`: the household that owns the dog; `household_dogs`: the number of dogs owned by the household, as reported by the owner.
 - `sex`: "Male" or "Female".
 - `age_class`: the age class, from the age reported by the owner ("Juvenile": up to 12 months, "Subadult": 13 to 24 months, "Adult": older than 24 months, "NA": unknown).
-- `body_condition`: the body condition score, categorised as "Poor" (score at most 2) or "Moderate" (score at least 3), or "NA" if unknown.
+- `body_condition`: the body condition score, categorized as "Poor" (score at most 2) or "Moderate" (score at least 3), or "NA" if unknown.
 - `core_range`: the area of the core range (60% kernel density estimate of the GPS locations), in km$^2$ (NaN if unknown).
 - `total_range`: the area of the total range (99% minimum convex polygon of the GPS locations), in km$^2$ (NaN if unknown).
 
[entries] New entry: chad_dogs by Tiago de Paula Peixoto 057cc93
diff --git a/entries/chad_dogs/__init__.py b/entries/chad_dogs/__init__.py
new file mode 100644
index 0000000..2c01f12
--- /dev/null
+++ b/entries/chad_dogs/__init__.py
@@ -0,0 +1,137 @@
+#! /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 = "Free-ranging dog contact networks in rural Chad (2016)"
+description = """Contact networks of free-ranging domestic dogs (*Canis familiaris*) in two rural settlements along the Chari River, in the Guelendeng district of Chad, recorded between 24 June and 12 July 2016 by J. K. Wilson-Aggarwal and colleagues to study the transmission of infections such as rabies. Each settlement comprises two neighbouring villages: Kakale (Kakale-Mberi and Awine) and Magrao (Magrao and Sawata). All dogs were owned and associated with a household; with the consent of the owners, all dogs except puppies (younger than 6 months) were fitted with collars carrying a GPS unit and a wearable proximity sensor (of the OpenBeacon/SocioPatterns design), which exchanges low-power radio packets and detects close-range contacts (within about 1 to 1.5 m). Data from the first and last day of deployment in each village, as well as corrupted sensors and anomalous signals, were discarded.
+
+Nodes are dogs, and an undirected edge connects two dogs that were in contact at least once. Since the dogs were collared for different numbers of days, the edge weight is the average duration of contact per day: the total duration of the contacts between the two dogs (in seconds), divided by the shorter of the two monitoring periods (in days), and then $\\log_{10}$-transformed.
+
+The entry contains two networks:
+
+- `kakale`: the dogs of the Kakale settlement (48 dogs, 160 edges).
+- `magrao`: the dogs of the Magrao settlement (60 dogs, 191 edges).
+
+Node properties:
+
+- `name`: the dog identifier (the village code, the household number and a letter for the dog, e.g. "AW_02B").
+- `village`: the village ("Awine", "Kakale Mberi", "Magrao" or "Saouata").
+- `household`: the household that owns the dog; `household_dogs`: the number of dogs owned by the household, as reported by the owner.
+- `sex`: "Male" or "Female".
+- `age_class`: the age class, from the age reported by the owner ("Juvenile": up to 12 months, "Subadult": 13 to 24 months, "Adult": older than 24 months, "NA": unknown).
+- `body_condition`: the body condition score, categorised as "Poor" (score at most 2) or "Moderate" (score at least 3), or "NA" if unknown.
+- `core_range`: the area of the core range (60% kernel density estimate of the GPS locations), in km$^2$ (NaN if unknown).
+- `total_range`: the area of the total range (99% minimum convex polygon of the GPS locations), in km$^2$ (NaN if unknown).
+
+Edge properties:
+
+- `weight`: $\\log_{10}$ of the average contact duration per day, in seconds (as given in the source).
+- `duration`: the average contact duration per day, in seconds ($10^{\\text{weight}}$).
+
+The source also provides the distances between the households of each settlement, which are not included."""
+tags = ['Social', 'Animal', 'Offline', 'Weighted', 'Metadata']
+url = 'https://doi.org/10.5061/dryad.7v62484'
+citation = [('J. K. Wilson-Aggarwal, L. Ozella, M. Tizzoni, C. Cattuto, G. J. F. Swan, T. Moundai, M. J. Silk, J. A. Zingeser, R. A. McDonald, "High-resolution contact networks of free-ranging domestic dogs Canis familiaris and implications for transmission of infection." PLOS Neglected Tropical Diseases 13(7), e0007565 (2019)', 'https://doi.org/10.1371/journal.pntd.0007565'),
+            ('J. K. Wilson-Aggarwal, L. Ozella, M. Tizzoni, C. Cattuto, G. J. F. Swan, T. Moundai, M. J. Silk, J. A. Zingeser, R. A. McDonald, "Data from: High-resolution contact networks of free-ranging domestic dogs Canis familiaris and implications for transmission of infection." Dryad (2019)', 'https://doi.org/10.5061/dryad.7v62484')]
+icon_hash = '5d371396f7b45cae7430a257'
+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/28911'
+files = [('download:zip:Wilson-Aggarwal Dog networks data.xlsx', 'kakale', None),
+         ('download:zip:Wilson-Aggarwal Dog networks data.xlsx', 'magrao', None)]
+
+sheets = {"kakale": ("Kakale", "Kakale_contactNetwork"),
+          "magrao": ("Magrao", "Magrao_contactNetwork")}
+
+def to_float(x):
+    try:
+        return float(x)
+    except (TypeError, ValueError):
+        return numpy.nan
+
+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
+
+        settlement, sheet = sheets[alt]
+        with open_upstream_file(name, fname, "rb", seekable=True) as f:
+            wb = load_workbook(f, read_only=True)
+            meta = list(wb["Meta"].iter_rows(values_only=True))
+            rows = list(wb[sheet].iter_rows(values_only=True))
+            wb.close()
+        assert meta[0] == ('Settlement', 'Village', 'Household', 'No.dogs',
+                           'DogID', 'Sex', 'AgeClass', 'BCS', 'KDE.60', 'MCP')
+        meta = {r[4]: r for r in meta[1:] if r[0] == settlement}
+
+        # symmetric matrix; the header row lists the dog ids (without a
+        # leading empty cell), and each row starts with the dog id
+        ids = [x for x in rows[0] if x is not None]
+        rows = rows[1:]
+        assert [r[0] for r in rows] == ids
+        assert set(ids) == set(meta.keys())
+
+        g = Graph(directed=False)
+        g.add_vertex(len(ids))
+        g.vp.name = g.new_vp("string")
+        g.vp.village = g.new_vp("string")
+        g.vp.household = g.new_vp("string")
+        g.vp.household_dogs = g.new_vp("int")
+        g.vp.sex = g.new_vp("string")
+        g.vp.age_class = g.new_vp("string")
+        g.vp.body_condition = g.new_vp("string")
+        g.vp.core_range = g.new_vp("double")
+        g.vp.total_range = g.new_vp("double")
+        for i, dog in enumerate(ids):
+            r = meta[dog]
+            v = g.vertex(i)
+            g.vp.name[v] = dog
+            g.vp.village[v] = r[1]
+            g.vp.household[v] = r[2]
+            g.vp.household_dogs[v] = int(r[3])
+            g.vp.sex[v] = r[5]
+            g.vp.age_class[v] = r[6]
+            g.vp.body_condition[v] = r[7]
+            g.vp.core_range[v] = to_float(r[8])
+            g.vp.total_range[v] = to_float(r[9])
+
+        g.ep.weight = g.new_ep("double")
+        g.ep.duration = g.new_ep("double")
+        for i, r in enumerate(rows):
+            for j in range(i + 1, len(ids)):
+                w = float(r[j + 1])
+                assert w == float(rows[j][i + 1])
+                if w == 0:
+                    continue
+                e = g.add_edge(i, j)
+                g.ep.weight[e] = w
+                g.ep.duration[e] = 10 ** w
+
+        yield alt, g