Graphein
Protein Graph Library
Install / Use
/learn @a-r-j/GrapheinREADME
<a href="https://github.com/psf/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
<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 | |
| 1.7.0 | Creating Datasets from the PDB |
|
| 1.6.0 | Protein Tensor Module |
|
| 1.5.0 | Protein Graph Creation from AlphaFold2! |
|
| 1.5.0 | RNA Graph Construction from Dotbracket notation |
|
| 1.4.0 | Constructing molecular graphs |
|
| 1.3.0 | Ready-to-go Dataloaders for PyTorch Geometric |
|
| 1.2.0 | Extracting subgraphs from protein graphs |
|
| 1.2.0 | Protein Graph Analytics |
|
| 1.2.0 | Graphein CLI | |
| 1.2.0 |Protein Graph Visualisation! |
| 1.1.0 | Protein - Protein Interaction Network Support & Structural Interactomics (Using AlphaFold2!) |
|
| 1.0.0 | High and Low-level API for massive flexibility - create your own bespoke workflows! |
|
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.
graphein -c config.yaml -p path/to/pdbs -o path/to/output
Creating a Protein Graph
| | | |
|---|---|---|
Tutorial (Residue-level) | Tutorial (Atomic) | Docs
| |
| |
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 |
| |
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 |
| | |
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 |
| | |
from graphein.molecule.config import MoleculeGraphConfig
from graphein.molecule.graphs import construct_graph
g = create_graph(sm
