Closed avivko closed 2 years ago
Hi @avivko thanks for raising this issue. It looks like the vector computation functions aren't accounting for possible altlocs and therefore compute a vector for each possible CB positions (they're still 3D vectors but there are two of them). I'll try to figure out an elegant solution for this. In the meantime, you can use something like pdbtools to clean up the structure and remove undesired altlocs.
Hi @a-r-j. Good job figuring that out so quickly! Yeah, I assumed that cleaning the PDBs would solve the problem, but wanted to let you know about this bug so that you'd be able to find the problem and come up with a general solution. And just for general knowledge: How are altlocs generally handled in Graphein? Do you double up the nodes and edges?
We try to remove them in the graph construction. The trouble was that the cbeta function relied on the raw_pdb_df
which we keep as metadata for traceability. I forgot we also compute a clean rgroup dataframe in construction so it makes much more sense to use that instead.
I just opened a PR and added some tests for your examples. Will get it merged in once tests pass :)
Now fixed in 1.3.0
:)
Describe the bug Running
fig = add_vector_to_plot(g, fig, "c_beta_vector")
For some PDBs (i.e. 6rew, 7w9w) yields an error message because apparently some vectors are only 2D:
To Reproduce Steps to reproduce the behavior:
This yields the error message above.
Expected behavior All PDBs and amino acids should be vectorizable (in 3D) and all vectors plottable. I would expect all vectors to be 3D, with missing dimensions just having 0 in their corresponding index, e.g. (2, 3) --> (2,3,0)
Desktop (please complete the following information):