History of blumenau_drug
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/blumenau_drug/__init__.py b/entries/blumenau_drug/__init__.py
index 98eb0c8..8167fb3 100644
--- a/entries/blumenau_drug/__init__.py
+++ b/entries/blumenau_drug/__init__.py
@@ -19,13 +19,19 @@
from .. import *
title = "Blumenau drug interactions (2019)"
-description = """A network of drug-drug interactions, extracted from 18 months of electronic health records (EHRs) from the city of Blumenau in Southern Brazil. Nodes are annotated with drug information (separate file), and edges are weighted by the severity of the interaction, along with other information.[^icon]
-[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
+description = r"""A network of known drug–drug interactions (DDI) co-administered to patients in the city of Blumenau, in Southern Brazil, constructed by R. Brattig Correia and collaborators from 18 months (January 2014 to June 2015) of drug dispensation records of the city's public health information system. Medications were matched to their DrugBank identifiers, and a pair of drugs is considered a known interaction if it is listed in DrugBank (2011 version). Nodes are the 75 drugs involved in at least one co-administration of a known DDI, and an undirected edge connects two drugs if they form a known DDI and were co-administered (dispensed with overlapping administration periods) to at least one patient.
+
+The strength of association of a drug pair is measured by $\tau_{ij}$: for each patient $u$, the overlap of the administration of drugs $i$ and $j$ is $\tau^u_{ij} = \lambda^u_{ij}/(\lambda^u_i + \lambda^u_j - \lambda^u_{ij})$, where $\lambda^u_i$ is the length of administration of drug $i$ and $\lambda^u_{ij}$ the length of co-administration, and $\tau_{ij}$ is the average of $\tau^u_{ij}$ over all patients co-administered the pair. The gender bias of an interaction is measured by the relative risk of interaction for women, $RRI^F_{ij}$, the ratio between the fraction of female and of male patients who were co-administered the pair, with $RRI^M_{ij} = 1/RRI^F_{ij}$.
+
+The network has the following properties:
+
+- Nodes: `name`, the DrugBank identifier; `label`, the drug name; `class`, the primary action class of the drug (from Drugs.com); `hormone`, whether the drug is a hormone ("True" or "False"); `p_node`, the probability of interaction of the drug, i.e. the fraction of its co-administrations that are known DDIs; `len_i`, a numerical value whose meaning is not documented in the source data; `color`, the color used for the drug class in the visualization of the original publication.
+- Edges: `tau`, the association strength $\tau_{ij}$ (rounded to two decimals); `tau_norm` and `weight`, $\tau_{ij}$ rescaled to the range 1 to 10 (for visualization); `patients`, the number of patients who were co-administered the pair; `patients_norm`, the same rescaled to the range 1 to 15; `RRI^F` and `RRI^M`, the relative risks of interaction for women and men; `gender`, the gender with the higher relative risk; `severity`, the severity of the interaction according to Drugs.com ("Major", "Moderate", "Minor", "None", or "\*", the latter undocumented); `color`, the edge color used in the original publication."""
tags = ['Biological', 'Drug interactions', 'Weighted', 'Metadata']
url = 'https://github.com/rionbr/DDIBlumenau/tree/master/csv'
citation = [('R. Brattig Correia et al. "City-wide electronic health records reveal gender and age biases in administration of known drug–drug interactions." npj Digital Medicine 2, 74 (2019)', 'https://doi.org/10.1038/s41746-019-0141-x')]
icon_hash = '5d39d32cf7b45cae7430ba18'
-ustream_license = None
+upstream_license = None
upstream_prefix = 'https://raw.githubusercontent.com/rionbr/DDIBlumenau/master/csv'
files = [(('net_edges.csv', 'net_nodes.csv'), None, ("csv",
dict( props="header",
Update copyright information 73a4f0d
diff --git a/entries/blumenau_drug/__init__.py b/entries/blumenau_drug/__init__.py
index 1ea1fc5..98eb0c8 100644
--- a/entries/blumenau_drug/__init__.py
+++ b/entries/blumenau_drug/__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/blumenau_drug/__init__.py b/entries/blumenau_drug/__init__.py
index 7e62d65..1ea1fc5 100644
--- a/entries/blumenau_drug/__init__.py
+++ b/entries/blumenau_drug/__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/blumenau_drug/__init__.py b/entries/blumenau_drug/__init__.py
index 6353e4f..7e62d65 100644
--- a/entries/blumenau_drug/__init__.py
+++ b/entries/blumenau_drug/__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/blumenau_drug/__init__.py b/entries/blumenau_drug/__init__.py
index a3fe653..6353e4f 100644
--- a/entries/blumenau_drug/__init__.py
+++ b/entries/blumenau_drug/__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/blumenau_drug/__init__.py b/entries/blumenau_drug/__init__.py
index 8588e27..a3fe653 100644
--- a/entries/blumenau_drug/__init__.py
+++ b/entries/blumenau_drug/__init__.py
@@ -23,7 +23,7 @@ description = """A network of drug-drug interactions, extracted from 18 months o
[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
tags = ['Biological', 'Drug interactions', 'Weighted', 'Metadata']
url = 'https://github.com/rionbr/DDIBlumenau/tree/master/csv'
-citation = [('R. Brattig Correia et al. "City-wide electronic health records reveal gender and age biases in administration of known drug–drug interactions." npj Digital Medicine 2, 74 (2019)', 'https://www.nature.com/articles/s41746-019-0141-x')]
+citation = [('R. Brattig Correia et al. "City-wide electronic health records reveal gender and age biases in administration of known drug–drug interactions." npj Digital Medicine 2, 74 (2019)', 'https://doi.org/10.1038/s41746-019-0141-x')]
icon_hash = '5d39d32cf7b45cae7430ba18'
ustream_license = None
upstream_prefix = 'https://raw.githubusercontent.com/rionbr/DDIBlumenau/master/csv'
Add blumenau_drug 633ba5d
diff --git a/entries/blumenau_drug/__init__.py b/entries/blumenau_drug/__init__.py
new file mode 100644
index 0000000..8588e27
--- /dev/null
+++ b/entries/blumenau_drug/__init__.py
@@ -0,0 +1,59 @@
+#! /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 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 = "Blumenau drug interactions (2019)"
+description = """A network of drug-drug interactions, extracted from 18 months of electronic health records (EHRs) from the city of Blumenau in Southern Brazil. Nodes are annotated with drug information (separate file), and edges are weighted by the severity of the interaction, along with other information.[^icon]
+[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
+tags = ['Biological', 'Drug interactions', 'Weighted', 'Metadata']
+url = 'https://github.com/rionbr/DDIBlumenau/tree/master/csv'
+citation = [('R. Brattig Correia et al. "City-wide electronic health records reveal gender and age biases in administration of known drug–drug interactions." npj Digital Medicine 2, 74 (2019)', 'https://www.nature.com/articles/s41746-019-0141-x')]
+icon_hash = '5d39d32cf7b45cae7430ba18'
+ustream_license = None
+upstream_prefix = 'https://raw.githubusercontent.com/rionbr/DDIBlumenau/master/csv'
+files = [(('net_edges.csv', 'net_nodes.csv'), None, ("csv",
+ dict( props="header",
+ vprops=dict(fmt="csv"))))]
+
+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
+ if isinstance(fnames, str):
+ fnames = [fnames]
+ with ExitStack() as stack:
+ fs = [stack.enter_context(open_upstream_file(name, fn, "rb")) for fn in fnames]
+ g = parse_graph(fs, fmt, directed=False)
+
+ for p in ["edge_bet_cent", "label_i", "label_j"]:
+ del g.ep[p]
+ for p in ["degree", "degree-strength", "module-infomap",
+ "module-louvain", "node_bet_cent", "rank_degree"]:
+ del g.vp[p]
+
+ yield alt, g