Comments (8)
This is now fixed in v1.1.1 (pip install graphein==1.1.1
). You no longer need to change the versions of pyyaml
and matplotlib
. biovec
still requires additional install (pip install biovec
/ pip install graphein[extras]==1.1.1
); this is the intended behaviour.
from graphein.
Hi @johnnytam100 thanks for pointing this out. It seems that there's been a breaking change in PyYaml (6.0+). You can get around this issue for now with:
!pip install pyyaml==5.4.1
I'll make the changes for 6.0 plus and pin the dependency.
With respect to using the PyMol viewer, you need to install pymol in the colab runtime:
!sudo apt-get install pymol
This should do the trick (just tested it myself) - let me know if it works for you & I'll push a more permanent solution.
from graphein.
Great!
Similar problem: !pip install -U matplotlib
will resolve this.
I think the trouble might be that the colab runtime already has some versions of these libraries installed, so when you install graphein it doesn't pull in the correct versions. In any case, this is really helpful (thanks!) & I will try to account for this in the dependencies or make it clearer in the colabs.
from graphein.
pip install biovec
This should also be installed if you install Graphein with its optional dependencies:
pip install graphein[extras]
from graphein.
That worked for the cells! Thanks! Unfortunately, another cell:
from graphein.protein.visualisation import plot_protein_structure_graph
p = plot_protein_structure_graph(G=g, angle=0, colour_edges_by="kind", colour_nodes_by="element_symbol", label_node_ids=False, node_size_min=2, node_alpha=0.85, node_colour_map=plt.cm.tab10)
plt.suptitle("Atom-level graph. Nodes coloured by their Element")
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
[<ipython-input-7-c327719f0d21>](https://localhost:8080/#) in <module>()
1 from graphein.protein.visualisation import plot_protein_structure_graph
2
----> 3 p = plot_protein_structure_graph(G=g, angle=0, colour_edges_by="kind", colour_nodes_by="element_symbol", label_node_ids=False, node_size_min=2, node_alpha=0.85, node_colour_map=plt.cm.tab10)
4 plt.suptitle("Atom-level graph. Nodes coloured by their Element")
5 frames
[/usr/local/lib/python3.7/dist-packages/matplotlib/artist.py](https://localhost:8080/#) in _update_property(self, k, v)
1000 if not callable(func):
1001 raise AttributeError('{!r} object has no property {!r}'
-> 1002 .format(type(self).__name__, k))
1003 return func(v)
1004
AttributeError: 'Axes3D' object has no property 'auto_add_to_figure'
from graphein.
It worked! Thank you!
Btw, there is another cell:
# Warning! This cell may crash a binder notebook as the pre-trained model download is rather large!
# NBVAL_SKIP
from graphein.protein.features.sequence.embeddings import esm_sequence_embedding, biovec_sequence_embedding
new_graph_annotation_funcs = {"graph_metadata_functions": [esm_sequence_embedding, biovec_sequence_embedding]}
config = ProteinGraphConfig(**new_graph_annotation_funcs)
g = construct_graph(config=config, pdb_code="3eiy")
print("ESM:", g.graph["esm_embedding_A"])
print("biovec:", g.graph["biovec_embedding_A"])
DEBUG:graphein.protein.graphs:Deprotonating protein. This removes H atoms from the pdb_df dataframe
DEBUG:graphein.protein.graphs:Detected 174 total nodes
Downloading: "https://github.com/facebookresearch/esm/archive/main.zip" to /root/.cache/torch/hub/main.zip
Downloading: "https://dl.fbaipublicfiles.com/fair-esm/models/esm1b_t33_650M_UR50S.pt" to /root/.cache/torch/hub/checkpoints/esm1b_t33_650M_UR50S.pt
Downloading: "https://dl.fbaipublicfiles.com/fair-esm/regression/esm1b_t33_650M_UR50S-contact-regression.pt" to /root/.cache/torch/hub/checkpoints/esm1b_t33_650M_UR50S-contact-regression.pt
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
[<ipython-input-15-fcdeef6b5567>](https://localhost:8080/#) in <module>()
6 config = ProteinGraphConfig(**new_graph_annotation_funcs)
7
----> 8 g = construct_graph(config=config, pdb_code="3eiy")
9 print("ESM:", g.graph["esm_embedding_A"])
10 print("biovec:", g.graph["biovec_embedding_A"])
3 frames
[/usr/local/lib/python3.7/dist-packages/graphein/protein/features/sequence/embeddings.py](https://localhost:8080/#) in _load_biovec_model()
203 """
204
--> 205 return biovec.models.load_protvec(
206 os.fspath(
207 Path(__file__).parent.parent
NameError: name 'biovec' is not defined
from graphein.
Arian, thanks again! It worked!
from graphein.
Thanks Arian!
from graphein.
Related Issues (20)
- esm_residue_embedding not working HOT 3
- KeyError: 'kind' for split edge index by edge kind when converting nx to pyg HOT 4
- LMDB Support for FoldComp databases.
- Format convertor for molecules HOT 6
- Support for torch 2.0 docker images
- NameError for missing `os` import in `graphein.protein.graphs` HOT 2
- issue in protein graph HOT 3
- On `rgroup_df=compute_rgroup_dataframe(remove_insertions(raw_pdb_df))` HOT 2
- A small bug in the `creating_datasets_from_the_pdb.ipynb` HOT 1
- PDB structure culstering HOT 4
- FoldCompDataset calls graphein.protein.tensor.Protein with incorrect __init__ arguments HOT 2
- Error during `Getting requirements to build wheel` HOT 3
- Running colab exmaple got an error ModuleNotFoundError: No module named 'torch_geometric' HOT 2
- `graphein.protein.edges.distance.add_distance_threshold` should allow computing distance by "any to any" atomistic even with "residue" granularity set
- can't read pdb ends with .pdb1.gz HOT 3
- [Docs] API Reference for `graphein.ml` is broken
- `ProteinGraphDataset` fails if a single graph construction fails.
- dssp version argument HOT 2
- add insertion code to node_id when insertoins are set to True HOT 2
- Sidechain torsion angle computation fails on examples containing Pyrolysin
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphein.