SkillAgentSearch skills...

Graphein

Protein Graph Library

Install / Use

/learn @a-r-j/Graphein

README

Binder PyPI version supported python versions Docs DOI:10.1101/2020.07.15.204701 Project Status: Active – The project has reached a stable, usable state and is being actively developed. Project Status: Active – The project has reached a stable, usable state and is being actively developed. CodeFactor Quality Gate Status Bugs Maintainability Rating Reliability Rating Gitter chat License: MIT <a href="https://github.com/psf/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>

<p align="center"> <a href="https://www.graphein.ai/#gh-light-mode-only"> <img src="./imgs/graphein.png" width="100%"/> </a> <a href="https://www.graphein.ai/#gh-dark-mode-only"> <img src="./imgs/graphein_dark.png" width="100%"/> </a> </p>

<br></br>

Documentation | Paper | Tutorials | Installation

Protein & Interactomic Graph Library

This 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.

What's New?

| | | | |---|---|---| | 1.7.0 | FoldComp Datasets | Open In Colab | | 1.7.0 | Creating Datasets from the PDB | Open In Colab | | 1.6.0 | Protein Tensor Module | Open In Colab | | 1.5.0 | Protein Graph Creation from AlphaFold2! | Open In Colab | | 1.5.0 | RNA Graph Construction from Dotbracket notation | Open In Colab | | 1.4.0 | Constructing molecular graphs | Open In Colab | | 1.3.0 | Ready-to-go Dataloaders for PyTorch Geometric | Open In Colab | | 1.2.0 | Extracting subgraphs from protein graphs | Open In Colab | | 1.2.0 | Protein Graph Analytics | Open In Colab | | 1.2.0 | Graphein CLI | | | 1.2.0 |Protein Graph Visualisation! | Open In Colab | 1.1.0 | Protein - Protein Interaction Network Support & Structural Interactomics (Using AlphaFold2!) | Open In Colab | | 1.0.0 | High and Low-level API for massive flexibility - create your own bespoke workflows! | Open In Colab |

Example usage

Graphein provides both a programmatic API and a command-line interface for constructing graphs.

CLI

Graphein configs can be specified as .yaml files to batch process graphs from the commandline.

Docs

graphein -c config.yaml -p path/to/pdbs -o path/to/output

Creating a Protein Graph

| | | | |---|---|---| Tutorial (Residue-level) | Tutorial (Atomic) | Docs | Open In Colab | Open In Colab(https://colab.research.google.com/assets/colab-badge.svg) | |

from graphein.protein.config import ProteinGraphConfig
from graphein.protein.graphs import construct_graph

config = ProteinGraphConfig()
g = construct_graph(config=config, pdb_code="3eiy")

Creating a Protein Graph from the AlphaFold Protein Structure Database

| | | |---|---| | Tutorial | Docs | | Open In Colab|

from graphein.protein.config import ProteinGraphConfig
from graphein.protein.graphs import construct_graph
from graphein.protein.utils import download_alphafold_structure

config = ProteinGraphConfig()
fp = download_alphafold_structure("Q5VSL9", aligned_score=False)
g = construct_graph(config=config, path=fp)

Creating a Protein Mesh

| | | |---|---| | Tutorial | Docs | | Open In Colab | |

from graphein.protein.config import ProteinMeshConfig
from graphein.protein.meshes import create_mesh

verts, faces, aux = create_mesh(pdb_code="3eiy", config=config)

Creating Molecular Graphs

Graphein can create molecular graphs from smiles strings as well as .sdf, .mol2, and .pdb files

| | | |---|---| | Tutorial | Docs | | Open In Colab | |

from graphein.molecule.config import MoleculeGraphConfig
from graphein.molecule.graphs import construct_graph

g = create_graph(sm
View on GitHub
GitHub Stars1.2k
CategoryDesign
Updated4d ago
Forks140

Languages

Jupyter Notebook

Security Score

100/100

Audited on Mar 23, 2026

No findings