-
-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chain_selection returns KeyError: 'residue_name' #134
Comments
Hi @johnnytam100, no worries! Could you please share the config? It looks like the trouble is occurring when you’re assigning the disulphide bonds. The key error says there is a node that doesn’t have a If you can share the config I can take a closer look this afternoon. Also, could you please share the version of Graphein you’re using? I just tried the following in a colab notebook and it seems to work as expected so I may be wrong about hetatms/ligands/waters causing the problem. from graphein.protein.graphs import construct_graph
from graphein.protein.edges.distance import add_disulfide_interactions, add_hydrogen_bond_interactions
from graphein.protein.config import ProteinGraphConfig
config = ProteinGraphConfig(
edge_construction_functions=[add_disulfide_interactions, add_hydrogen_bond_interactions],
keep_hets=True,
insertions=True,
exclude_waters = False,
)
g = construct_graph(pdb_code="2vvi", chain_selection="A", config=config)
|
My graphein version is And I have tested your code, which worked! Then I found something strange, if you swap the positions of
My original config was
Swapping only "add_hydrogen_bond_interactions" and "add_disulfide_interactions" didn't work. |
Huh, that is a bug. I’ll check it out |
Ah, I see what’s going on. The hydrogen bonds are looking at the unfiltered dataframe and adding in new nodes from the other chains. These nodes don’t have any metadata attached because they weren’t added in the earlier steps where we add information to nodes and so we get the error. This is definitely a bug and I’ll figure out a fix. What I would recommend you do for now is to not use the Good catch btw! Thanks for flagging this :) |
…132 #134 #135 (#136) * fix edges functions adding nodes to graphs with chain selections #134 * change generator comprehension in coordinate update to list comprehension to allow pickling #135 * [docs] update changelog * update conversion dosctrings #132 * update version to 1.2.1 * prevent execution in docs #131
Hey @johnnytam100 you should be able to proceed as normal now. v1.2.1 has fixes for this now and is on PyPI ( |
Thank you @a-r-j ! It is fine now with |
Hi Arian, I'm sorry for the frequent opening of threads!
I want to do chain selection of PDB 2VVI, which has chains A, B, C and D.
g = construct_graph(config=config, pdb_code='2VVI', chain_selection="A")
However, it returns a KeyError: 'residue_name':
Any idea how to resolve this error?
Thanks!
The text was updated successfully, but these errors were encountered: