Giter VIP home page Giter VIP logo

Comments (8)

a-r-j avatar a-r-j commented on May 28, 2024 2

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.

a-r-j avatar a-r-j commented on May 28, 2024 1

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.

a-r-j avatar a-r-j commented on May 28, 2024 1

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.

a-r-j avatar a-r-j commented on May 28, 2024 1

pip install biovec

This should also be installed if you install Graphein with its optional dependencies:

pip install graphein[extras]

from graphein.

johnnytam100 avatar johnnytam100 commented on May 28, 2024

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'

image

from graphein.

johnnytam100 avatar johnnytam100 commented on May 28, 2024

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.

johnnytam100 avatar johnnytam100 commented on May 28, 2024

Arian, thanks again! It worked!

from graphein.

johnnytam100 avatar johnnytam100 commented on May 28, 2024

Thanks Arian!

from graphein.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.