History of musculoskeletal
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/musculoskeletal/__init__.py b/entries/musculoskeletal/__init__.py
index 95fb16f..26fb60a 100644
--- a/entries/musculoskeletal/__init__.py
+++ b/entries/musculoskeletal/__init__.py
@@ -36,7 +36,7 @@ tags = ['Biological', 'Unweighted', 'Metadata']
url = 'https://doi.org/10.5281/zenodo.1069104'
citation = [('A. C. Murphy, S. F. Muldoon, D. Baker, A. Lastowka, B. Bennett, M. Yang, D. S. Bassett, "Structure, function, and control of the human musculoskeletal network." PLoS Biology 16(1), e2002811 (2018)', 'https://doi.org/10.1371/journal.pbio.2002811'),
('A. C. Murphy, S. F. Muldoon, D. Baker, A. Lastowka, B. Bennett, M. Yang, D. S. Bassett, "Structure, function, and control of the musculoskeletal network - Data." Zenodo (2017)', 'https://doi.org/10.5281/zenodo.1069104')]
-icon_hash = '5bc6248e197c3f8a0271dafc'
+date_added = '2026-10-25'
upstream_license = ("Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)",
"https://creativecommons.org/licenses/by-sa/4.0/")
upstream_prefix = 'https://zenodo.org/api/records/1069104/files/supplementaryData.xlsx'
[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/musculoskeletal/__init__.py b/entries/musculoskeletal/__init__.py
index f2cf3f2..95fb16f 100644
--- a/entries/musculoskeletal/__init__.py
+++ b/entries/musculoskeletal/__init__.py
@@ -28,10 +28,10 @@ description = """Bipartite networks of the muscles and bones of the human body,
The nodes have the following properties:
-- `name`: the name of the muscle or bone.
-- `is_muscle`: whether the node is a muscle (otherwise it is a bone).
-- `community`: (muscles only, -1 for bones) the community of the muscle (1 to 22), found by the authors by modularity maximization (consensus of 100 runs, with resolution parameter 4.3) on the muscle-muscle network of the `hosford` data, in which two muscles are connected if they attach to the same bone.
-- `homunculus_category`: (muscles only, -1 for bones) the category of the motor homunculus (the map of the body in the primary motor cortex, following Penfield) to which the muscle was assigned (1 to 22), and `homunculus_region`: the name of this category (e.g. "Toes", "Knee", "Shoulder", "Jaw", "Swallowing")."""
+- (Node) `name`: the name of the muscle or bone.
+- (Node) `is_muscle`: whether the node is a muscle (otherwise it is a bone).
+- (Node) `community`: (muscles only, -1 for bones) the community of the muscle (1 to 22), found by the authors by modularity maximization (consensus of 100 runs, with resolution parameter 4.3) on the muscle-muscle network of the `hosford` data, in which two muscles are connected if they attach to the same bone.
+- (Node) `homunculus_category`: (muscles only, -1 for bones) the category of the motor homunculus (the map of the body in the primary motor cortex, following Penfield) to which the muscle was assigned (1 to 22), and `homunculus_region`: the name of this category (e.g. "Toes", "Knee", "Shoulder", "Jaw", "Swallowing")."""
tags = ['Biological', 'Unweighted', 'Metadata']
url = 'https://doi.org/10.5281/zenodo.1069104'
citation = [('A. C. Murphy, S. F. Muldoon, D. Baker, A. Lastowka, B. Bennett, M. Yang, D. S. Bassett, "Structure, function, and control of the human musculoskeletal network." PLoS Biology 16(1), e2002811 (2018)', 'https://doi.org/10.1371/journal.pbio.2002811'),
[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/musculoskeletal/__init__.py b/entries/musculoskeletal/__init__.py
index d20a947..f2cf3f2 100644
--- a/entries/musculoskeletal/__init__.py
+++ b/entries/musculoskeletal/__init__.py
@@ -51,7 +51,6 @@ def fetch_upstream(force=False):
@coerce_props()
@annotate()
def parse(alts=None):
- global files
name = __name__.split(".")[-1]
for fname, alt, sheet in files:
if alts is not None and alt not in alts:
[entries] New entry: musculoskeletal f535a79
diff --git a/entries/musculoskeletal/__init__.py b/entries/musculoskeletal/__init__.py
new file mode 100644
index 0000000..d20a947
--- /dev/null
+++ b/entries/musculoskeletal/__init__.py
@@ -0,0 +1,102 @@
+#! /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 *
+from openpyxl import load_workbook
+
+title = "Human musculoskeletal network (2018)"
+description = """Bipartite networks of the muscles and bones of the human body, from A. C. Murphy, D. S. Bassett and collaborators. Nodes are muscles and bones (some of which are actually ligaments or tendons), and an undirected edge connects a muscle to a bone on which it has an origin or insertion point, i.e., to which it attaches. There are two networks, with the same 270 muscles:
+
+- `hosford`: compiled from the Hosford Muscle Tables (173 bones), used in the main text of the paper.
+- `grant`: compiled from Grant's Atlas of Anatomy (173 bones, in a slightly different list), used in the supplementary text. In this network, 20 nodes have no connections.
+
+The nodes have the following properties:
+
+- `name`: the name of the muscle or bone.
+- `is_muscle`: whether the node is a muscle (otherwise it is a bone).
+- `community`: (muscles only, -1 for bones) the community of the muscle (1 to 22), found by the authors by modularity maximization (consensus of 100 runs, with resolution parameter 4.3) on the muscle-muscle network of the `hosford` data, in which two muscles are connected if they attach to the same bone.
+- `homunculus_category`: (muscles only, -1 for bones) the category of the motor homunculus (the map of the body in the primary motor cortex, following Penfield) to which the muscle was assigned (1 to 22), and `homunculus_region`: the name of this category (e.g. "Toes", "Knee", "Shoulder", "Jaw", "Swallowing")."""
+tags = ['Biological', 'Unweighted', 'Metadata']
+url = 'https://doi.org/10.5281/zenodo.1069104'
+citation = [('A. C. Murphy, S. F. Muldoon, D. Baker, A. Lastowka, B. Bennett, M. Yang, D. S. Bassett, "Structure, function, and control of the human musculoskeletal network." PLoS Biology 16(1), e2002811 (2018)', 'https://doi.org/10.1371/journal.pbio.2002811'),
+ ('A. C. Murphy, S. F. Muldoon, D. Baker, A. Lastowka, B. Bennett, M. Yang, D. S. Bassett, "Structure, function, and control of the musculoskeletal network - Data." Zenodo (2017)', 'https://doi.org/10.5281/zenodo.1069104')]
+icon_hash = '5bc6248e197c3f8a0271dafc'
+upstream_license = ("Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)",
+ "https://creativecommons.org/licenses/by-sa/4.0/")
+upstream_prefix = 'https://zenodo.org/api/records/1069104/files/supplementaryData.xlsx'
+files = [('content', 'hosford', 'Table S9'),
+ ('content', 'grant', 'Table S10')]
+
+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, sheet in files:
+ if alts is not None and alt not in alts:
+ continue
+ with open_upstream_file(name, fname, "rb", seekable=True) as f:
+ wb = load_workbook(f, read_only=True, data_only=True)
+ rows = [list(r) for r in wb[sheet].iter_rows(values_only=True)]
+ info = [list(r) for r in wb["Table S8"].iter_rows(values_only=True)]
+ # Muscles are the columns (from the third on), bones the rows (from
+ # the fourth on); a final row holds the muscle degrees.
+ muscles = [cell_str(x) for x in rows[2][2:] if cell_str(x)]
+ M = len(muscles)
+ bones = []
+ edges = []
+ for r in rows[3:]:
+ if not isinstance(r[0], int):
+ continue
+ b = M + len(bones)
+ bones.append(cell_str(r[1]))
+ for j in range(M):
+ x = r[2 + j] if 2 + j < len(r) else None
+ if isinstance(x, str) and x.strip() == "":
+ x = None
+ if x is None:
+ continue
+ if x != 1:
+ raise ValueError(f"unexpected value: {x!r}")
+ edges.append((j, b))
+ g = Graph(directed=False)
+ g.add_vertex(M + len(bones))
+ g.vp.name = g.new_vp("string", vals=muscles + bones)
+ g.vp.is_muscle = g.new_vp("bool")
+ g.vp.is_muscle.a[:M] = True
+ g.add_edge_list(edges)
+ regions = {r[6]: cell_str(r[5]) for r in info[1:]
+ if isinstance(r[6], int)}
+ g.vp.community = g.new_vp("int", val=-1)
+ g.vp.homunculus_category = g.new_vp("int", val=-1)
+ g.vp.homunculus_region = g.new_vp("string")
+ for r in info[1:]:
+ if not isinstance(r[0], int):
+ continue
+ j = r[0] - 1
+ assert cell_str(r[1]).lower() == muscles[j].lower()
+ g.vp.community[j] = r[2]
+ g.vp.homunculus_category[j] = r[3]
+ g.vp.homunculus_region[j] = regions[r[3]]
+ yield alt, g