History of macaque_neural
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/macaque_neural/__init__.py b/entries/macaque_neural/__init__.py
index 06c4d44..0432148 100644
--- a/entries/macaque_neural/__init__.py
+++ b/entries/macaque_neural/__init__.py
@@ -37,7 +37,7 @@ url = 'https://sites.google.com/site/bctnet/datasets'
citation = [('M. P. Young, "The organization of neural systems in the primate cerebral cortex", Proc. R. Soc. Lond. B 252, 13-18 (1993)', 'https://doi.org/10.1098/rspb.1993.0040'),
('C. J. Honey, R. Kötter, M. Breakspear, O. Sporns, "Network structure of cerebral cortex shapes functional connectivity on multiple time scales", Proc. Natl. Acad. Sci. USA 104, 10240-10245 (2007)', 'https://doi.org/10.1073/pnas.0701519104'),
('R. Kötter, "Online retrieval, processing, and visualization of primate connectivity data from the CoCoMac database", Neuroinformatics 2, 127-144 (2004)', 'https://doi.org/10.1385/NI:2:2:127')]
-icon_hash = ['56a85c8e26855e083a2f7929', '56a85c8e26855e083a2f7922']
+date_added = '2020-08-11'
upstream_prefix = 'https://web.archive.org/web/2020id_/https://sites.google.com/site/bctnet/Home/functions'
files = [('macaque47.mat', 'cocomac47', 'matlab'),
('macaque71.mat', 'young71', 'matlab')]
[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/macaque_neural/__init__.py b/entries/macaque_neural/__init__.py
index 7989916..06c4d44 100644
--- a/entries/macaque_neural/__init__.py
+++ b/entries/macaque_neural/__init__.py
@@ -31,7 +31,7 @@ Both networks are directed and unweighted: an edge $i\to j$ indicates a projecti
The networks have the following properties:
-- `name`: the name of the cortical area (with the padding spaces of the source files removed)."""
+- (Node) `name`: the name of the cortical area (with the padding spaces of the source files removed)."""
tags = ['Biological', 'Connectome', 'Unweighted']
url = 'https://sites.google.com/site/bctnet/datasets'
citation = [('M. P. Young, "The organization of neural systems in the primate cerebral cortex", Proc. R. Soc. Lond. B 252, 13-18 (1993)', 'https://doi.org/10.1098/rspb.1993.0040'),
[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/macaque_neural/__init__.py b/entries/macaque_neural/__init__.py
index a51faab..7989916 100644
--- a/entries/macaque_neural/__init__.py
+++ b/entries/macaque_neural/__init__.py
@@ -59,7 +59,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] Merge duplicate entries and add cross-references between related ones 9bc6033
- Removed duplicates, merged into the entries holding the same data: dblp_coauthor_snap (soc_net_comms), cattle and bison (dom; bison's breeding data move there, as do the wolves' age and sex), football_tsevans (football, with both conference assignments), eu_procurements_alt (eu_procurements), foursquare_friendships (foursquare_global). - software_dependencies: colt and scolt are one network; ambassador: the duplicate 2001 network is dropped and the three same-edge networks combined; dom: the dataset count corrected (436). - macaque_neural: Young's 71-area network added (young71; the 47-area one is now cocomac47), both from archived copies. - collins_yeast, celegans_interactomes: from archived copies of the dead CCSB site (byte-identical files). - Cross-references between entries holding versions of the same data (food webs, Wikipedia, Slashdot, physicians, SNAP/Mislove, CCSB). - ICON ids of duplicate records added; macaque_neural's corrected. - prosper, dbpedia_all: string properties given in edge-index order (needs graph-tool with the fixed vals ordering).
diff --git a/entries/macaque_neural/__init__.py b/entries/macaque_neural/__init__.py
index 9308264..a51faab 100644
--- a/entries/macaque_neural/__init__.py
+++ b/entries/macaque_neural/__init__.py
@@ -19,25 +19,41 @@
from .. import *
from scipy.io import loadmat
-title = "Macaque cortical connectivity (CoCoMac, 47 areas)"
-description = r"""Network of anatomical connections among 47 areas of the visual, somatosensory and motor cortex of the macaque monkey. Nodes are cortical areas, defined according to the parcellation of Felleman and Van Essen (as in "V1", "MT", "FEF" or "46"), and edges are axonal pathways between them, as identified by anatomical tract-tracing studies. The 47-area matrix (not to be confused with Young's 71-area data set) was obtained from the Brain Connectivity Toolbox; it was contributed by R. Kötter and used by C. J. Honey, R. Kötter, M. Breakspear and O. Sporns (PNAS 104, 10240-10245, 2007). There, the results of published tracing studies were manually collated in the CoCoMac database, mapped onto the Felleman–Van Essen parcellation, and redundant and inconsistent reports were resolved to obtain a binary connection matrix with 505 connections.
+title = "Macaque cortical connectivity (Young 1993; CoCoMac 2007)"
+description = r"""Two networks of anatomical connections among areas of the cerebral cortex of the macaque monkey, compiled from published axonal tract-tracing studies, and distributed with the Brain Connectivity Toolbox (BCT). In both, nodes are cortical areas and edges are axonal pathways (projections) between them.
-The network is directed: an edge $i\to j$ indicates a projection from area $i$ to area $j$ (an entry $a_{ij}=1$ of the source matrix, following the Brain Connectivity Toolbox convention); 192 pairs of areas are reciprocally connected.
+- `young71`: the 71-area network of M. P. Young (Proc. R. Soc. B 252, 13-18, 1993), who collated the tract-tracing literature into a connection matrix covering visual, somatosensory, auditory, motor, prefrontal and limbic (cingulate, insular, parahippocampal) areas. The BCT matrix contains 746 connections, with 308 reciprocally connected pairs of areas. Area names follow the source file, with numbered (Brodmann-type) areas prefixed by "A" (e.g. "A46" is area 46, "A7a" is area 7a), together with visual areas such as "V1", "MT" or "PITd" and auditory and temporal areas such as "KA", "PAAR" or "TS1".
+- `cocomac47`: 47 areas of the visual, somatosensory and motor cortex, defined according to the parcellation of Felleman and Van Essen (as in "V1", "MT", "FEF" or "46"). This matrix was contributed by R. Kötter and used by C. J. Honey, R. Kötter, M. Breakspear and O. Sporns (PNAS 104, 10240-10245, 2007). There, the results of published tracing studies were manually collated in the CoCoMac database, mapped onto the Felleman–Van Essen parcellation, and redundant and inconsistent reports were resolved to obtain a binary connection matrix with 505 connections; 192 pairs of areas are reciprocally connected.
-The network has the following properties:
+The two networks are independent compilations of the tracing literature using different parcellations, so the 47-area network is not a subnetwork of the 71-area one (several areas, such as "MDP", "MIP" or "36", appear only in the former, while the auditory, prefrontal and limbic areas appear only in the latter); nodes with the same name in both refer to the same anatomical area only approximately.
-- `name`: the name of the cortical area (padded with trailing spaces in the source file)."""
+Both networks are directed and unweighted: an edge $i\to j$ indicates a projection from area $i$ to area $j$ (an entry $a_{ij}=1$ of the binary source matrix, following the BCT convention); absent entries mean that no connection was reported. There are no self-loops.
+
+The networks have the following properties:
+
+- `name`: the name of the cortical area (with the padding spaces of the source files removed)."""
tags = ['Biological', 'Connectome', 'Unweighted']
url = 'https://sites.google.com/site/bctnet/datasets'
-citation = [('C. J. Honey, R. Kötter, M. Breakspear, O. Sporns, "Network structure of cerebral cortex shapes functional connectivity on multiple time scales", Proc. Natl. Acad. Sci. USA 104, 10240-10245 (2007)', 'https://doi.org/10.1073/pnas.0701519104'),
+citation = [('M. P. Young, "The organization of neural systems in the primate cerebral cortex", Proc. R. Soc. Lond. B 252, 13-18 (1993)', 'https://doi.org/10.1098/rspb.1993.0040'),
+ ('C. J. Honey, R. Kötter, M. Breakspear, O. Sporns, "Network structure of cerebral cortex shapes functional connectivity on multiple time scales", Proc. Natl. Acad. Sci. USA 104, 10240-10245 (2007)', 'https://doi.org/10.1073/pnas.0701519104'),
('R. Kötter, "Online retrieval, processing, and visualization of primate connectivity data from the CoCoMac database", Neuroinformatics 2, 127-144 (2004)', 'https://doi.org/10.1385/NI:2:2:127')]
-icon_hash = '56a85c8e26855e083a2f7922'
-upstream_prefix = 'https://sites.google.com/site/bctnet/Home/functions'
-files = [('macaque47.mat', None, 'matlab')]
+icon_hash = ['56a85c8e26855e083a2f7929', '56a85c8e26855e083a2f7922']
+upstream_prefix = 'https://web.archive.org/web/2020id_/https://sites.google.com/site/bctnet/Home/functions'
+files = [('macaque47.mat', 'cocomac47', 'matlab'),
+ ('macaque71.mat', 'young71', 'matlab')]
+# The files are no longer available from the Brain Connectivity Toolbox site
+# (its file attachments were lost when the site was migrated); they are
+# obtained from the Internet Archive.
+archived_urls = {
+ 'macaque47.mat':
+ 'https://web.archive.org/web/20201022115225id_/https://sites.google.com/site/bctnet/Home/functions/macaque47.mat?attredirects=0&d=1',
+ 'macaque71.mat':
+ 'https://web.archive.org/web/20201022115225id_/https://sites.google.com/site/bctnet/Home/functions/macaque71.mat?attredirects=0&d=1'}
def fetch_upstream(force=False):
- return fetch_upstream_files(__name__.split(".")[-1], upstream_prefix, files,
- force)
+ # The Internet Archive URLs carry a query string, so the files are
+ # fetched from them directly.
+ return fetch_archived_files(__name__.split(".")[-1], archived_urls, force)
@cache_network()
@coerce_props()
@@ -58,5 +74,5 @@ def parse(alts=None):
g.add_edge(i, j)
g.vp.name = g.new_vp("string")
for i, n in enumerate(m["Names"]):
- g.vp.name[i] = n
+ g.vp.name[i] = n.strip()
yield alt, g
[pipeline] Fix KONECT entity files, seekable upstream files and archive formats 2f6e19f
- konect.py: each ent.<net>.<entity>.<attr> file becomes a vertex property on the side of the entity it describes (per-vertex or per-edge files), instead of all of them being written from vertex 0 into `meta` (which put e.g. the item names of bibsonomy and reuters on the wrong nodes); only leading "%" lines are comments. - open_upstream_file(..., seekable=True) returns a seekable file (via a temporary file) for readers that need one (openpyxl, scipy.io.loadmat, zipfile), replacing the per-entry BytesIO copies. - .xz files can be read again; .xz, .rar and .7z downloads are stored as they are, and "x.tar.xz:", "x.rar:" and "x.7z:" member access works (with py7zr or the 7z command); caches in the previous layouts are still read. - parsers.py: vprops_from_txt matches rows by name for graphs keyed by name; the Wikimedia dump readers (stub histories, SQL tables) are shared helpers; new read_doc (tables of Word documents via LibreOffice) and read_epanet (EPANET water network files) readers. - The entries' workarounds are removed (all parse identically).
diff --git a/entries/macaque_neural/__init__.py b/entries/macaque_neural/__init__.py
index 2c2b61f..9308264 100644
--- a/entries/macaque_neural/__init__.py
+++ b/entries/macaque_neural/__init__.py
@@ -17,11 +17,10 @@
# with this program. If not, see <http://www.gnu.org/licenses/>.
from .. import *
-import io
from scipy.io import loadmat
title = "Macaque cortical connectivity (CoCoMac, 47 areas)"
-description = """Network of anatomical connections among 47 areas of the visual, somatosensory and motor cortex of the macaque monkey. Nodes are cortical areas, defined according to the parcellation of Felleman and Van Essen (as in "V1", "MT", "FEF" or "46"), and edges are axonal pathways between them, as identified by anatomical tract-tracing studies. The 47-area matrix (not to be confused with Young's 71-area data set) was obtained from the Brain Connectivity Toolbox; it was contributed by R. Kötter and used by C. J. Honey, R. Kötter, M. Breakspear and O. Sporns (PNAS 104, 10240-10245, 2007). There, the results of published tracing studies were manually collated in the CoCoMac database, mapped onto the Felleman–Van Essen parcellation, and redundant and inconsistent reports were resolved to obtain a binary connection matrix with 505 connections.
+description = r"""Network of anatomical connections among 47 areas of the visual, somatosensory and motor cortex of the macaque monkey. Nodes are cortical areas, defined according to the parcellation of Felleman and Van Essen (as in "V1", "MT", "FEF" or "46"), and edges are axonal pathways between them, as identified by anatomical tract-tracing studies. The 47-area matrix (not to be confused with Young's 71-area data set) was obtained from the Brain Connectivity Toolbox; it was contributed by R. Kötter and used by C. J. Honey, R. Kötter, M. Breakspear and O. Sporns (PNAS 104, 10240-10245, 2007). There, the results of published tracing studies were manually collated in the CoCoMac database, mapped onto the Felleman–Van Essen parcellation, and redundant and inconsistent reports were resolved to obtain a binary connection matrix with 505 connections.
The network is directed: an edge $i\to j$ indicates a projection from area $i$ to area $j$ (an entry $a_{ij}=1$ of the source matrix, following the Brain Connectivity Toolbox convention); 192 pairs of areas are reciprocally connected.
@@ -49,8 +48,8 @@ def parse(alts=None):
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:
- m = loadmat(io.BytesIO(f.read()))
+ with open_upstream_file(name, fname, "rb", seekable=True) as f:
+ m = loadmat(f)
g = Graph(directed=True)
a = m["CIJ"]
for i in range(a.shape[0]):
[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/macaque_neural/__init__.py b/entries/macaque_neural/__init__.py
index 160b99c..2c2b61f 100644
--- a/entries/macaque_neural/__init__.py
+++ b/entries/macaque_neural/__init__.py
@@ -17,14 +17,21 @@
# with this program. If not, see <http://www.gnu.org/licenses/>.
from .. import *
+import io
from scipy.io import loadmat
-title = "Macaque cortical connectivity (Young)"
-description = """A network of cortical regions in the Macaque cortex[^icon]
-[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
+title = "Macaque cortical connectivity (CoCoMac, 47 areas)"
+description = """Network of anatomical connections among 47 areas of the visual, somatosensory and motor cortex of the macaque monkey. Nodes are cortical areas, defined according to the parcellation of Felleman and Van Essen (as in "V1", "MT", "FEF" or "46"), and edges are axonal pathways between them, as identified by anatomical tract-tracing studies. The 47-area matrix (not to be confused with Young's 71-area data set) was obtained from the Brain Connectivity Toolbox; it was contributed by R. Kötter and used by C. J. Honey, R. Kötter, M. Breakspear and O. Sporns (PNAS 104, 10240-10245, 2007). There, the results of published tracing studies were manually collated in the CoCoMac database, mapped onto the Felleman–Van Essen parcellation, and redundant and inconsistent reports were resolved to obtain a binary connection matrix with 505 connections.
+
+The network is directed: an edge $i\to j$ indicates a projection from area $i$ to area $j$ (an entry $a_{ij}=1$ of the source matrix, following the Brain Connectivity Toolbox convention); 192 pairs of areas are reciprocally connected.
+
+The network has the following properties:
+
+- `name`: the name of the cortical area (padded with trailing spaces in the source file)."""
tags = ['Biological', 'Connectome', 'Unweighted']
url = 'https://sites.google.com/site/bctnet/datasets'
-citation = [('M.P. Young, "The organization of neural systems in the primate cerebral cortex." Proc. R. Soc. London B 252,13-18 (1993)', 'https://doi.org/10.1098/rspb.1993.0040')]
+citation = [('C. J. Honey, R. Kötter, M. Breakspear, O. Sporns, "Network structure of cerebral cortex shapes functional connectivity on multiple time scales", Proc. Natl. Acad. Sci. USA 104, 10240-10245 (2007)', 'https://doi.org/10.1073/pnas.0701519104'),
+ ('R. Kötter, "Online retrieval, processing, and visualization of primate connectivity data from the CoCoMac database", Neuroinformatics 2, 127-144 (2004)', 'https://doi.org/10.1385/NI:2:2:127')]
icon_hash = '56a85c8e26855e083a2f7922'
upstream_prefix = 'https://sites.google.com/site/bctnet/Home/functions'
files = [('macaque47.mat', None, 'matlab')]
@@ -43,8 +50,8 @@ def parse(alts=None):
if alts is not None and alt not in alts:
continue
with open_upstream_file(name, fname, "rb") as f:
- m = loadmat(f)
- g = Graph(directed=False)
+ m = loadmat(io.BytesIO(f.read()))
+ g = Graph(directed=True)
a = m["CIJ"]
for i in range(a.shape[0]):
for j in range(a.shape[1]):
Update copyright information 73a4f0d
diff --git a/entries/macaque_neural/__init__.py b/entries/macaque_neural/__init__.py
index 8f14bee..160b99c 100644
--- a/entries/macaque_neural/__init__.py
+++ b/entries/macaque_neural/__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/macaque_neural/__init__.py b/entries/macaque_neural/__init__.py
index 89fa2ed..8f14bee 100644
--- a/entries/macaque_neural/__init__.py
+++ b/entries/macaque_neural/__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/macaque_neural/__init__.py b/entries/macaque_neural/__init__.py
index 4884b54..89fa2ed 100644
--- a/entries/macaque_neural/__init__.py
+++ b/entries/macaque_neural/__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/macaque_neural/__init__.py b/entries/macaque_neural/__init__.py
index ecbb138..4884b54 100644
--- a/entries/macaque_neural/__init__.py
+++ b/entries/macaque_neural/__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/macaque_neural/__init__.py b/entries/macaque_neural/__init__.py
index 936e482..ecbb138 100644
--- a/entries/macaque_neural/__init__.py
+++ b/entries/macaque_neural/__init__.py
@@ -24,7 +24,7 @@ description = """A network of cortical regions in the Macaque cortex[^icon]
[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
tags = ['Biological', 'Connectome', 'Unweighted']
url = 'https://sites.google.com/site/bctnet/datasets'
-citation = [('M.P. Young, "The organization of neural systems in the primate cerebral cortex." Proc. R. Soc. London B 252,13-18 (1993)', 'http://www.jstor.org/stable/49912')]
+citation = [('M.P. Young, "The organization of neural systems in the primate cerebral cortex." Proc. R. Soc. London B 252,13-18 (1993)', 'https://doi.org/10.1098/rspb.1993.0040')]
icon_hash = '56a85c8e26855e083a2f7922'
upstream_prefix = 'https://sites.google.com/site/bctnet/Home/functions'
files = [('macaque47.mat', None, 'matlab')]
Change license from GPLv3 to AGPLv3 d754be5
diff --git a/entries/macaque_neural/__init__.py b/entries/macaque_neural/__init__.py
index 9e50253..936e482 100644
--- a/entries/macaque_neural/__init__.py
+++ b/entries/macaque_neural/__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 .. import *
from scipy.io import loadmat
Add explicit attribution to descriptions obtained from ICON 1645314
diff --git a/entries/macaque_neural/__init__.py b/entries/macaque_neural/__init__.py
index 68c315a..9e50253 100644
--- a/entries/macaque_neural/__init__.py
+++ b/entries/macaque_neural/__init__.py
@@ -20,7 +20,8 @@ from .. import *
from scipy.io import loadmat
title = "Macaque cortical connectivity (Young)"
-description = "A network of cortical regions in the Macaque cortex"
+description = """A network of cortical regions in the Macaque cortex[^icon]
+[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
tags = ['Biological', 'Connectome', 'Unweighted']
url = 'https://sites.google.com/site/bctnet/datasets'
citation = [('M.P. Young, "The organization of neural systems in the primate cerebral cortex." Proc. R. Soc. London B 252,13-18 (1993)', 'http://www.jstor.org/stable/49912')]
Initial commit cc85872
diff --git a/entries/macaque_neural/__init__.py b/entries/macaque_neural/__init__.py
new file mode 100644
index 0000000..68c315a
--- /dev/null
+++ b/entries/macaque_neural/__init__.py
@@ -0,0 +1,55 @@
+#! /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 .. import *
+from scipy.io import loadmat
+
+title = "Macaque cortical connectivity (Young)"
+description = "A network of cortical regions in the Macaque cortex"
+tags = ['Biological', 'Connectome', 'Unweighted']
+url = 'https://sites.google.com/site/bctnet/datasets'
+citation = [('M.P. Young, "The organization of neural systems in the primate cerebral cortex." Proc. R. Soc. London B 252,13-18 (1993)', 'http://www.jstor.org/stable/49912')]
+icon_hash = '56a85c8e26855e083a2f7922'
+upstream_prefix = 'https://sites.google.com/site/bctnet/Home/functions'
+files = [('macaque47.mat', None, 'matlab')]
+
+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:
+ m = loadmat(f)
+ g = Graph(directed=False)
+ a = m["CIJ"]
+ for i in range(a.shape[0]):
+ for j in range(a.shape[1]):
+ if a[i,j] > 0:
+ g.add_edge(i, j)
+ g.vp.name = g.new_vp("string")
+ for i, n in enumerate(m["Names"]):
+ g.vp.name[i] = n
+ yield alt, g