-
-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[pre-commit.ci] pre-commit autoupdate (#363)
- Loading branch information
1 parent
40fd0d4
commit 6e0be18
Showing
99 changed files
with
213 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
"""Command line interface for graphein.""" | ||
|
||
import pathlib | ||
import pickle | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
"""Functions for adding edges to Gene Regulatory Networks from various sources.""" | ||
|
||
# %% | ||
# Graphein | ||
# Author: Arian Jamasb <[email protected]>, Ramon Vinas | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
"""Graph construction utilities for Gene Regulatory Networks.""" | ||
|
||
# %% | ||
# Graphein | ||
# Author: Arian Jamasb <[email protected]>, Ramon Vinas | ||
|
@@ -152,11 +153,11 @@ def edge_ann_fn(u, v, d): | |
print(g.edges(data=True)) | ||
|
||
edge_colors = [ | ||
"r" | ||
if g[u][v]["kind"] == {"trrust"} | ||
else "b" | ||
if g[u][v]["kind"] == {"regnetwork"} | ||
else "y" | ||
( | ||
"r" | ||
if g[u][v]["kind"] == {"trrust"} | ||
else "b" if g[u][v]["kind"] == {"regnetwork"} else "y" | ||
) | ||
for u, v in g.edges() | ||
] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
"""Functions for parsing GRNs from RegNetwork.""" | ||
|
||
# %% | ||
# Graphein | ||
# Author: Ramon Vinas, Arian Jamasb <[email protected]> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
"""Utilities for parsing the TRRUST database.""" | ||
|
||
# %% | ||
# Graphein | ||
# Author: Ramon Vinas, Arian Jamasb <[email protected]> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
"""Utilities for converting Graphein Networks to Geometric Deep Learning formats. | ||
""" | ||
|
||
# %% | ||
# Graphein | ||
# Author: Kexin Huang, Arian Jamasb <[email protected]> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
"""Utilities for loading FoldComp databases for deep learning.""" | ||
|
||
# Graphein | ||
# Author: Arian Jamasb <[email protected]> | ||
# License: MIT | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
"""Pytorch Geometric Dataset classes for Protein Graphs.""" | ||
|
||
# Graphein | ||
# Author: Arian Jamasb <[email protected]> | ||
# License: MIT | ||
|
@@ -164,9 +165,9 @@ def __init__( | |
elif self.uniprot_ids: | ||
self.structures = uniprot_ids | ||
self.af_version = af_version | ||
self.bad_pdbs: List[ | ||
str | ||
] = [] # list of pdb codes that failed to download | ||
self.bad_pdbs: List[str] = ( | ||
[] | ||
) # list of pdb codes that failed to download | ||
|
||
# Labels & Chains | ||
self.graph_label_map = graph_label_map | ||
|
@@ -265,9 +266,11 @@ def process(self): | |
|
||
if self.chain_selection_map: | ||
chain_selections = [ | ||
self.chain_selection_map[pdb] | ||
if pdb in self.chain_selection_map.keys() | ||
else "all" | ||
( | ||
self.chain_selection_map[pdb] | ||
if pdb in self.chain_selection_map.keys() | ||
else "all" | ||
) | ||
for pdb in self.structures | ||
] | ||
else: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
"""ML utility Functions for working with graphs.""" | ||
|
||
# Graphein | ||
# Author: Arian Jamasb <[email protected]> | ||
# License: MIT | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
"""Visualisation utils for ML.""" | ||
|
||
from __future__ import annotations | ||
|
||
import itertools | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
These include various collections of standard atom types used molecule-focussed ML | ||
""" | ||
|
||
# Graphein | ||
# Author: Eric J. Ma, Arian Jamasb <[email protected]> | ||
# License: MIT | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
"""Functions for retrieving molecular data from ChEMBL.""" | ||
|
||
from typing import Any, Dict | ||
|
||
import networkx as nx | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
"""Base Config object for use with Molecule Graph Construction.""" | ||
|
||
# Graphein | ||
# Author: Arian Jamasb <[email protected]> | ||
# License: MIT | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
"""Functions for computing atomic structure of molecules.""" | ||
|
||
import networkx as nx | ||
|
||
# %% | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
"""Functions for computing atomic features for molecules.""" | ||
|
||
# %% | ||
# Graphein | ||
# Author: Arian Jamasb <[email protected]> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
"""Functions for featurising Small Molecule Graphs.""" | ||
|
||
# %% | ||
# Graphein | ||
# Author: Arian Jamasb <[email protected]> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
"""Functions for featurising Small Molecule Graphs.""" | ||
|
||
# %% | ||
# Graphein | ||
# Author: Arian Jamasb <[email protected]>, Yuanqi Du | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
"""Functions for working with Small Molecule Graphs.""" | ||
|
||
# %% | ||
# Graphein | ||
# Author: Arian Jamasb <[email protected]>, Eric Ma, Charlie Harris | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
Junction tree code adapted from Wengong Jin https://github.com/wengong-jin/icml18-jtnn | ||
""" | ||
|
||
# Graphein | ||
# Author: Arian Jamasb <[email protected]> | ||
# License: MIT | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
Plotting functions for molecules wrap the methods defined on protein graphs and provide sane defaults. | ||
""" | ||
|
||
# %% | ||
# Graphein | ||
# Author: Arian Jamasb <[email protected]> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
Adapted from smilite (https://github.com/rasbt/smilite) by Sebastian Raschka. | ||
""" | ||
|
||
# Graphein | ||
# Author: Arian Jamasb <[email protected]> | ||
# License: MIT | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
"""Functions for adding edges to a PPI Graph from parsed STRING & BIOGRID API call outputs.""" | ||
|
||
# %% | ||
# Graphein | ||
# Author: Arian Jamasb <[email protected]>, Ramon Vinas | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
"""Functions for adding nodes features to a PPI Graph.""" | ||
|
||
# %% | ||
# Graphein | ||
# Author: Ramon Vinas, Arian Jamasb <[email protected]> | ||
|
@@ -71,11 +72,11 @@ def add_sequence_to_nodes(n: str, d: Dict[str, Any]): | |
|
||
print(nx.get_node_attributes(g, "sequence")) | ||
edge_colors = [ | ||
"r" | ||
if g[u][v]["kind"] == {"string"} | ||
else "b" | ||
if g[u][v]["kind"] == {"biogrid"} | ||
else "y" | ||
( | ||
"r" | ||
if g[u][v]["kind"] == {"string"} | ||
else "b" if g[u][v]["kind"] == {"biogrid"} else "y" | ||
) | ||
for u, v in g.edges() | ||
] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
"""Functions for adding metadata to PPI Graphs from STRING and BIOGRID.""" | ||
|
||
# %% | ||
# Graphein | ||
# Author: Arian Jamasb <[email protected]>, Ramon Vinas | ||
|
Oops, something went wrong.