{"id":13687636,"url":"https://github.com/a-r-j/graphein","last_synced_at":"2025-05-14T03:09:27.297Z","repository":{"id":37383238,"uuid":"205016265","full_name":"a-r-j/graphein","owner":"a-r-j","description":"Protein Graph Library","archived":false,"fork":false,"pushed_at":"2025-03-03T20:43:20.000Z","size":91006,"stargazers_count":1084,"open_issues_count":52,"forks_count":134,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-04-14T10:42:32.301Z","etag":null,"topics":["bioinformatics","computational-biology","deep-learning","dgl","drug-discovery","gene-regulatory-networks","geometric-deep-learning","graph-neural-networks","interactome","interactomics","ppi-networks","protein","protein-data-bank","protein-design","protein-structure","python","pytorch","pytorch-geometric","rna","structural-biology"],"latest_commit_sha":null,"homepage":"https://graphein.ai/","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/a-r-j.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"citation.bib","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["a-r-j"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2019-08-28T20:20:11.000Z","updated_at":"2025-04-14T08:07:04.000Z","dependencies_parsed_at":"2023-02-12T06:16:19.893Z","dependency_job_id":"6b020166-ce85-441c-9b0b-63769f5a63c9","html_url":"https://github.com/a-r-j/graphein","commit_stats":{"total_commits":679,"total_committers":29,"mean_commits":"23.413793103448278","dds":"0.27393225331369664","last_synced_commit":"40fd0d480b4cbefda2e514e391e78362d24df116"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-r-j%2Fgraphein","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-r-j%2Fgraphein/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-r-j%2Fgraphein/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-r-j%2Fgraphein/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/a-r-j","download_url":"https://codeload.github.com/a-r-j/graphein/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254059509,"owners_count":22007768,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bioinformatics","computational-biology","deep-learning","dgl","drug-discovery","gene-regulatory-networks","geometric-deep-learning","graph-neural-networks","interactome","interactomics","ppi-networks","protein","protein-data-bank","protein-design","protein-structure","python","pytorch","pytorch-geometric","rna","structural-biology"],"created_at":"2024-08-02T15:00:57.862Z","updated_at":"2025-05-14T03:09:22.283Z","avatar_url":"https://github.com/a-r-j.png","language":"Jupyter Notebook","funding_links":["https://github.com/sponsors/a-r-j"],"categories":["Jupyter Notebook","Machine Learning"],"sub_categories":[],"readme":"[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/a-r-j/graphein-binder/master?urlpath=git-pull%3Frepo%3Dhttps%253A%252F%252Fgithub.com%252Fa-r-j%252Fgraphein%26urlpath%3Dlab%252Ftree%252Fgraphein%252Fnotebooks%26branch%3Dmaster)\n[![PyPI version](https://badge.fury.io/py/graphein.svg)](https://badge.fury.io/py/graphein)\n![supported python versions](https://img.shields.io/pypi/pyversions/graphein)\n[![Docs](https://assets.readthedocs.org/static/projects/badges/passing-flat.svg)](http://www.graphein.ai)\n[![DOI:10.1101/2020.07.15.204701](https://zenodo.org/badge/DOI/10.1101/2020.07.15.204701.svg)](https://doi.org/10.1101/2020.07.15.204701)\n[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) [![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)\n[![CodeFactor](https://www.codefactor.io/repository/github/a-r-j/graphein/badge)](https://www.codefactor.io/repository/github/a-r-j/graphein)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=a-r-j_graphein\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=a-r-j_graphein)\n[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=a-r-j_graphein\u0026metric=bugs)](https://sonarcloud.io/dashboard?id=a-r-j_graphein)\n[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=a-r-j_graphein\u0026metric=sqale_rating)](https://sonarcloud.io/dashboard?id=a-r-j_graphein)\n[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=a-r-j_graphein\u0026metric=reliability_rating)](https://sonarcloud.io/dashboard?id=a-r-j_graphein)\n[![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/graphein)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\u003ca href=\"https://github.com/psf/black\"\u003e\u003cimg alt=\"Code style: black\" src=\"https://img.shields.io/badge/code%20style-black-000000.svg\"\u003e\u003c/a\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.graphein.ai/#gh-light-mode-only\"\u003e\n    \u003cimg src=\"./imgs/graphein.png\" width=\"100%\"/\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.graphein.ai/#gh-dark-mode-only\"\u003e\n    \u003cimg src=\"./imgs/graphein_dark.png\" width=\"100%\"/\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cbr\u003e\u003c/br\u003e\n\n[Documentation](http://www.graphein.ai) | [Paper](https://proceedings.neurips.cc/paper_files/paper/2022/hash/ade039c1db0391106a3375bd2feb310a-Abstract-Conference.html) | [Tutorials](http://graphein.ai/notebooks_index.html) | [Installation](#installation)\n\nProtein \u0026 Interactomic Graph Library\n\nThis package provides functionality for producing geometric representations of protein and RNA structures, and biological interaction networks. We provide compatibility with standard PyData formats, as well as graph objects designed for ease of use with popular deep learning libraries.\n\n## What's New?\n\n|   |   |   |\n|---|---|---|\n| 1.7.0 | [FoldComp Datasets](http://graphein.ai/notebooks/foldcomp.html)  |  [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/a-r-j/graphein/blob/master/notebooks/foldcomp.ipynb)   |\n| 1.7.0 | [Creating Datasets from the PDB](http://graphein.ai/notebooks/creating_datasets_from_the_pdb.html)  |  [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/a-r-j/graphein/blob/master/notebooks/creating_datasets_from_the_pdb.ipynb)   |\n| 1.6.0 | [Protein Tensor Module](http://graphein.ai/notebooks/protein_tensors.html)  |  [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/a-r-j/graphein/blob/master/notebooks/protein_tensors.ipynb)   |\n| 1.5.0 | [Protein Graph Creation from AlphaFold2!](http://graphein.ai/notebooks/alphafold_protein_graph_tutorial.html)  | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/a-r-j/graphein/blob/master/notebooks/residue_graphs.ipynb) |\n| 1.5.0 | [RNA Graph Construction from Dotbracket notation](http://graphein.ai/modules/graphein.rna.html) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/a-r-j/graphein/blob/master/notebooks/rna_graph_tutorial.ipynb) |\n| 1.4.0 | [Constructing molecular graphs](http://graphein.ai/notebooks/molecule_tutorial.html)  |  [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/a-r-j/graphein/blob/master/notebooks/molecule_tutorial.ipynb)   |\n| 1.3.0 | [Ready-to-go Dataloaders for PyTorch Geometric](http://graphein.ai/notebooks/dataloader_tutorial.html)  |  [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/a-r-j/graphein/blob/master/notebooks/dataloader_tutorial.ipynb)   |\n| 1.2.0 | [Extracting subgraphs from protein graphs](http://graphein.ai/notebooks/subgraphing_tutorial.html)  |  [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/a-r-j/graphein/blob/master/notebooks/subgraphing_tutorial.ipynb)   |\n| 1.2.0 | [Protein Graph Analytics](http://graphein.ai/notebooks/protein_graph_analytics.html)  |  [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/a-r-j/graphein/blob/master/notebooks/protein_graph_analytics.ipynb) |\n| 1.2.0 | [Graphein CLI](http://graphein.ai/getting_started/usage.html)  |   |\n| 1.2.0 |[Protein Graph Visualisation!](http://graphein.ai/notebooks/interactive_plotly_example.html) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/a-r-j/graphein/blob/master/notebooks/interactive_plotly_example.ipynb)\n| 1.1.0 | [Protein - Protein Interaction Network Support \u0026 Structural Interactomics (Using AlphaFold2!)](http://graphein.ai/notebooks/ppi_tutorial.html) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/a-r-j/graphein/blob/master/notebooks/ppi_graph.ipynb) |\n| 1.0.0 | [High and Low-level API for massive flexibility - create your own bespoke workflows!](http://graphein.ai/notebooks/residue_graphs.html) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/a-r-j/graphein/blob/master/notebooks/residue_graphs.ipynb) |\n\n## Example usage\n\nGraphein provides both a programmatic API and a command-line interface for constructing graphs.\n\n### CLI\n\nGraphein configs can be specified as `.yaml` files to batch process graphs from the commandline.\n\n[Docs](http://graphein.ai/getting_started/usage.html)\n\n```bash\ngraphein -c config.yaml -p path/to/pdbs -o path/to/output\n```\n\n### Creating a Protein Graph\n\n|   |   |   |\n|---|---|---|\n[Tutorial (Residue-level)](http://graphein.ai/notebooks/residue_graphs.html) | [Tutorial (Atomic)](http://graphein.ai/notebooks/atom_graph_tutorial.html) | [Docs](http://graphein.ai/modules/graphein.protein.html#module-graphein.protein.graphs)\n| [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/a-r-j/graphein/blob/master/notebooks/residue_graphs.ipynb) | [![Open In Colab(https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/a-r-j/graphein/blob/master/notebooks/atom_graph_tutorial.ipynb) | |\n\n```python\nfrom graphein.protein.config import ProteinGraphConfig\nfrom graphein.protein.graphs import construct_graph\n\nconfig = ProteinGraphConfig()\ng = construct_graph(config=config, pdb_code=\"3eiy\")\n```\n\n### Creating a Protein Graph from the AlphaFold Protein Structure Database\n\n|   |   |\n|---|---|\n| [Tutorial](http://graphein.ai/notebooks/alphafold_protein_graph_tutorial.html) | [Docs](http://graphein.ai/modules/graphein.protein.html#module-graphein.protein.graphs) |\n| [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/a-r-j/graphein/blob/master/notebooks/alphafold_protein_graph_tutorial.ipynb)|\n\n```python\nfrom graphein.protein.config import ProteinGraphConfig\nfrom graphein.protein.graphs import construct_graph\nfrom graphein.protein.utils import download_alphafold_structure\n\nconfig = ProteinGraphConfig()\nfp = download_alphafold_structure(\"Q5VSL9\", aligned_score=False)\ng = construct_graph(config=config, path=fp)\n```\n\n### Creating a Protein Mesh\n\n|   |   |\n|---|---|\n| [Tutorial](http://graphein.ai/notebooks/protein_mesh_tutorial.html) | [Docs](http://graphein.ai/modules/graphein.protein.html#module-graphein.protein.meshes) |\n| [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/a-r-j/graphein/blob/master/notebooks/protein_mesh_tutorial.ipynb) | |\n\n```python\nfrom graphein.protein.config import ProteinMeshConfig\nfrom graphein.protein.meshes import create_mesh\n\nverts, faces, aux = create_mesh(pdb_code=\"3eiy\", config=config)\n```\n\n### Creating Molecular Graphs\n\nGraphein can create molecular graphs from smiles strings as well as `.sdf`, `.mol2`, and `.pdb` files\n\n|   |   |\n|---|---|\n| [Tutorial](http://graphein.ai/notebooks/molecule_tutorial.html) | [Docs](http://graphein.ai/modules/graphein.molecule.html) |\n| [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/a-r-j/graphein/blob/master/notebooks/molecule_tutorial.ipynb) | |\n\n```python\nfrom graphein.molecule.config import MoleculeGraphConfig\nfrom graphein.molecule.graphs import construct_graph\n\ng = create_graph(smiles=\"CC(=O)OC1=CC=CC=C1C(=O)O\", config=config)\n\n```\n\n### Creating an RNA Graph\n\n|   |   |\n|---|---|\n|[Tutorial](http://graphein.ai/notebooks/rna_notebooks.html) | [Docs](http://graphein.ai/modules/graphein.rna.html) |\n|[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/a-r-j/graphein/blob/master/notebooks/rna_graph_tutorial.ipynb) | |\n\n```python\nfrom graphein.rna.graphs import construct_rna_graph\n# Build the graph from a dotbracket \u0026 optional sequence\nrna = construct_rna_graph(dotbracket='..(((((..(((...)))..)))))...',\n                          sequence='UUGGAGUACACAACCUGUACACUCUUUC')\n```\n\n### Creating a Protein-Protein Interaction Graph\n\n|   |   |\n|---|---|\n| [Tutorial](http://graphein.ai/notebooks/ppi_tutorial.html) | [Docs](http://graphein.ai/modules/graphein.ppi.html) |\n| [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/a-r-j/graphein/blob/master/notebooks/ppi_graph.ipynb)|\n\n```python\nfrom graphein.ppi.config import PPIGraphConfig\nfrom graphein.ppi.graphs import compute_ppi_graph\nfrom graphein.ppi.edges import add_string_edges, add_biogrid_edges\n\nconfig = PPIGraphConfig()\nprotein_list = [\"CDC42\", \"CDK1\", \"KIF23\", \"PLK1\", \"RAC2\", \"RACGAP1\", \"RHOA\", \"RHOB\"]\n\ng = compute_ppi_graph(config=config,\n                      protein_list=protein_list,\n                      edge_construction_funcs=[add_string_edges, add_biogrid_edges]\n                     )\n```\n\n### Creating a Gene Regulatory Network Graph\n\n|   |   |\n|---|---|\n|[Tutorial](http://graphein.ai/notebooks/grn_tutorial.html) | [Docs](http://graphein.ai/modules/graphein.grn.html) |\n| [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/a-r-j/graphein/blob/master/notebooks/grn_tutorial.ipynb) |\n\n```python\nfrom graphein.grn.config import GRNGraphConfig\nfrom graphein.grn.graphs import compute_grn_graph\nfrom graphein.grn.edges import add_regnetwork_edges, add_trrust_edges\n\nconfig = GRNGraphConfig()\ngene_list = [\"AATF\", \"MYC\", \"USF1\", \"SP1\", \"TP53\", \"DUSP1\"]\n\ng = compute_grn_graph(\n    gene_list=gene_list,\n    edge_construction_funcs=[\n        partial(add_trrust_edges, trrust_filtering_funcs=config.trrust_config.filtering_functions),\n        partial(add_regnetwork_edges, regnetwork_filtering_funcs=config.regnetwork_config.filtering_functions),\n    ],\n)\n```\n\n## Installation\n\n### Pip\n\nThe simplest install is via pip. *N.B this does not install ML/DL libraries which are required for conversion to their data formats and for generating protein structure meshes with PyTorch 3D.* [Further details](http://graphein.ai//getting_started/installation.html)\n\n```bash\npip install graphein # For base install\npip install graphein[extras] # For additional featurisation dependencies\npip install graphein[dev] # For dev dependencies\npip install graphein[all] # To get the lot\n```\n\nHowever, there are a number of (optional) utilities ([DSSP](https://anaconda.org/salilab/dssp), [PyMol](https://pymol.org/2/), [GetContacts](https://getcontacts.github.io/)) that are not available via PyPI:\n\n```\nconda install -c salilab dssp # Required for computing secondary structural features\nconda install -c schrodinger pymol # Required for PyMol visualisations \u0026 mesh generation\n\n# GetContacts - used as an alternative way to compute intramolecular interactions\nconda install -c conda-forge vmd-python\ngit clone https://github.com/getcontacts/getcontacts\n\n# Add folder to PATH\necho \"export PATH=\\$PATH:`pwd`/getcontacts\" \u003e\u003e ~/.bashrc\nsource ~/.bashrc\nTo test the installation, run:\n\ncd getcontacts/example/5xnd\nget_dynamic_contacts.py --topology 5xnd_topology.pdb \\\n                        --trajectory 5xnd_trajectory.dcd \\\n                        --itypes hb \\\n                        --output 5xnd_hbonds.tsv\n```\n\n### Conda environment\n\nThe dev environment includes GPU Builds (CUDA 11.1) for each of the deep learning libraries integrated into graphein.\n\n```bash\ngit clone https://www.github.com/a-r-j/graphein\ncd graphein\nconda env create -f environment-dev.yml\npip install -e .\n```\n\nA lighter install can be performed with:\n\n```bash\ngit clone https://www.github.com/a-r-j/graphein\ncd graphein\nconda env create -f environment.yml\npip install -e .\n```\n\n### Dockerfile\n\nWe provide two `docker-compose` files for CPU (`docker-compose.cpu.yml`) and GPU usage (`docker-compose.yml`) locally. For GPU usage please ensure that you have [NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html) installed. Ensure that you install the locally mounted volume after entering the container (`pip install -e .`). This will also setup the dev environment locally.\n\nTo build (GPU) run:\n\n```\ndocker-compose up -d --build # start the container\ndocker-compose down # stop the container\n```\n\n## Citing Graphein\n\nPlease consider citing graphein if it proves useful in your work.\n\n```bibtex\n@inproceedings{jamasb2022graphein,\n  title={Graphein - a Python Library for Geometric Deep Learning and Network Analysis on Biomolecular Structures and Interaction Networks},\n  author={Arian Rokkum Jamasb and Ramon Vi{\\~n}as Torn{\\'e} and Eric J Ma and Yuanqi Du and Charles Harris and Kexin Huang and Dominic Hall and Pietro Lio and Tom Leon Blundell},\n  booktitle={Advances in Neural Information Processing Systems},\n  editor={Alice H. Oh and Alekh Agarwal and Danielle Belgrave and Kyunghyun Cho},\n  year={2022},\n  url={https://openreview.net/forum?id=9xRZlV6GfOX}\n}\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa-r-j%2Fgraphein","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fa-r-j%2Fgraphein","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa-r-j%2Fgraphein/lists"}