logo Netzschleuder network catalog, repository, and centrifuge

History of sider

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/sider/__init__.py b/entries/sider/__init__.py
index 42ba507..be89b94 100644
--- a/entries/sider/__init__.py
+++ b/entries/sider/__init__.py
@@ -55,7 +55,7 @@ citation = [('M. Kuhn, I. Letunic, L. J. Jensen, P. Bork, "The SIDER database of
              'https://doi.org/10.1093/nar/gkv1075'),
             ('M. Kuhn, M. Campillos, I. Letunic, L. J. Jensen, P. Bork, "A side effect resource to capture phenotypic effects of drugs." Molecular Systems Biology 6, 343 (2010)',
              'https://doi.org/10.1038/msb.2009.98')]
-icon_hash = None
+date_added = '2026-10-27'
 upstream_license = ('Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0); drug names and ATC codes CC0',
                     'https://creativecommons.org/licenses/by-sa/4.0/')
 upstream_prefix = 'https://sideeffects.embl.de/media/download'
[entries] Prefix the properties in the descriptions with (Node), (Edge) or (Graph) by Tiago de Paula Peixoto 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/sider/__init__.py b/entries/sider/__init__.py
index 7578d7f..42ba507 100644
--- a/entries/sider/__init__.py
+++ b/entries/sider/__init__.py
@@ -34,12 +34,21 @@ SIDER contains errors due to the automatic text mining (a list of known errors i
 
 The networks have the following properties:
 
-- `is_drug`: whether the node is a drug (otherwise it is a medical concept); `name`: the name of the drug (generated automatically by SIDER; empty for the few drugs of the indication files that are missing from its list of names) or of the concept (its MedDRA term); `id`: the flat STITCH compound id of the drug (e.g. `CID100000085`) or the UMLS concept id (e.g. `C0000737`); `pubchem_cid`: the PubChem compound id of the drug (-1 for concepts); `atc`: the ATC codes of the drug; `meddra_ids`: the MedDRA codes of the concept (from the MedDRA file of SIDER).
-- Edge `meddra_type`: the kind of MedDRA term of the concept: `LLT` (lowest level term), `PT` (preferred term), or empty if it is neither; `label_concept`: the UMLS concept id as found on the label (which the MedDRA term maps to).
-- In `side_effects`, `side_effect_frequencies` and `label_side_effects`, edge `stereo_id`: the STITCH compound id with stereochemistry of the drug on the label.
-- In `side_effect_frequencies`, edge `placebo`: whether the frequency is for placebo administration; `frequency`: the frequency as given on the label (e.g. `21%`, `rare`, `postmarketing`); `frequency_lower` and `frequency_upper`: lower and upper bounds of the frequency, as fractions.
-- In `indications` and `label_indications`, edge `method`: the method of detection (`NLP_indication`, `NLP_precondition` or `text_mention`); `label_concept_name`: the name of the concept as found on the label.
-- In `label_side_effects` and `label_indications`, edge `label`: the label (source document) on which it was found (e.g. `EMA/WC500020092.html`)."""
+- (Node) `is_drug`: whether the node is a drug (otherwise it is a medical concept).
+- (Node) `name`: the name of the drug (generated automatically by SIDER; empty for the few drugs of the indication files that are missing from its list of names) or of the concept (its MedDRA term).
+- (Node) `id`: the flat STITCH compound id of the drug (e.g. `CID100000085`) or the UMLS concept id (e.g. `C0000737`).
+- (Node) `pubchem_cid`: the PubChem compound id of the drug (-1 for concepts).
+- (Node) `atc`: the ATC codes of the drug.
+- (Node) `meddra_ids`: the MedDRA codes of the concept (from the MedDRA file of SIDER).
+- (Edge) `meddra_type`: the kind of MedDRA term of the concept: `LLT` (lowest level term), `PT` (preferred term), or empty if it is neither.
+- (Edge) `label_concept`: the UMLS concept id as found on the label (which the MedDRA term maps to).
+- (Edge) `stereo_id` (`side_effects`, `side_effect_frequencies` and `label_side_effects`): the STITCH compound id with stereochemistry of the drug on the label.
+- (Edge) `placebo` (`side_effect_frequencies`): whether the frequency is for placebo administration.
+- (Edge) `frequency` (`side_effect_frequencies`): the frequency as given on the label (e.g. `21%`, `rare`, `postmarketing`).
+- (Edge) `frequency_lower`, `frequency_upper` (`side_effect_frequencies`): lower and upper bounds of the frequency, as fractions.
+- (Edge) `method` (`indications` and `label_indications`): the method of detection (`NLP_indication`, `NLP_precondition` or `text_mention`).
+- (Edge) `label_concept_name` (`indications` and `label_indications`): the name of the concept as found on the label.
+- (Edge) `label` (`label_side_effects` and `label_indications`): the label (source document) on which it was found (e.g. `EMA/WC500020092.html`)."""
 tags = ['Biological', 'Drug interactions', 'Unweighted', 'Multigraph', 'Metadata']
 url = 'https://sideeffects.embl.de/download/'
 citation = [('M. Kuhn, I. Letunic, L. J. Jensen, P. Bork, "The SIDER database of drugs and side effects." Nucleic Acids Research 44, D1075-D1079 (2016)',
[entries] New entry: sider by Tiago de Paula Peixoto f37fe26
diff --git a/entries/sider/__init__.py b/entries/sider/__init__.py
new file mode 100644
index 0000000..7578d7f
--- /dev/null
+++ b/entries/sider/__init__.py
@@ -0,0 +1,188 @@
+#! /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 collections import defaultdict
+
+title = "SIDER drug side effects and indications (2015)"
+description = """Bipartite networks of marketed drugs and their side effects (adverse drug reactions) and indications, from the Side Effect Resource SIDER, version 4.1 (released on October 21, 2015), by the Bork group at EMBL. SIDER is compiled from public documents of drug labels (package inserts), mostly from the FDA, the EMA and other sources: the side effects and indications mentioned in the labels were extracted by text mining, mapped to medical concepts of the UMLS (Unified Medical Language System) and to terms of the MedDRA dictionary of adverse event terms, and the labels were mapped to the drugs' compound identifiers of STITCH (derived from PubChem compound identifiers) through the drug names they mention. Each network has two kinds of nodes: drugs (1,430 to 1,437 compounds, identified by their "flat" STITCH ids, i.e. ignoring stereochemistry) and medical concepts (side effects or indications), identified by their UMLS concept ids.
+
+For each concept found on a label, SIDER gives its MedDRA term as the "lowest level term" (LLT) and, additionally, each "preferred term" (PT) that it maps to (the PT may be the same concept as the LLT); in a few cases the concept is neither (e.g. a system organ class), and then the concept found on the label is used as the node. Each row of the SIDER files is an edge, from the drug to the MedDRA concept, so that a drug is usually joined to the same concept by several edges (as LLT and as PT, for several concepts found on its labels, for several stereoisomers, from several labels, or with several frequencies), and the networks are multigraphs. The networks are:
+
+- `side_effects`: the side effects of each drug, collected from all its labels (`meddra_all_se`).
+- `side_effect_frequencies`: the frequencies of side effects given on the labels, for the subset of side effects for which the labels give them, e.g. from clinical trials (`meddra_freq`); a side effect can have several frequencies, e.g. from different trials, for different levels of severity, or with placebo administration.
+- `indications`: the indications of each drug, collected from all its labels (`meddra_all_indications`).
+- `label_side_effects` and `label_indications`: the same as `side_effects` and `indications`, but with an edge for each label on which the side effect or the indication was found (`meddra_all_label_se` and `meddra_all_label_indications`).
+
+SIDER contains errors due to the automatic text mining (a list of known errors is maintained on GitHub, mkuhn/sider, and is not applied here). Earlier versions of SIDER (1, 2 and 4.0) are no longer available for download. The SIDER side effects of the drugs approved in 2016 are also part of the entry `hetionet`.
+
+The networks have the following properties:
+
+- `is_drug`: whether the node is a drug (otherwise it is a medical concept); `name`: the name of the drug (generated automatically by SIDER; empty for the few drugs of the indication files that are missing from its list of names) or of the concept (its MedDRA term); `id`: the flat STITCH compound id of the drug (e.g. `CID100000085`) or the UMLS concept id (e.g. `C0000737`); `pubchem_cid`: the PubChem compound id of the drug (-1 for concepts); `atc`: the ATC codes of the drug; `meddra_ids`: the MedDRA codes of the concept (from the MedDRA file of SIDER).
+- Edge `meddra_type`: the kind of MedDRA term of the concept: `LLT` (lowest level term), `PT` (preferred term), or empty if it is neither; `label_concept`: the UMLS concept id as found on the label (which the MedDRA term maps to).
+- In `side_effects`, `side_effect_frequencies` and `label_side_effects`, edge `stereo_id`: the STITCH compound id with stereochemistry of the drug on the label.
+- In `side_effect_frequencies`, edge `placebo`: whether the frequency is for placebo administration; `frequency`: the frequency as given on the label (e.g. `21%`, `rare`, `postmarketing`); `frequency_lower` and `frequency_upper`: lower and upper bounds of the frequency, as fractions.
+- In `indications` and `label_indications`, edge `method`: the method of detection (`NLP_indication`, `NLP_precondition` or `text_mention`); `label_concept_name`: the name of the concept as found on the label.
+- In `label_side_effects` and `label_indications`, edge `label`: the label (source document) on which it was found (e.g. `EMA/WC500020092.html`)."""
+tags = ['Biological', 'Drug interactions', 'Unweighted', 'Multigraph', 'Metadata']
+url = 'https://sideeffects.embl.de/download/'
+citation = [('M. Kuhn, I. Letunic, L. J. Jensen, P. Bork, "The SIDER database of drugs and side effects." Nucleic Acids Research 44, D1075-D1079 (2016)',
+             'https://doi.org/10.1093/nar/gkv1075'),
+            ('M. Kuhn, M. Campillos, I. Letunic, L. J. Jensen, P. Bork, "A side effect resource to capture phenotypic effects of drugs." Molecular Systems Biology 6, 343 (2010)',
+             'https://doi.org/10.1038/msb.2009.98')]
+icon_hash = None
+upstream_license = ('Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0); drug names and ATC codes CC0',
+                    'https://creativecommons.org/licenses/by-sa/4.0/')
+upstream_prefix = 'https://sideeffects.embl.de/media/download'
+
+meta = ('drug_names.tsv', 'drug_atc.tsv', 'meddra.tsv.gz')
+nets = [('side_effects', 'meddra_all_se.tsv.gz'),
+        ('side_effect_frequencies', 'meddra_freq.tsv.gz'),
+        ('indications', 'meddra_all_indications.tsv.gz'),
+        ('label_side_effects', 'meddra_all_label_se.tsv.gz'),
+        ('label_indications', 'meddra_all_label_indications.tsv.gz')]
+files = [((fname,) + meta, alt, None) for alt, fname in nets]
+
+def fetch_upstream(force=False):
+    return fetch_upstream_files(__name__.split(".")[-1], upstream_prefix, files,
+                                force)
+
+# Columns of each file: names of the fields, in order
+columns = {
+    'side_effects': ['drug', 'stereo_id', 'label_concept', 'meddra_type',
+                     'concept', 'concept_name'],
+    'side_effect_frequencies': ['drug', 'stereo_id', 'label_concept', 'placebo',
+                                'frequency', 'frequency_lower',
+                                'frequency_upper', 'meddra_type', 'concept',
+                                'concept_name'],
+    'indications': ['drug', 'label_concept', 'method', 'label_concept_name',
+                    'meddra_type', 'concept', 'concept_name'],
+    'label_side_effects': ['label', 'drug', 'stereo_id', 'label_concept',
+                           'meddra_type', 'concept', 'concept_name'],
+    'label_indications': ['label', 'drug', 'stereo_id', 'label_concept',
+                          'method', 'label_concept_name', 'meddra_type',
+                          'concept', 'concept_name'],
+}
+
+# Edge properties of each network, in the order in which they are stored
+eprops = ['meddra_type', 'label_concept', 'stereo_id', 'placebo', 'frequency',
+          'frequency_lower', 'frequency_upper', 'method', 'label_concept_name',
+          'label']
+
+def _lines(f):
+    for l in f:
+        l = l.rstrip("\r\n")
+        if l:
+            yield l.split("\t")
+
+@cache_network()
+@coerce_props(vforce={'name': 'string', 'id': 'string'},
+              eforce={'meddra_type': 'string', 'label_concept': 'string',
+                      'stereo_id': 'string', 'frequency': 'string',
+                      'method': 'string', 'label_concept_name': 'string',
+                      'label': 'string'})
+@annotate()
+def parse(alts=None):
+    name = __name__.split(".")[-1]
+
+    with open_upstream_file(name, 'drug_names.tsv', "r") as f:
+        drug_names = {}
+        for r in _lines(f):
+            assert len(r) == 2 and r[0] not in drug_names, r
+            drug_names[r[0]] = r[1]
+    atc = defaultdict(list)
+    with open_upstream_file(name, 'drug_atc.tsv', "r") as f:
+        for r in _lines(f):
+            assert len(r) == 2, r
+            atc[r[0]].append(r[1])
+    meddra_ids = defaultdict(list)
+    with open_upstream_file(name, 'meddra.tsv.gz', "r") as f:
+        for r in _lines(f):
+            assert len(r) == 4, r
+            if r[2] not in meddra_ids[r[0]]:
+                meddra_ids[r[0]].append(r[2])
+
+    for alt, fname in nets:
+        if alts is not None and alt not in alts:
+            continue
+        cols = columns[alt]
+        ix = {c: i for i, c in enumerate(cols)}
+        props = [p for p in eprops if p in ix]
+        vidx = {}
+        vname = []
+        src, tgt = [], []
+        evals = {p: [] for p in props}
+        with open_upstream_file(name, fname, "r") as f:
+            for r in _lines(f):
+                assert len(r) == len(cols), r
+                drug = r[ix['drug']]
+                assert drug.startswith("CID1"), r
+                concept = r[ix['concept']]
+                if concept == "":
+                    # neither LLT nor PT: the concept found on the label
+                    assert r[ix['meddra_type']] == "", r
+                    concept = r[ix['label_concept']]
+                assert concept.startswith("C"), r
+                for k, (key, nm) in enumerate([(drug, drug_names.get(drug, "")),
+                                               (concept, r[ix['concept_name']])]):
+                    v = vidx.get(key)
+                    if v is None:
+                        v = vidx[key] = len(vname)
+                        vname.append(nm)
+                    else:
+                        assert vname[v] == nm, (key, vname[v], nm)
+                    if k == 0:
+                        src.append(v)
+                    else:
+                        tgt.append(v)
+                for p in props:
+                    x = r[ix[p]]
+                    if p == 'placebo':
+                        assert x in ("", "placebo"), r
+                        x = x == "placebo"
+                    elif p in ('frequency_lower', 'frequency_upper'):
+                        x = float(x)
+                    evals[p].append(x)
+
+        g = Graph(directed=False)
+        g.add_vertex(len(vname))
+        g.add_edge_list(numpy.array([src, tgt], dtype="int64").T)
+        del src, tgt
+        ids = list(vidx.keys())
+        is_drug = g.new_vp("bool")
+        is_drug.a = [i.startswith("CID") for i in ids]
+        g.vp.is_drug = is_drug
+        g.vp.name = g.new_vp("string", vals=vname)
+        g.vp.id = g.new_vp("string", vals=ids)
+        g.vp.pubchem_cid = g.new_vp("int64_t",
+                                    vals=[int(i[4:]) if i.startswith("CID") else -1
+                                          for i in ids])
+        g.vp.atc = g.new_vp("vector<string>", vals=[atc.get(i, []) for i in ids])
+        g.vp.meddra_ids = g.new_vp("vector<string>",
+                                   vals=[meddra_ids.get(i, []) for i in ids])
+        for p in props:
+            if p == 'placebo':
+                t = "bool"
+            elif p in ('frequency_lower', 'frequency_upper'):
+                t = "double"
+            else:
+                t = "string"
+            g.ep[p] = g.new_ep(t, vals=evals[p])
+            evals[p] = None
+        yield alt, g