AI Decision System
Replayable, offline-verifiable records for AI-assisted go/no-go decisions: experiment promotions, typed model answers and human-approved actions.
단백질 그래프 라이브러리
Protein Graph Library
개발 도구Jupyter Notebook · PythonGitHub @a-r-j직접 설치운영자 미확인
써 보셨어요? 한 번만 눌러 주세요. 로그인은 필요 없어요.
개인 계정의 공개 저장소 소유자는 GitHub로 로그인해 운영자를 확인하고 소개를 직접 관리할 수 있습니다. 관리자 승인은 필요하지 않습니다.
로그인한 뒤 확인 파일을 만들어 이 저장소의 기본 브랜치에 30분 안에 커밋해 주세요. 다른 브랜치나 포크의 파일은 인정하지 않습니다. 파일을 올린 뒤 아래에서 확인하면 관리자 승인 없이 관리할 수 있습니다. 자격을 유지하려면 파일을 남겨 두세요.
로그인이 필요하면 로그인 화면으로 이동합니다. 로그인 후 이곳으로 돌아와 원하는 확인 버튼을 다시 눌러 주세요.
설치형 프로젝트는 배포 도메인 없이도 확인할 수 있습니다. 개인 저장소는 GitHub 로그인으로, 조직 저장소는 위의 저장소 확인 파일로 직접 확인해 주세요.
메이커가 쓴 소개는 위의 한 줄이 전부입니다. 더 자세한 내용은 저장소 README에서 읽을 수 있습니다. 저장소 README ↗
README 전체를 불러오는 중입니다.
README 전문 보기 ↗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.
Graphein provides both a programmatic API and a command-line interface for constructing graphs.
Graphein configs can be specified as .yaml files to batch process graphs from the command line.
graphein -c config.yaml -p path/to/pdbs -o path/to/output
| 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")
| 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)
| Tutorial | Docs |
from graphein.protein.config import ProteinMeshConfig
from graphein.protein.meshes import create_mesh
config = ProteinMeshConfig()
verts, faces, aux = create_mesh(pdb_code="3eiy", config=config)
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
config = MoleculeGraphConfig()
g = construct_graph(smiles="CC(=O)OC1=CC=CC=C1C(=O)O", config=config)
| Tutorial | Docs |
from graphein.rna.graphs import construct_rna_graph
# Build the graph from a dotbracket & optional sequence
rna = construct_rna_graph(dotbracket='..(((((..(((...)))..)))))...',
sequence='UUGGAGUACACAACCUGUACACUCUUUC')
| Tutorial | Docs |
from graphein.ppi.config import PPIGraphConfig
from graphein.ppi.graphs import compute_ppi_graph
from graphein.ppi.edges import add_string_edges, add_biogrid_edges
config = PPIGraphConfig()
protein_list = ["CDC42", "CDK1", "KIF23", "PLK1", "RAC2", "RACGAP1", "RHOA", "RHOB"]
g = compute_ppi_graph(config=config,
protein_list=protein_list,
edge_construction_funcs=[add_string_edges, add_biogrid_edges]
)
| Tutorial | Docs |
from functools import partial
from graphein.grn.config import GRNGraphConfig
from graphein.grn.graphs import compute_grn_graph
from graphein.grn.edges import add_regnetwork_edges, add_trrust_edges
config = GRNGraphConfig()
gene_list = ["AATF", "MYC", "USF1", "SP1", "TP53", "DUSP1"]
g = compute_grn_graph(
gene_list=gene_list,
edge_construction_funcs=[
partial(add_trrust_edges, trrust_filtering_funcs=config.trrust_config.filtering_functions),
partial(add_regnetwork_edges, regnetwork_filtering_funcs=config.regnetwork_config.filtering_functions),
],
)
The 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
pip install graphein # For base install
pip install graphein[extras] # For additional featurisation dependencies
pip install graphein[dev] # For dev dependencies
pip install graphein[all] # To get the lot
Install uv, then from a clone of this repository:
git clone https://www.github.com/a-r-j/graphein
cd graphein
uv sync # base install (editable)
uv sync --extra extras # optional featurisation dependencies
uv sync --extra dev --extra extras # development environment
uv sync --all-extras # dev + extras + docs
Run commands inside the project environment with uv run, e.g. uv run pytest.
However, there are a number of (optional) utilities (DSSP, PyMol, GetContacts) that are not available via PyPI:
conda install -c salilab dssp # Required for computing secondary structural features
conda install -c schrodinger pymol # Required for PyMol visualisations & mesh generation
# GetContacts - used as an alternative way to compute intramolecular interactions
conda install -c conda-forge vmd-python
git clone https://github.com/getcontacts/getcontacts
# Add folder to PATH
echo "export PATH=\$PATH:`pwd`/getcontacts" >> ~/.bashrc
source ~/.bashrc
# To test the installation, run:
cd getcontacts/example/5xnd
get_dynamic_contacts.py --topology 5xnd_topology.pdb \
--trajectory 5xnd_trajectory.dcd \
--itypes hb \
--output 5xnd_hbonds.tsv
The dev environment includes GPU Builds (CUDA 11.1) for each of the deep learning libraries integrated into graphein.
git clone https://www.github.com/a-r-j/graphein
cd graphein
conda env create -f environment-dev.yml
uv sync --all-extras
A lighter install can be performed with:
git clone https://www.github.com/a-r-j/graphein
cd graphein
conda env create -f environment.yml
uv sync
We 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 installed. Ensure that you install the locally mounted volume after entering the container (uv sync --all-extras or pip install -e ".[dev,extras]"). This will also set up the dev environment locally.
To build (GPU) run:
docker-compose up -d --build # start the container
docker-compose down # stop the container
Please consider citing graphein if it proves useful in your work.
@inproceedings{jamasb2022graphein,
title={Graphein - a Python Library for Geometric Deep Learning and Network Analysis on Biomolecular Structures and Interaction Networks},
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},
booktitle={Advances in Neural Information Processing Systems},
editor={Alice H. Oh and Alekh Agarwal and Danielle Belgrave and Kyunghyun Cho},
year={2022},
url={https://openreview.net/forum?id=9xRZlV6GfOX}
}
| 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! |