logo Netzschleuder network catalog, repository, and centrifuge

History of humannet

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/humannet/__init__.py b/entries/humannet/__init__.py
index 40bf684..4086cea 100644
--- a/entries/humannet/__init__.py
+++ b/entries/humannet/__init__.py
@@ -41,7 +41,7 @@ citation = [('C. Y. Kim, S. Baek, J. Cha, S. Yang, E. Kim, E. M. Marcotte, T. Ha
              'https://doi.org/10.1093/nar/gkab1048'),
             ('S. Hwang, C. Y. Kim, S. Yang, E. Kim, T. Hart, E. M. Marcotte, I. Lee, "HumanNet v2: human gene networks for disease research." Nucleic Acids Research 47, D573-D580 (2019)',
              'https://doi.org/10.1093/nar/gky1126')]
-icon_hash = None
+date_added = '2026-10-31'
 # Stated on the download page of HumanNet v2 (none is stated for v3)
 upstream_license = ('Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)',
                     'https://creativecommons.org/licenses/by-sa/4.0/')
[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/humannet/__init__.py b/entries/humannet/__init__.py
index 9c4b696..40bf684 100644
--- a/entries/humannet/__init__.py
+++ b/entries/humannet/__init__.py
@@ -31,10 +31,10 @@ The networks of HumanNet v2 (2018) are `v2_xn` (HumanNet-XN, the fully extended
 
 The networks have the following properties:
 
-- `entrez_id`: the NCBI Gene identifier of the gene.
-- `name`: the gene symbol, as given by HumanNet v3 (empty for the genes of v2 that are not in the v3 networks).
-- Edge `lls` (all networks but `v3_gsp`): the log-likelihood score of the link.
-- Edge `score2` (`v2_sc_ht`, `v2_sc_lc`, `v2_sc_ts`): a second score given in the files of these networks, without documentation (slightly lower than `lls`)."""
+- (Node) `entrez_id`: the NCBI Gene identifier of the gene.
+- (Node) `name`: the gene symbol, as given by HumanNet v3 (empty for the genes of v2 that are not in the v3 networks).
+- (Edge) `lls` (all networks but `v3_gsp`): the log-likelihood score of the link.
+- (Edge) `score2` (`v2_sc_ht`, `v2_sc_lc`, `v2_sc_ts`): a second score given in the files of these networks, without documentation (slightly lower than `lls`)."""
 tags = ['Biological', 'Genetic', 'Protein interactions', 'Weighted', 'Metadata']
 url = ['https://www.inetbio.org/humannet/', 'https://www.inetbio.org/humannetv2/']
 citation = [('C. Y. Kim, S. Baek, J. Cha, S. Yang, E. Kim, E. M. Marcotte, T. Hart, I. Lee, "HumanNet v3: an improved database of human gene networks for disease research." Nucleic Acids Research 50, D632-D639 (2022)',
[entries] New entry: humannet by Tiago de Paula Peixoto b91047d
diff --git a/entries/humannet/__init__.py b/entries/humannet/__init__.py
new file mode 100644
index 0000000..9c4b696
--- /dev/null
+++ b/entries/humannet/__init__.py
@@ -0,0 +1,131 @@
+#! /usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 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/>.
+
+import pyarrow
+import pyarrow.csv
+import pyarrow.compute as pc
+
+from .. import *
+
+title = "HumanNet human functional gene networks (v2 and v3)"
+description = r"""Networks of human genes from HumanNet (Network Biomedicine Lab, Yonsei University, and Marcotte Lab, University of Texas at Austin), in which an edge links two genes that are likely to work in the same biological process (co-functional links), weighted by a log-likelihood score (LLS) of their association. The scores are obtained from a Bayesian framework that measures how well each kind of evidence (protein interactions, co-expression, co-citation, pathway databases, protein domains, genetic interactions, gene neighborhood, phylogenetic profiles, interactions of orthologs in other organisms, ...) recovers known co-functional gene pairs (the gold standard). The component networks, each from one kind of evidence, are integrated into the networks HumanNet-FN (functional network) and the extended networks. The genes are identified by their NCBI Gene (Entrez) identifiers.
+
+The networks of HumanNet v3 (2021) are `v3_xc` (HumanNet-XC, the functional network extended by co-citation), `v3_fn` (HumanNet-FN, integrating the components CX, DB, DP, GI, GN, PG and PI) and the component networks `v3_cc` (co-citation), `v3_cx` (co-expression), `v3_db` (pathway databases), `v3_dp` (protein domain profiles), `v3_gi` (genetic interactions), `v3_gn` (gene neighborhood), `v3_pg` (phylogenetic profiles) and `v3_pi` (protein-protein interactions); `v3_gsp` is the network of the gold standard positive gene pairs (unweighted).
+
+The networks of HumanNet v2 (2018) are `v2_xn` (HumanNet-XN, the fully extended functional network), `v2_xc` (extended by co-citation), `v2_xi` (extended by interologs), `v2_fn` (functional network), `v2_cf` (co-functional network), `v2_pi` (protein-protein interaction network), the component networks `v2_cc` (co-citation), `v2_ce` (co-essentiality), `v2_cx` (co-expression), `v2_db` (pathway databases), `v2_dp` (protein domain profiles), `v2_gn` (gene neighborhood), `v2_ht` (high-throughput protein interactions), `v2_il` (protein interactions transferred from other organisms), `v2_lc` (literature-curated protein interactions), `v2_pg` (phylogenetic profiles), and the networks of human genes derived from the interactions of their orthologs in other organisms (interologs): `v2_ce_ht`, `v2_ce_lc` (high-throughput and literature-curated protein interactions in *C. elegans*), `v2_dm_ht`, `v2_dm_lc` (*D. melanogaster*), `v2_dr_lc` (*D. rerio*), `v2_mm_lc` (*M. musculus*), `v2_sc_gt` (genetic interactions in *S. cerevisiae*), `v2_sc_ht`, `v2_sc_lc` (protein interactions in *S. cerevisiae*), `v2_sc_ts` (3D-structure-based interactions in *S. cerevisiae*), `v2_clf_lc` (*C. lupus familiaris*), `v2_bt_lc` (*B. taurus*), `v2_rn_lc` (*R. norvegicus*) and `v2_gg_lc` (*G. gallus*).
+
+The networks have the following properties:
+
+- `entrez_id`: the NCBI Gene identifier of the gene.
+- `name`: the gene symbol, as given by HumanNet v3 (empty for the genes of v2 that are not in the v3 networks).
+- Edge `lls` (all networks but `v3_gsp`): the log-likelihood score of the link.
+- Edge `score2` (`v2_sc_ht`, `v2_sc_lc`, `v2_sc_ts`): a second score given in the files of these networks, without documentation (slightly lower than `lls`)."""
+tags = ['Biological', 'Genetic', 'Protein interactions', 'Weighted', 'Metadata']
+url = ['https://www.inetbio.org/humannet/', 'https://www.inetbio.org/humannetv2/']
+citation = [('C. Y. Kim, S. Baek, J. Cha, S. Yang, E. Kim, E. M. Marcotte, T. Hart, I. Lee, "HumanNet v3: an improved database of human gene networks for disease research." Nucleic Acids Research 50, D632-D639 (2022)',
+             'https://doi.org/10.1093/nar/gkab1048'),
+            ('S. Hwang, C. Y. Kim, S. Yang, E. Kim, T. Hart, E. M. Marcotte, I. Lee, "HumanNet v2: human gene networks for disease research." Nucleic Acids Research 47, D573-D580 (2019)',
+             'https://doi.org/10.1093/nar/gky1126')]
+icon_hash = None
+# Stated on the download page of HumanNet v2 (none is stated for v3)
+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://www.inetbio.org'
+V3 = {"xc": "HumanNet-XC", "fn": "HumanNet-FN", "cc": "HS-CC", "cx": "HS-CX",
+      "db": "HS-DB", "dp": "HS-DP", "gi": "HS-GI", "gn": "HS-GN", "pg": "HS-PG",
+      "pi": "HS-PI", "gsp": "HumanNet-GSP"}
+V2 = {"xn": "HumanNet-XN", "xc": "HumanNet-XC", "xi": "HumanNet-XI",
+      "fn": "HumanNet-FN", "cf": "HumanNet-CF", "pi": "HumanNet-PI",
+      "cc": "HS-CC", "ce": "HS-CE", "cx": "HS-CX", "db": "HS-DB", "dp": "HS-DP",
+      "gn": "HS-GN", "ht": "HS-HT", "il": "HS-IL", "lc": "HS-LC", "pg": "HS-PG",
+      "ce_ht": "HS-CEHT", "ce_lc": "HS-CELC", "dm_ht": "HS-DMHT",
+      "dm_lc": "HS-DMLC", "dr_lc": "HS-DRLC", "mm_lc": "HS-MMLC",
+      "sc_gt": "HS-SCGT", "sc_ht": "HS-SCHT", "sc_lc": "HS-SCLC",
+      "sc_ts": "HS-SCTS", "clf_lc": "HS-CLFLC", "bt_lc": "HS-BTLC",
+      "rn_lc": "HS-RNLC", "gg_lc": "HS-GGLC"}
+SYMBOLS = tuple(f"humannetv3/networks/{f}.symbol.tsv.gz" for f in V3.values())
+nets = ([(f"v3_{k}", f"humannetv3/networks/{f}.tsv.gz") for k, f in V3.items()] +
+        [(f"v2_{k}", f"humannetv2/networks/{f}.tsv") for k, f in V2.items()])
+files = [((fname,) + SYMBOLS, alt, None) for alt, fname in nets]
+
+def fetch_upstream(force=False):
+    return fetch_upstream_files(__name__.split(".")[-1], upstream_prefix, files,
+                                force)
+
+def read_table(name, fname):
+    """The table of a network file (with or without a header line), with the
+    columns "a", "b" (the genes) and "w" and "w2" (the scores) if given."""
+    with open_upstream_file(name, fname, "rb") as f:
+        l = next(f)
+        header = l.startswith(b"#")
+        if header:
+            l = next(f)
+        ncols = len(l.split(b"\t"))
+    with open_upstream_file(name, fname, "rb") as f:
+        t = pyarrow.csv.read_csv(
+            f,
+            read_options=pyarrow.csv.ReadOptions(
+                column_names=["a", "b", "w", "w2"][:ncols], skip_rows=int(header)),
+            parse_options=pyarrow.csv.ParseOptions(delimiter="\t",
+                                                   quote_char=False),
+            convert_options=pyarrow.csv.ConvertOptions(
+                column_types=dict(a=pyarrow.string(), b=pyarrow.string(),
+                                  w=pyarrow.string(), w2=pyarrow.string())))
+    return t
+
+def read_symbols(name):
+    """The gene symbols of the genes, from the files of the v3 networks with
+    symbols, whose lines correspond to those of the files with gene
+    identifiers."""
+    sym = {}
+    for k, f in V3.items():
+        t = read_table(name, f"humannetv3/networks/{f}.tsv.gz")
+        s = read_table(name, f"humannetv3/networks/{f}.symbol.tsv.gz")
+        assert t.num_rows == s.num_rows, f
+        for c in "ab":
+            for i, x in zip(t.column(c).to_pylist(), s.column(c).to_pylist()):
+                assert sym.setdefault(i, x) == x, (f, i, x, sym[i])
+    return sym
+
+@cache_network()
+@coerce_props()
+@annotate()
+def parse(alts=None):
+    name = __name__.split(".")[-1]
+    sym = None
+    for alt, fname in nets:
+        if alts is not None and alt not in alts:
+            continue
+        if sym is None:
+            sym = read_symbols(name)
+        t = read_table(name, fname)
+        ids = pc.unique(pyarrow.chunked_array(t.column("a").chunks +
+                                              t.column("b").chunks))
+        g = Graph(directed=False)
+        g.add_vertex(len(ids))
+        g.add_edge_list(numpy.column_stack(
+            [pc.index_in(t.column("a"), value_set=ids).to_numpy(),
+             pc.index_in(t.column("b"), value_set=ids).to_numpy()]))
+        ids = ids.to_pylist()
+        g.vp.entrez_id = g.new_vp("int64_t", vals=[int(i) for i in ids])
+        g.vp.name = g.new_vp("string", vals=[sym.get(i, "") for i in ids])
+        for c, p in (("w", "lls"), ("w2", "score2")):
+            if c in t.column_names:
+                g.ep[p] = g.new_ep("double", vals=numpy.array(t.column(c).to_pylist(),
+                                                             dtype="float"))
+        yield alt, g