History of biogrid
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/biogrid/__init__.py b/entries/biogrid/__init__.py
index f5a69fd..60163d1 100644
--- a/entries/biogrid/__init__.py
+++ b/entries/biogrid/__init__.py
@@ -62,7 +62,7 @@ tags = ['Biological', 'Protein interactions', 'Genetic', 'Unweighted', 'Multilay
url = 'https://downloads.thebiogrid.org/BioGRID/Release-Archive/'
citation = [('R. Oughtred, J. Rust, C. Chang, B.-J. Breitkreutz, C. Stark, A. Willems, L. Boucher, G. Leung, N. Kolas, F. Zhang, S. Dolma, J. Coulombe-Huntington, A. Chatr-aryamontri, K. Dolinski, M. Tyers, "The BioGRID database: A comprehensive biomedical resource of curated protein, genetic, and chemical interactions." Protein Science 30(1), 187-200 (2021)', 'https://doi.org/10.1002/pro.3978'),
('C. Stark, B.-J. Breitkreutz, T. Reguly, L. Boucher, A. Breitkreutz, M. Tyers, "BioGRID: a general repository for interaction datasets." Nucleic Acids Research 34(suppl 1), D535-D539 (2006)', 'https://doi.org/10.1093/nar/gkj109')]
-icon_hash = None
+date_added = '2026-10-27'
upstream_license = ('MIT License', 'https://opensource.org/license/mit')
upstream_prefix = 'https://downloads.thebiogrid.org/Download/BioGRID/Release-Archive'
current = '5.0.262'
[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/biogrid/__init__.py b/entries/biogrid/__init__.py
index 228b8b8..f5a69fd 100644
--- a/entries/biogrid/__init__.py
+++ b/entries/biogrid/__init__.py
@@ -38,26 +38,26 @@ See also the `yeast_biogrid_2007` entry (yeast protein interactions from the 200
The networks have the following properties:
-- `name`: the official symbol of the gene.
-- `systematic_name`: the systematic name of the gene, if any (e.g. the ORF name of yeast genes); not in release 2.0.63.
-- `biogrid_id`: the identifier of the gene in BioGRID; not in release 2.0.63.
-- `entrez_id`: the identifier of the gene in Entrez Gene (-1 if absent); not in release 2.0.63.
-- `taxid` (viruses only): the NCBI taxonomy identifier of the organism of the gene (e.g. 9606 for human genes).
-- `organism` (viruses only, not in release 2.0.63): the name of the organism of the gene, as given by BioGRID (e.g. `Homo sapiens`).
-- `is_virus` (viruses only): whether the gene belongs to the virus of the network (otherwise to another organism, typically its host).
-- `id` (release 2.0.63 only): the identifier of the gene in that release (`ETG` followed by the Entrez Gene identifier, or another identifier, e.g. the systematic name).
-- Edge `layer`: the type of the interaction, `physical` or `genetic`.
-- Edge `experimental_system`: the experimental system that detected the interaction (e.g. `Two-hybrid`, `Affinity Capture-MS`, `Synthetic Lethality`, `Negative Genetic`); see the [BioGRID wiki](https://wiki.thebiogrid.org/doku.php/experimental_systems) for their definitions.
-- Edge `pubmed_id`: the PubMed identifier of the publication reporting the interaction (-1 if the publication is identified by its DOI instead).
-- Edge `author`: the first author and year of the publication, e.g. `Xu Z (2008)`.
+- (Node) `name`: the official symbol of the gene.
+- (Node) `systematic_name`: the systematic name of the gene, if any (e.g. the ORF name of yeast genes); not in release 2.0.63.
+- (Node) `biogrid_id`: the identifier of the gene in BioGRID; not in release 2.0.63.
+- (Node) `entrez_id`: the identifier of the gene in Entrez Gene (-1 if absent); not in release 2.0.63.
+- (Node) `taxid` (viruses only): the NCBI taxonomy identifier of the organism of the gene (e.g. 9606 for human genes).
+- (Node) `organism` (viruses only, not in release 2.0.63): the name of the organism of the gene, as given by BioGRID (e.g. `Homo sapiens`).
+- (Node) `is_virus` (viruses only): whether the gene belongs to the virus of the network (otherwise to another organism, typically its host).
+- (Node) `id` (release 2.0.63 only): the identifier of the gene in that release (`ETG` followed by the Entrez Gene identifier, or another identifier, e.g. the systematic name).
+- (Edge) `layer`: the type of the interaction, `physical` or `genetic`.
+- (Edge) `experimental_system`: the experimental system that detected the interaction (e.g. `Two-hybrid`, `Affinity Capture-MS`, `Synthetic Lethality`, `Negative Genetic`); see the [BioGRID wiki](https://wiki.thebiogrid.org/doku.php/experimental_systems) for their definitions.
+- (Edge) `pubmed_id`: the PubMed identifier of the publication reporting the interaction (-1 if the publication is identified by its DOI instead).
+- (Edge) `author`: the first author and year of the publication, e.g. `Xu Z (2008)`.
The following edge properties are not given in release 2.0.63:
-- Edge `doi`: the DOI of the publication, for publications without a PubMed identifier (empty otherwise).
-- Edge `throughput`: whether the interaction comes from a `High Throughput` or `Low Throughput` experiment (or both, `High Throughput|Low Throughput`).
-- Edge `score`: the quantitative score of the interaction reported by high-throughput studies (NaN if absent).
-- Edge `modification`: the post-translational modification of the substrate, for interactions of the experimental system `Biochemical Activity` (empty otherwise).
-- Edge `interaction_id`: the identifier of the interaction record in BioGRID."""
+- (Edge) `doi`: the DOI of the publication, for publications without a PubMed identifier (empty otherwise).
+- (Edge) `throughput`: whether the interaction comes from a `High Throughput` or `Low Throughput` experiment (or both, `High Throughput|Low Throughput`).
+- (Edge) `score`: the quantitative score of the interaction reported by high-throughput studies (NaN if absent).
+- (Edge) `modification`: the post-translational modification of the substrate, for interactions of the experimental system `Biochemical Activity` (empty otherwise).
+- (Edge) `interaction_id`: the identifier of the interaction record in BioGRID."""
tags = ['Biological', 'Protein interactions', 'Genetic', 'Unweighted', 'Multilayer', 'Multigraph', 'Metadata']
url = 'https://downloads.thebiogrid.org/BioGRID/Release-Archive/'
citation = [('R. Oughtred, J. Rust, C. Chang, B.-J. Breitkreutz, C. Stark, A. Willems, L. Boucher, G. Leung, N. Kolas, F. Zhang, S. Dolma, J. Coulombe-Huntington, A. Chatr-aryamontri, K. Dolinski, M. Tyers, "The BioGRID database: A comprehensive biomedical resource of curated protein, genetic, and chemical interactions." Protein Science 30(1), 187-200 (2021)', 'https://doi.org/10.1002/pro.3978'),
[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/biogrid/__init__.py b/entries/biogrid/__init__.py
index 5ea1d3c..228b8b8 100644
--- a/entries/biogrid/__init__.py
+++ b/entries/biogrid/__init__.py
@@ -336,7 +336,6 @@ def _parse_tab(name, fname):
@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:
[entries] New entry: biogrid a1428dd
diff --git a/entries/biogrid/__init__.py b/entries/biogrid/__init__.py
new file mode 100644
index 0000000..5ea1d3c
--- /dev/null
+++ b/entries/biogrid/__init__.py
@@ -0,0 +1,414 @@
+#! /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/>.
+
+
+from .. import *
+import re
+
+
+title = "BioGRID protein and genetic interactions (2010-2026)"
+description = """Networks of the physical (protein-protein) and genetic interactions between the genes (or their protein products) of ten model organisms, from release 5.0.262 (September 2026) of BioGRID, the Biological General Repository for Interaction Datasets. BioGRID is a database of interactions curated by hand from the biomedical literature, both from focused studies and from high-throughput experiments.
+
+There is one network for each organism (species or strain) of BioGRID. The ten most common model organisms have short names: `human` (*Homo sapiens*), `yeast` (the budding yeast *Saccharomyces cerevisiae*, strain S288c), `fission_yeast` (*Schizosaccharomyces pombe*, strain 972h-), `mouse` (*Mus musculus*), `fly` (*Drosophila melanogaster*), `worm` (*Caenorhabditis elegans*), `arabidopsis` (*Arabidopsis thaliana*, Columbia), `ecoli` (*Escherichia coli*, strain K-12 W3110), `rat` (*Rattus norvegicus*) and `zebrafish` (*Danio rerio*). The networks of the other organisms are named after the organism files of BioGRID, in lower case, e.g. `candida_albicans_sc5314`, `plasmodium_falciparum_3d7`, `xenopus_laevis`, `escherichia_coli_k12_mg1655` (another strain of *E. coli*) or `severe_acute_respiratory_syndrome_coronavirus_2`. Organisms without any interaction among their own genes have no network, and many networks of the less studied organisms have only a handful of edges.
+
+The viruses are an exception: since their interactions are mostly with the proteins of their hosts (mostly human), the network of a virus contains all the interactions in which at least one of the interactors belongs to the virus, so that it also contains host proteins, and the nodes have the properties `taxid`, `organism` and `is_virus` (see below). The viruses are the organisms of BioGRID whose names contain "virus" (e.g. `human_immunodeficiency_virus_1`, `human_papillomavirus_16`, `severe_acute_respiratory_syndrome_coronavirus_2`, `tobacco_mosaic_virus`); the taxonomy identifier of each of them, which BioGRID gives for each interactor, belongs to the superkingdom Viruses in the NCBI taxonomy, and appears in every interaction of its file. The networks of the other organisms contain only the interactions between their own genes.
+
+These are the networks of the current release, 5.0.262 (September 2026, 88 organisms, 42 of them viruses). The entry also contains the networks of the last release of each earlier major version of BioGRID, named `<organism>_v<release>`, e.g. `human_v4.4.249`: release 4.4.249 (August 2025, 88 organisms), release 3.5.188 (July 2020, 67 organisms) and release 2.0.63 (March 2010, 15 organisms; its budding yeast, fission yeast and *Arabidopsis* are not identified by strain, and have the same short names as in the later releases). The other releases (about 240) are not included.
+
+Nodes are genes, and each edge is one interaction record of BioGRID: an interaction between two genes found by a given experimental system (e.g. two-hybrid, affinity capture followed by mass spectrometry, synthetic lethality) in a given publication, so that two genes can be connected by several edges. Edges are directed from interactor A to interactor B of the record: BioGRID records interactions with a bait-hit directionality (e.g. the bait and the prey of an affinity capture or two-hybrid experiment, or the protein exerting a biochemical activity and its substrate), which for some experimental systems is arbitrary or up to the curator. Self-loops (e.g. proteins forming homodimers) are kept. The edges are divided in two layers, physical and genetic interactions. Except for the viruses, only interactions where both genes belong to the organism of the network are included; interactions with genes of other organisms (e.g. host-pathogen interactions, 113,903 records in the human data) are left out. Other attributes of the records (e.g. their qualifications, tags, ontology terms, and the protein accessions of the genes) are also left out.
+
+The files of release 2.0.63 are in an older format, with fewer attributes: they identify genes by an identifier of their own (e.g. `ETG324243` for the Entrez Gene 324243, or the systematic name, e.g. `YDR001C`), and give neither the BioGRID identifiers of genes and interactions, nor the type of interaction (physical or genetic), which is set here from the experimental system, as in the later releases (all the experimental systems of 2.0.63 exist in the later releases, each with a single type).
+
+See also the `yeast_biogrid_2007` entry (yeast protein interactions from the 2007 version of BioGRID) and the `genetic_multiplex` entry (multiplex networks of several organisms from the 2014 version of BioGRID, where the layers are the interaction types).
+
+The networks have the following properties:
+
+- `name`: the official symbol of the gene.
+- `systematic_name`: the systematic name of the gene, if any (e.g. the ORF name of yeast genes); not in release 2.0.63.
+- `biogrid_id`: the identifier of the gene in BioGRID; not in release 2.0.63.
+- `entrez_id`: the identifier of the gene in Entrez Gene (-1 if absent); not in release 2.0.63.
+- `taxid` (viruses only): the NCBI taxonomy identifier of the organism of the gene (e.g. 9606 for human genes).
+- `organism` (viruses only, not in release 2.0.63): the name of the organism of the gene, as given by BioGRID (e.g. `Homo sapiens`).
+- `is_virus` (viruses only): whether the gene belongs to the virus of the network (otherwise to another organism, typically its host).
+- `id` (release 2.0.63 only): the identifier of the gene in that release (`ETG` followed by the Entrez Gene identifier, or another identifier, e.g. the systematic name).
+- Edge `layer`: the type of the interaction, `physical` or `genetic`.
+- Edge `experimental_system`: the experimental system that detected the interaction (e.g. `Two-hybrid`, `Affinity Capture-MS`, `Synthetic Lethality`, `Negative Genetic`); see the [BioGRID wiki](https://wiki.thebiogrid.org/doku.php/experimental_systems) for their definitions.
+- Edge `pubmed_id`: the PubMed identifier of the publication reporting the interaction (-1 if the publication is identified by its DOI instead).
+- Edge `author`: the first author and year of the publication, e.g. `Xu Z (2008)`.
+
+The following edge properties are not given in release 2.0.63:
+
+- Edge `doi`: the DOI of the publication, for publications without a PubMed identifier (empty otherwise).
+- Edge `throughput`: whether the interaction comes from a `High Throughput` or `Low Throughput` experiment (or both, `High Throughput|Low Throughput`).
+- Edge `score`: the quantitative score of the interaction reported by high-throughput studies (NaN if absent).
+- Edge `modification`: the post-translational modification of the substrate, for interactions of the experimental system `Biochemical Activity` (empty otherwise).
+- Edge `interaction_id`: the identifier of the interaction record in BioGRID."""
+tags = ['Biological', 'Protein interactions', 'Genetic', 'Unweighted', 'Multilayer', 'Multigraph', 'Metadata']
+url = 'https://downloads.thebiogrid.org/BioGRID/Release-Archive/'
+citation = [('R. Oughtred, J. Rust, C. Chang, B.-J. Breitkreutz, C. Stark, A. Willems, L. Boucher, G. Leung, N. Kolas, F. Zhang, S. Dolma, J. Coulombe-Huntington, A. Chatr-aryamontri, K. Dolinski, M. Tyers, "The BioGRID database: A comprehensive biomedical resource of curated protein, genetic, and chemical interactions." Protein Science 30(1), 187-200 (2021)', 'https://doi.org/10.1002/pro.3978'),
+ ('C. Stark, B.-J. Breitkreutz, T. Reguly, L. Boucher, A. Breitkreutz, M. Tyers, "BioGRID: a general repository for interaction datasets." Nucleic Acids Research 34(suppl 1), D535-D539 (2006)', 'https://doi.org/10.1093/nar/gkj109')]
+icon_hash = None
+upstream_license = ('MIT License', 'https://opensource.org/license/mit')
+upstream_prefix = 'https://downloads.thebiogrid.org/Download/BioGRID/Release-Archive'
+current = '5.0.262'
+# short names of the model organisms (by the organism names of the files,
+# which in release 2.0.63 do not name the strains)
+short_names = {'Homo_sapiens': 'human',
+ 'Saccharomyces_cerevisiae_S288c': 'yeast',
+ 'Saccharomyces_cerevisiae': 'yeast',
+ 'Schizosaccharomyces_pombe_972h': 'fission_yeast',
+ 'Schizosaccharomyces_pombe': 'fission_yeast',
+ 'Mus_musculus': 'mouse',
+ 'Drosophila_melanogaster': 'fly',
+ 'Caenorhabditis_elegans': 'worm',
+ 'Arabidopsis_thaliana_Columbia': 'arabidopsis',
+ 'Arabidopsis_thaliana': 'arabidopsis',
+ 'Escherichia_coli_K12_W3110': 'ecoli',
+ 'Rattus_norvegicus': 'rat',
+ 'Danio_rerio': 'zebrafish'}
+# the organisms of each release with at least one interaction between their
+# own genes (the files of the other organisms have only interactions with
+# genes of other organisms), and all the viruses
+organisms = {
+ '5.0.262': '''
+ Anas_platyrhynchos Arabidopsis_thaliana_Columbia Bacillus_subtilis_168
+ Bos_taurus Caenorhabditis_elegans Candida_albicans_SC5314
+ Canis_familiaris Cavia_porcellus Chlamydomonas_reinhardtii
+ Chlorocebus_sabaeus Cricetulus_griseus Danio_rerio
+ Dictyostelium_discoideum_AX4 Drosophila_melanogaster
+ Emericella_nidulans_FGSC_A4 Escherichia_coli_K12_MC4100_BW2952
+ Escherichia_coli_K12_MG1655 Escherichia_coli_K12_W3110 Felis_Catus
+ Gallus_gallus Glycine_max Hepatitus_C_Virus Homo_sapiens
+ Human_Herpesvirus_1 Human_Herpesvirus_2 Human_Herpesvirus_3
+ Human_Herpesvirus_4 Human_Herpesvirus_5 Human_Herpesvirus_6A
+ Human_Herpesvirus_6B Human_Herpesvirus_7 Human_Herpesvirus_8
+ Human_Immunodeficiency_Virus_1 Human_Immunodeficiency_Virus_2
+ Human_papillomavirus_10 Human_papillomavirus_11
+ Human_papillomavirus_16 Human_papillomavirus_18
+ Human_papillomavirus_1a Human_papillomavirus_26
+ Human_papillomavirus_31 Human_papillomavirus_32
+ Human_papillomavirus_33 Human_papillomavirus_35
+ Human_papillomavirus_38 Human_papillomavirus_4 Human_papillomavirus_41
+ Human_papillomavirus_45 Human_papillomavirus_5 Human_papillomavirus_52
+ Human_papillomavirus_54 Human_papillomavirus_58
+ Human_papillomavirus_6b Human_papillomavirus_7 Human_papillomavirus_8
+ Human_papillomavirus_9 Leishmania_major_Friedlin Macaca_mulatta
+ Meleagris_gallopavo
+ Middle-East_Respiratory_Syndrome-related_Coronavirus
+ Murid_Herpesvirus_1 Mus_musculus Mycobacterium_tuberculosis_H37Rv
+ Neurospora_crassa_OR74A Nicotiana_tomentosiformis
+ Oryctolagus_cuniculus Oryza_sativa_Japonica Ovis_aries
+ Plasmodium_falciparum_3D7 Rattus_norvegicus
+ Saccharomyces_cerevisiae_S288c Schizosaccharomyces_pombe_972h
+ Selaginella_moellendorffii
+ Severe_acute_respiratory_syndrome_coronavirus
+ Severe_acute_respiratory_syndrome_coronavirus_2
+ Simian_Immunodeficiency_Virus Simian_Virus_40 Solanum_lycopersicum
+ Solanum_tuberosum Sorghum_bicolor Streptococcus_pneumoniae_ATCCBAA255
+ Sus_scrofa Tobacco_Mosaic_Virus Ustilago_maydis_521 Vaccinia_Virus
+ Vitis_vinifera Xenopus_laevis Zea_mays''',
+ '4.4.249': '''
+ Anas_platyrhynchos Arabidopsis_thaliana_Columbia Bacillus_subtilis_168
+ Bos_taurus Caenorhabditis_elegans Candida_albicans_SC5314
+ Canis_familiaris Cavia_porcellus Chlamydomonas_reinhardtii
+ Chlorocebus_sabaeus Cricetulus_griseus Danio_rerio
+ Dictyostelium_discoideum_AX4 Drosophila_melanogaster
+ Emericella_nidulans_FGSC_A4 Escherichia_coli_K12_MC4100_BW2952
+ Escherichia_coli_K12_MG1655 Escherichia_coli_K12_W3110 Felis_Catus
+ Gallus_gallus Glycine_max Hepatitus_C_Virus Homo_sapiens
+ Human_Herpesvirus_1 Human_Herpesvirus_2 Human_Herpesvirus_3
+ Human_Herpesvirus_4 Human_Herpesvirus_5 Human_Herpesvirus_6A
+ Human_Herpesvirus_6B Human_Herpesvirus_7 Human_Herpesvirus_8
+ Human_Immunodeficiency_Virus_1 Human_Immunodeficiency_Virus_2
+ Human_papillomavirus_10 Human_papillomavirus_11
+ Human_papillomavirus_16 Human_papillomavirus_18
+ Human_papillomavirus_1a Human_papillomavirus_26
+ Human_papillomavirus_31 Human_papillomavirus_32
+ Human_papillomavirus_33 Human_papillomavirus_35
+ Human_papillomavirus_38 Human_papillomavirus_4 Human_papillomavirus_41
+ Human_papillomavirus_45 Human_papillomavirus_5 Human_papillomavirus_52
+ Human_papillomavirus_54 Human_papillomavirus_58
+ Human_papillomavirus_6b Human_papillomavirus_7 Human_papillomavirus_8
+ Human_papillomavirus_9 Leishmania_major_Friedlin Macaca_mulatta
+ Meleagris_gallopavo
+ Middle-East_Respiratory_Syndrome-related_Coronavirus
+ Murid_Herpesvirus_1 Mus_musculus Mycobacterium_tuberculosis_H37Rv
+ Neurospora_crassa_OR74A Nicotiana_tomentosiformis
+ Oryctolagus_cuniculus Oryza_sativa_Japonica Ovis_aries
+ Plasmodium_falciparum_3D7 Rattus_norvegicus
+ Saccharomyces_cerevisiae_S288c Schizosaccharomyces_pombe_972h
+ Selaginella_moellendorffii
+ Severe_acute_respiratory_syndrome_coronavirus
+ Severe_acute_respiratory_syndrome_coronavirus_2
+ Simian_Immunodeficiency_Virus Simian_Virus_40 Solanum_lycopersicum
+ Solanum_tuberosum Sorghum_bicolor Streptococcus_pneumoniae_ATCCBAA255
+ Sus_scrofa Tobacco_Mosaic_Virus Ustilago_maydis_521 Vaccinia_Virus
+ Vitis_vinifera Xenopus_laevis Zea_mays''',
+ '3.5.188': '''
+ Arabidopsis_thaliana_Columbia Bacillus_subtilis_168 Bos_taurus
+ Caenorhabditis_elegans Candida_albicans_SC5314 Canis_familiaris
+ Cavia_porcellus Chlamydomonas_reinhardtii Chlorocebus_sabaeus
+ Cricetulus_griseus Danio_rerio Dictyostelium_discoideum_AX4
+ Drosophila_melanogaster Emericella_nidulans_FGSC_A4
+ Escherichia_coli_K12_MC4100_BW2952 Escherichia_coli_K12_MG1655
+ Escherichia_coli_K12_W3110 Gallus_gallus Glycine_max Hepatitus_C_Virus
+ Homo_sapiens Human_Herpesvirus_1 Human_Herpesvirus_2
+ Human_Herpesvirus_3 Human_Herpesvirus_4 Human_Herpesvirus_5
+ Human_Herpesvirus_6A Human_Herpesvirus_6B Human_Herpesvirus_7
+ Human_Herpesvirus_8 Human_Immunodeficiency_Virus_1
+ Human_Immunodeficiency_Virus_2 Human_papillomavirus_10
+ Human_papillomavirus_16 Human_papillomavirus_32 Human_papillomavirus_5
+ Human_papillomavirus_6b Human_papillomavirus_9
+ Leishmania_major_Friedlin Macaca_mulatta Meleagris_gallopavo
+ Middle-East_Respiratory_Syndrome-related_Coronavirus Mus_musculus
+ Mycobacterium_tuberculosis_H37Rv Nicotiana_tomentosiformis
+ Oryctolagus_cuniculus Oryza_sativa_Japonica Ovis_aries
+ Plasmodium_falciparum_3D7 Rattus_norvegicus
+ Saccharomyces_cerevisiae_S288c Schizosaccharomyces_pombe_972h
+ Selaginella_moellendorffii
+ Severe_acute_respiratory_syndrome_coronavirus
+ Severe_acute_respiratory_syndrome_coronavirus_2
+ Simian_Immunodeficiency_Virus Simian_Virus_40 Solanum_lycopersicum
+ Solanum_tuberosum Streptococcus_pneumoniae_ATCCBAA255 Sus_scrofa
+ Tobacco_Mosaic_Virus Ustilago_maydis_521 Vaccinia_Virus Vitis_vinifera
+ Xenopus_laevis Zea_mays''',
+ '2.0.63': '''
+ Arabidopsis_thaliana Bacillus_subtilis_168 Bos_taurus
+ Caenorhabditis_elegans Canis_familiaris Danio_rerio
+ Drosophila_melanogaster Gallus_gallus Homo_sapiens Human_Herpesvirus_1
+ Mus_musculus Rattus_norvegicus Saccharomyces_cerevisiae
+ Schizosaccharomyces_pombe Xenopus_laevis''',
+}
+organisms = {v: x.split() for v, x in organisms.items()}
+
+# The viruses: the organisms of BioGRID whose names contain "virus", with the
+# NCBI taxonomy identifiers of the viruses (all in the superkingdom Viruses,
+# taxid 10239, of the NCBI taxonomy). Their networks contain all their
+# interactions, including those with the proteins of their hosts.
+virus_taxids = {
+ 'Hepatitus_C_Virus': 11103, 'Human_Herpesvirus_1': 10298,
+ 'Human_Herpesvirus_2': 10310, 'Human_Herpesvirus_3': 10335,
+ 'Human_Herpesvirus_4': 10376, 'Human_Herpesvirus_5': 10359,
+ 'Human_Herpesvirus_6A': 32603, 'Human_Herpesvirus_6B': 32604,
+ 'Human_Herpesvirus_7': 10372, 'Human_Herpesvirus_8': 37296,
+ 'Human_Immunodeficiency_Virus_1': 11676, 'Human_Immunodeficiency_Virus_2': 11709,
+ 'Human_papillomavirus_1a': 10583, 'Human_papillomavirus_4': 10617,
+ 'Human_papillomavirus_5': 333923, 'Human_papillomavirus_6b': 10600,
+ 'Human_papillomavirus_7': 10620, 'Human_papillomavirus_8': 10579,
+ 'Human_papillomavirus_9': 10621, 'Human_papillomavirus_10': 333759,
+ 'Human_papillomavirus_11': 10580, 'Human_papillomavirus_16': 333760,
+ 'Human_papillomavirus_18': 333761, 'Human_papillomavirus_26': 333762,
+ 'Human_papillomavirus_31': 10585, 'Human_papillomavirus_32': 333763,
+ 'Human_papillomavirus_33': 10586, 'Human_papillomavirus_35': 10587,
+ 'Human_papillomavirus_38': 37959, 'Human_papillomavirus_41': 10589,
+ 'Human_papillomavirus_45': 10593, 'Human_papillomavirus_52': 10618,
+ 'Human_papillomavirus_54': 333766, 'Human_papillomavirus_58': 10598,
+ 'Middle-East_Respiratory_Syndrome-related_Coronavirus': 1335626, 'Murid_Herpesvirus_1': 10366,
+ 'Severe_acute_respiratory_syndrome_coronavirus': 694009, 'Severe_acute_respiratory_syndrome_coronavirus_2': 2697049,
+ 'Simian_Immunodeficiency_Virus': 11723, 'Simian_Virus_40': 10633,
+ 'Tobacco_Mosaic_Virus': 12242, 'Vaccinia_Virus': 10245,
+}
+
+def _organism(fname):
+ "The organism of an upstream file."
+ return re.match(r".*:BIOGRID-ORGANISM-(.*)-[0-9.]+\.tab3?\.txt$", fname).group(1)
+
+def _alt(org, release):
+ name = short_names.get(org, org.lower())
+ return name if release == current else f"{name}_v{release}"
+
+def _fname(org, release):
+ ext = "tab" if release.startswith("2.") else "tab3"
+ return (f'BIOGRID-ORGANISM-{release}.{ext}.zip:'
+ f'BIOGRID-ORGANISM-{org}-{release}.{ext}.txt')
+
+# the networks of the ten model organisms of the current release first, in
+# their original order
+_first = ['Homo_sapiens', 'Saccharomyces_cerevisiae_S288c',
+ 'Schizosaccharomyces_pombe_972h', 'Mus_musculus',
+ 'Drosophila_melanogaster', 'Caenorhabditis_elegans',
+ 'Arabidopsis_thaliana_Columbia', 'Escherichia_coli_K12_W3110',
+ 'Rattus_norvegicus', 'Danio_rerio']
+files = [(_fname(o, current), _alt(o, current), None) for o in _first]
+files += [(_fname(o, current), _alt(o, current), None)
+ for o in organisms[current] if o not in _first]
+files += [(_fname(o, r), _alt(o, r), None)
+ for r in ["4.4.249", "3.5.188", "2.0.63"] for o in organisms[r]]
+assert len(set(alt for f, alt, fmt in files)) == len(files)
+
+# the type of interaction of the experimental systems, for release 2.0.63
+# (as in the later releases)
+system_types = {
+ 'physical': ['Affinity Capture-Luminescence', 'Affinity Capture-MS',
+ 'Affinity Capture-RNA', 'Affinity Capture-Western',
+ 'Biochemical Activity', 'Co-crystal Structure',
+ 'Co-fractionation', 'Co-localization', 'Co-purification',
+ 'FRET', 'Far Western', 'PCA', 'Protein-RNA',
+ 'Protein-peptide', 'Reconstituted Complex', 'Two-hybrid'],
+ 'genetic': ['Dosage Growth Defect', 'Dosage Lethality', 'Dosage Rescue',
+ 'Negative Genetic', 'Phenotypic Enhancement',
+ 'Phenotypic Suppression', 'Positive Genetic',
+ 'Synthetic Growth Defect', 'Synthetic Haploinsufficiency',
+ 'Synthetic Lethality', 'Synthetic Rescue']}
+system_type = {x: t for t, xs in system_types.items() for x in xs}
+
+def fetch_upstream(force=False):
+ # the files of each release are in a directory of their own
+ name = __name__.split(".")[-1]
+ for r in organisms:
+ fetch_upstream_files(name, f"{upstream_prefix}/BIOGRID-{r}",
+ [x for x in files if f"-{r}." in x[0]], force)
+
+def na(x, default=""):
+ "BioGRID's empty value, '-', as `default`."
+ return default if x == "-" else x
+
+def _parse_tab(name, fname):
+ """A network of release 2.0.63, in the older tab format."""
+ g = Graph(directed=True)
+ idx = {}
+ genes = []
+ edges = []
+ eprops = defaultdict(list)
+ virus = virus_taxids.get(_organism(fname))
+ with open_upstream_file(name, fname, "r") as f:
+ for line in f:
+ if line.startswith("INTERACTOR_A\t"):
+ break
+ else:
+ raise ValueError(f"no header in {fname}")
+ header = line.rstrip("\n").split("\t")
+ assert header == ["INTERACTOR_A", "INTERACTOR_B", "OFFICIAL_SYMBOL_A",
+ "OFFICIAL_SYMBOL_B", "ALIASES_FOR_A", "ALIASES_FOR_B",
+ "EXPERIMENTAL_SYSTEM", "SOURCE", "PUBMED_ID",
+ "ORGANISM_A_ID", "ORGANISM_B_ID"], header
+ for line in f:
+ r = line.rstrip("\n").split("\t")
+ if not r[0]:
+ continue
+ taxa = (int(r[9]), int(r[10]))
+ if virus is None:
+ # Interactions with genes of other organisms are left out
+ if taxa[0] != taxa[1]:
+ continue
+ else:
+ # all the interactions of the virus
+ assert virus in taxa, (fname, taxa)
+ vs = []
+ for i in range(2):
+ if r[i] not in idx:
+ idx[r[i]] = len(genes)
+ genes.append((r[2 + i], r[i], taxa[i]))
+ vs.append(idx[r[i]])
+ edges.append(vs)
+ eprops["layer"].append(system_type[r[6]])
+ eprops["experimental_system"].append(r[6])
+ eprops["author"].append(r[7])
+ eprops["pubmed_id"].append(int(r[8].strip()))
+ g.add_vertex(len(genes))
+ g.vp.name = g.new_vp("string", vals=[x[0] for x in genes])
+ g.vp.id = g.new_vp("string", vals=[x[1] for x in genes])
+ if virus is not None:
+ g.vp.taxid = g.new_vp("int", vals=[x[2] for x in genes])
+ g.vp.is_virus = g.new_vp("bool", vals=[x[2] == virus for x in genes])
+ g.add_edge_list(edges)
+ for k, t in [("layer", "string"), ("experimental_system", "string"),
+ ("pubmed_id", "int64_t"), ("author", "string")]:
+ g.ep[k] = g.new_ep(t, vals=eprops.pop(k))
+ return g
+
+@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 ".tab.zip:" in fnames:
+ yield alt, _parse_tab(name, fnames)
+ continue
+ g = Graph(directed=True)
+ idx = {}
+ genes = []
+ edges = []
+ eprops = defaultdict(list)
+ virus = virus_taxids.get(_organism(fnames))
+ with open_upstream_file(name, fnames, "r") as f:
+ header = next(f).lstrip("#").rstrip("\n").split("\t")
+ col = {h: i for i, h in enumerate(header)}
+ for line in f:
+ r = line.rstrip("\n").split("\t")
+ if not r[0]:
+ continue
+ taxa = (int(r[col["Organism ID Interactor A"]]),
+ int(r[col["Organism ID Interactor B"]]))
+ if virus is None:
+ # Interactions with genes of other organisms are left out
+ if taxa[0] != taxa[1]:
+ continue
+ else:
+ # all the interactions of the virus
+ assert virus in taxa, (fnames, taxa)
+ vs = []
+ for i, s in enumerate("AB"):
+ bid = int(r[col[f"BioGRID ID Interactor {s}"]])
+ if bid not in idx:
+ idx[bid] = len(genes)
+ genes.append((r[col[f"Official Symbol Interactor {s}"]],
+ na(r[col[f"Systematic Name Interactor {s}"]]),
+ bid,
+ int(na(r[col[f"Entrez Gene Interactor {s}"]], -1)),
+ taxa[i],
+ r[col[f"Organism Name Interactor {s}"]]))
+ vs.append(idx[bid])
+ edges.append(vs)
+ eprops["layer"].append(r[col["Experimental System Type"]])
+ eprops["experimental_system"].append(r[col["Experimental System"]])
+ src, pub = r[col["Publication Source"]].split(":", 1)
+ if src == "PUBMED":
+ eprops["pubmed_id"].append(int(pub))
+ eprops["doi"].append("")
+ else:
+ assert src == "DOI", src
+ eprops["pubmed_id"].append(-1)
+ eprops["doi"].append(pub)
+ eprops["author"].append(r[col["Author"]])
+ eprops["throughput"].append(r[col["Throughput"]])
+ eprops["score"].append(float(na(r[col["Score"]], "nan")))
+ eprops["modification"].append(na(r[col["Modification"]]))
+ eprops["interaction_id"].append(int(r[col["BioGRID Interaction ID"]]))
+
+ g.add_vertex(len(genes))
+ for i, (k, t) in enumerate([("name", "string"), ("systematic_name", "string"),
+ ("biogrid_id", "int"), ("entrez_id", "int64_t")]):
+ g.vp[k] = g.new_vp(t, vals=[x[i] for x in genes])
+ if virus is not None:
+ g.vp.taxid = g.new_vp("int", vals=[x[4] for x in genes])
+ g.vp.organism = g.new_vp("string", vals=[x[5] for x in genes])
+ g.vp.is_virus = g.new_vp("bool", vals=[x[4] == virus for x in genes])
+ g.add_edge_list(edges)
+ for k, t in [("layer", "string"), ("experimental_system", "string"),
+ ("pubmed_id", "int64_t"), ("doi", "string"),
+ ("author", "string"), ("throughput", "string"),
+ ("score", "double"), ("modification", "string"),
+ ("interaction_id", "int64_t")]:
+ g.ep[k] = g.new_ep(t, vals=eprops.pop(k))
+ g = Graph(g, vorder=g.vp.biogrid_id)
+ yield alt, g