Giter VIP home page Giter VIP logo

Comments (2)

johnnytam100 avatar johnnytam100 commented on May 28, 2024

Hi, I'm sorry for reporting several situations at the same time. I met the same problem using the add_aromatic_interactions

from graphein.protein.edges.distance import (add_peptide_bonds,
                                             add_hydrogen_bond_interactions,
                                             add_disulfide_interactions,
                                             add_ionic_interactions,
                                             add_aromatic_interactions,
                                             add_aromatic_sulphur_interactions,
                                             add_cation_pi_interactions
                                            )

new_edge_funcs = {"edge_construction_functions": [add_peptide_bonds,
                                                  add_hydrogen_bond_interactions,
                                                  add_disulfide_interactions,
                                                  add_ionic_interactions,
                                                  add_aromatic_interactions,
                                                  add_aromatic_sulphur_interactions,
                                                  add_cation_pi_interactions
                                                  ]
                 }

config = ProteinGraphConfig(**new_edge_funcs)
g = construct_graph(config=config, pdb_code="3ED8")
p = plot_protein_structure_graph(G=g, angle=0, colour_edges_by="kind", colour_nodes_by="seq_position", label_node_ids=False)
plt.suptitle("Protein graph with: peptide backbone, H-Bonds, \n Disulphide, ionic, aromatic, aromatic-sulphur and cation-pi interactions. \n  Nodes coloured by sequence position, edges by type")

returned

DEBUG:graphein.protein.graphs:Deprotonating protein. This removes H atoms from the pdb_df dataframe
DEBUG:graphein.protein.graphs:Detected 1134 total nodes
INFO:graphein.protein.edges.distance:Found 372 hbond interactions.
INFO:graphein.protein.edges.distance:Found 25 hbond interactions.
INFO:graphein.protein.edges.distance:Found 10 disulfide interactions.
INFO:graphein.protein.edges.distance:Found 983 ionic interactions.
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
[<ipython-input-8-183722266f5a>](https://localhost:8080/#) in <module>()
     19 
     20 config = ProteinGraphConfig(**new_edge_funcs)
---> 21 g = construct_graph(config=config, pdb_code="3ED8")
     22 p = plot_protein_structure_graph(G=g, angle=0, colour_edges_by="kind", colour_nodes_by="seq_position", label_node_ids=False)
     23 plt.suptitle("Protein graph with: peptide backbone, H-Bonds, \n Disulphide, ionic, aromatic, aromatic-sulphur and cation-pi interactions. \n  Nodes coloured by sequence position, edges by type")

4 frames
[/usr/local/lib/python3.7/dist-packages/graphein/protein/utils.py](https://localhost:8080/#) in filter_dataframe(dataframe, by_column, list_of_values, boolean)
     81     :rtype: pd.DataFrame
     82     """
---> 83     df = dataframe.copy()
     84     df = df[df[by_column].isin(list_of_values) == boolean]
     85     df.reset_index(inplace=True, drop=True)

AttributeError: 'NoneType' object has no attribute 'copy'

And I checked my pandas version:

import pandas as pd
print(pd.__version__)
1.3.5

May I know is it the problem with pandas version?

from graphein.

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

Hey @johnnytam100 this should be fixed in graphein 1.1.0 (pip install graphein==1.1.0)

Colab example

Looks like I'd made the fix & not updated the package 🙄 Sorry!

Closing this now, do let me know if it's still not working!

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.