History of messal_shale
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] 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/messal_shale/__init__.py b/entries/messal_shale/__init__.py
index d2b6362..07e0a18 100644
--- a/entries/messal_shale/__init__.py
+++ b/entries/messal_shale/__init__.py
@@ -23,14 +23,23 @@ import tempfile
from .. import *
title = "Messel Shale food web (2014)"
-description = """A network of feeling links among taxa based on the 48 million years old uppermost early Eocene Messel Shale. Edge property 'certainty' denotes the certainty of the edge. Metadata include evidence, habitat, and trophic roles. The edge direction goes from consumer to resource.[^icon]
-[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
+description = """Food web of the early Eocene Messel Shale (Germany), a fossil site about 48 million years old that preserves the lake and surrounding forest ecosystem of the time, compiled by J. A. Dunne, C. C. Labandeira and R. J. Williams. Nodes are taxa (plants, animals, fungi, bacteria) and non-living resources (detritus and dead animal material), and a directed edge points from a consumer to the resource it feeds on. Feeding links were inferred from several lines of evidence, such as gut contents, coprolites, damage patterns on plants, functional morphology, body size, and the diets of the closest living relatives (taxonomic uniformity), and each link was assigned a level of certainty.
+
+The network has the following properties:
+
+- `name`: the name of the taxon or resource.
+- `group`: the higher-level taxonomic group of the taxon (usually its order, as in "Coleoptera").
+- `certainty`: the certainty of the feeding link, with 1 = high, 2 = intermediate, 3 = low (see the graph property `certainty_key`).
+- `evidence`: the list of types of evidence supporting the link, with codes 1 = taxonomic uniformity, 2 = functional morphology, 3 = gut contents, 4 = damage pattern, 5 = stratigraphic co-occurrence, 6 = body size, 7 = coprolites, 8 = host relationship, 9 = biochemistry and minerals, 10 = track or domicile (see the graph property `evidence_key`).
+- `references`: the list of literature references supporting the link, as indices into the graph property `reference_key`."""
tags = ['Biological', 'Food web', 'Uncertain', 'Weighted', 'Metadata']
url = 'http://datadryad.org/resource/doi:10.5061/dryad.ps0f0'
citation = [('J. A. Dunne, C. C. Labandeira, & R. J. Williams, "Highly resolved early Eocene food webs show development of modern trophic structure after the end-Cretaceous extinction." Proc. Royal Soc. B: Biological Sciences 281(1782), 20133280 (2014).', 'https://doi.org/10.1098/rspb.2013.3280')]
icon_hash = '59233f9062da63251188ee8f'
-upstream_prefix = 'https://datadryad.org/stash/downloads/download_resource'
-files = [('24767:zip:LabanderiaDunne2014DryadData.xls', None, None)]
+# Zip file of the dataset version (the individual file downloads require an
+# access token)
+upstream_prefix = 'https://datadryad.org/api/v2/versions/24767'
+files = [('download:zip:LabanderiaDunne2014DryadData.xls', None, None)]
def fetch_upstream(force=False):
return fetch_upstream_files(__name__.split(".")[-1], upstream_prefix, files,
@@ -90,10 +99,12 @@ def parse(alts=None):
for j, c in enumerate(["E", "F", "G", "H", "I", "J", "K", "L", "M", "N"]):
if links[f"{c}{i}"].value is not None:
g.ep.evidence[e].append(j+1)
- for j, c in enumerate(["P", "Q", "R", "S", "T", "U", "V", "X", "Z"]):
- if links[f"{c}{i}"].value is not None:
+ # supplementary references: columns P (16) onwards
+ for c in range(16, links.max_column + 1):
+ val = links.cell(i, c).value
+ if val is not None:
try:
- g.ep.references[e].append(int(links[f"{c}{i}"].value))
+ g.ep.references[e].append(int(val))
except ValueError:
print("dirt in upstream file...")
[entries] Fix the spelling of the "Political" and "Food web" tags 35244f5
at_migrations used "Politlcal", and messal_shale "Food Web". Fixes #12
diff --git a/entries/messal_shale/__init__.py b/entries/messal_shale/__init__.py
index 61e39ab..d2b6362 100644
--- a/entries/messal_shale/__init__.py
+++ b/entries/messal_shale/__init__.py
@@ -25,7 +25,7 @@ from .. import *
title = "Messel Shale food web (2014)"
description = """A network of feeling links among taxa based on the 48 million years old uppermost early Eocene Messel Shale. Edge property 'certainty' denotes the certainty of the edge. Metadata include evidence, habitat, and trophic roles. The edge direction goes from consumer to resource.[^icon]
[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
-tags = ['Biological', 'Food Web', 'Uncertain', 'Weighted', 'Metadata']
+tags = ['Biological', 'Food web', 'Uncertain', 'Weighted', 'Metadata']
url = 'http://datadryad.org/resource/doi:10.5061/dryad.ps0f0'
citation = [('J. A. Dunne, C. C. Labandeira, & R. J. Williams, "Highly resolved early Eocene food webs show development of modern trophic structure after the end-Cretaceous extinction." Proc. Royal Soc. B: Biological Sciences 281(1782), 20133280 (2014).', 'https://doi.org/10.1098/rspb.2013.3280')]
icon_hash = '59233f9062da63251188ee8f'
Update copyright information 73a4f0d
diff --git a/entries/messal_shale/__init__.py b/entries/messal_shale/__init__.py
index c425e52..61e39ab 100644
--- a/entries/messal_shale/__init__.py
+++ b/entries/messal_shale/__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/messal_shale/__init__.py b/entries/messal_shale/__init__.py
index 0b46ca5..c425e52 100644
--- a/entries/messal_shale/__init__.py
+++ b/entries/messal_shale/__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/messal_shale/__init__.py b/entries/messal_shale/__init__.py
index dbcd71a..0b46ca5 100644
--- a/entries/messal_shale/__init__.py
+++ b/entries/messal_shale/__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/messal_shale/__init__.py b/entries/messal_shale/__init__.py
index ab3e71b..dbcd71a 100644
--- a/entries/messal_shale/__init__.py
+++ b/entries/messal_shale/__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/messal_shale/__init__.py b/entries/messal_shale/__init__.py
index 155cbeb..ab3e71b 100644
--- a/entries/messal_shale/__init__.py
+++ b/entries/messal_shale/__init__.py
@@ -27,7 +27,7 @@ description = """A network of feeling links among taxa based on the 48 million y
[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
tags = ['Biological', 'Food Web', 'Uncertain', 'Weighted', 'Metadata']
url = 'http://datadryad.org/resource/doi:10.5061/dryad.ps0f0'
-citation = [('J. A. Dunne, C. C. Labandeira, & R. J. Williams, "Highly resolved early Eocene food webs show development of modern trophic structure after the end-Cretaceous extinction." Proc. Royal Soc. B: Biological Sciences 281(1782), 20133280 (2014).', 'http://rspb.royalsocietypublishing.org/content/281/1782/20133280')]
+citation = [('J. A. Dunne, C. C. Labandeira, & R. J. Williams, "Highly resolved early Eocene food webs show development of modern trophic structure after the end-Cretaceous extinction." Proc. Royal Soc. B: Biological Sciences 281(1782), 20133280 (2014).', 'https://doi.org/10.1098/rspb.2013.3280')]
icon_hash = '59233f9062da63251188ee8f'
upstream_prefix = 'https://datadryad.org/stash/downloads/download_resource'
files = [('24767:zip:LabanderiaDunne2014DryadData.xls', None, None)]
Change license from GPLv3 to AGPLv3 d754be5
diff --git a/entries/messal_shale/__init__.py b/entries/messal_shale/__init__.py
index 09d99a2..155cbeb 100644
--- a/entries/messal_shale/__init__.py
+++ b/entries/messal_shale/__init__.py
@@ -3,18 +3,18 @@
#
# 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 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 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 General Public License for more details.
+# 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 General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# 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
import shutil
Add explicit attribution to descriptions obtained from ICON 1645314
diff --git a/entries/messal_shale/__init__.py b/entries/messal_shale/__init__.py
index fa1138a..09d99a2 100644
--- a/entries/messal_shale/__init__.py
+++ b/entries/messal_shale/__init__.py
@@ -23,7 +23,8 @@ import tempfile
from .. import *
title = "Messel Shale food web (2014)"
-description = "A network of feeling links among taxa based on the 48 million years old uppermost early Eocene Messel Shale. Edge property 'certainty' denotes the certainty of the edge. Metadata include evidence, habitat, and trophic roles. The edge direction goes from consumer to resource."
+description = """A network of feeling links among taxa based on the 48 million years old uppermost early Eocene Messel Shale. Edge property 'certainty' denotes the certainty of the edge. Metadata include evidence, habitat, and trophic roles. The edge direction goes from consumer to resource.[^icon]
+[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
tags = ['Biological', 'Food Web', 'Uncertain', 'Weighted', 'Metadata']
url = 'http://datadryad.org/resource/doi:10.5061/dryad.ps0f0'
citation = [('J. A. Dunne, C. C. Labandeira, & R. J. Williams, "Highly resolved early Eocene food webs show development of modern trophic structure after the end-Cretaceous extinction." Proc. Royal Soc. B: Biological Sciences 281(1782), 20133280 (2014).', 'http://rspb.royalsocietypublishing.org/content/281/1782/20133280')]
Initial commit cc85872
diff --git a/entries/messal_shale/__init__.py b/entries/messal_shale/__init__.py
new file mode 100644
index 0000000..fa1138a
--- /dev/null
+++ b/entries/messal_shale/__init__.py
@@ -0,0 +1,99 @@
+#! /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 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+from openpyxl import load_workbook
+import shutil
+import subprocess
+import tempfile
+from .. import *
+
+title = "Messel Shale food web (2014)"
+description = "A network of feeling links among taxa based on the 48 million years old uppermost early Eocene Messel Shale. Edge property 'certainty' denotes the certainty of the edge. Metadata include evidence, habitat, and trophic roles. The edge direction goes from consumer to resource."
+tags = ['Biological', 'Food Web', 'Uncertain', 'Weighted', 'Metadata']
+url = 'http://datadryad.org/resource/doi:10.5061/dryad.ps0f0'
+citation = [('J. A. Dunne, C. C. Labandeira, & R. J. Williams, "Highly resolved early Eocene food webs show development of modern trophic structure after the end-Cretaceous extinction." Proc. Royal Soc. B: Biological Sciences 281(1782), 20133280 (2014).', 'http://rspb.royalsocietypublishing.org/content/281/1782/20133280')]
+icon_hash = '59233f9062da63251188ee8f'
+upstream_prefix = 'https://datadryad.org/stash/downloads/download_resource'
+files = [('24767:zip:LabanderiaDunne2014DryadData.xls', None, 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, "rb") as f:
+ with tempfile.TemporaryDirectory(dir="./cache/temp", suffix="messal_shale") as tdir:
+ with open(f"{tdir}/dump.xls", "wb") as fw:
+ shutil.copyfileobj(f, fw)
+ subprocess.run(["localc", "--convert-to", "xlsx",
+ f"dump.xls"], cwd=tdir, check=True)
+ wb = load_workbook(f"{tdir}/dump.xlsx")
+
+ g = Graph(directed=True)
+
+ g.vp.name = g.new_vp("string")
+ g.vp.group = g.new_vp("string")
+ g.ep.certainty = g.new_ep("int16_t")
+ g.ep.references = g.new_ep("vector<int16_t>")
+ g.ep.evidence = g.new_ep("vector<int16_t>")
+
+ g.gp.certainty_key = g.new_gp("object", val={})
+ g.gp.evidence_key = g.new_gp("object", val={})
+ g.gp.reference_key = g.new_gp("object", val={})
+
+ for i in range(7, 17):
+ g.gp.evidence_key[i-6] = wb["Keys"][f"B{i}"].value
+
+ for i in range(26, 29):
+ g.gp.certainty_key[i-25] = wb["Keys"][f"B{i}"].value
+
+ for i in range(3, 207):
+ g.gp.reference_key[i-2] = wb["References"][f"B{i}"].value
+
+ for i in range(4, 704):
+ v = g.add_vertex()
+ g.vp.group[v] = wb["Messel Taxa"][f"B{i}"].value
+ g.vp.name[v] = wb["Messel Taxa"][f"C{i}"].value
+
+ links = wb["Messel Links"]
+ for i in range(5, 6449):
+ s = int(links[f"A{i}"].value) - 1
+ t = int(links[f"B{i}"].value) - 1
+ e = g.add_edge(s, t)
+ g.ep.certainty[e] = int(links[f"C{i}"].value)
+
+ for j, c in enumerate(["E", "F", "G", "H", "I", "J", "K", "L", "M", "N"]):
+ if links[f"{c}{i}"].value is not None:
+ g.ep.evidence[e].append(j+1)
+ for j, c in enumerate(["P", "Q", "R", "S", "T", "U", "V", "X", "Z"]):
+ if links[f"{c}{i}"].value is not None:
+ try:
+ g.ep.references[e].append(int(links[f"{c}{i}"].value))
+ except ValueError:
+ print("dirt in upstream file...")
+
+ yield alt, g