Skip to content

How to get all angles and bond lengths of a residue? #4213

Open

Description

@LtECoD

The Bio.PDB.internal_coords module provides APIs such as "get_angle" and "get_length" that could return a specific angle or a bond length. But I didn't find an easy way to get all angles and bond lengths in the source code and official tutorial. Whether this purpose can only be implemented by traversing every angle or bond?

Activity

  1. peterjc commented on Jan 12, 2023

    @peterjc
    Member

    Which bond/angles do you want? If you want all of them, then as you say traversing seems appropriate.

    There may be a helper functions like .get_phi_psi_list(...) for special case, see my (very old) example at https://warwick.ac.uk/fac/sci/moac/people/students/peter_cock/python/ramachandran/calculate/ using MMTK and Biopython for this.

  2. rob-miller commented on Jan 12, 2023

    @rob-miller
    Contributor
  3. reopened this on Jan 13, 2023
  4. LtECoD commented on Jan 13, 2023

    @LtECoD
    Author

    For the GLY residue, call the get_length("N:CA") in the internal_coord returns None, but it works well for residue of other types and return normal bond length between N and CA. Is this a bug?

  5. LtECoD commented on Jan 13, 2023

    @LtECoD
    Author

    For the GLY residue, call the get_length("N:CA") in the internal_coord returns None, but it works well for residue of other types and return normal bond length between N and CA. Is this a bug?

    Even when i set the gly_cbeta to true by

    IC_Residue.gly_Cbeta = True 
    chain.atom_to_internal_coordinates()

    i still cannot get the N:CA bond length of GLY.

  6. LtECoD commented on Jan 13, 2023

    @LtECoD
    Author

    For the GLY residue, call the get_length("N:CA") in the internal_coord returns None, but it works well for residue of other types and return normal bond length between N and CA. Is this a bug?

    It seems that N:CA length doesn't take effect in "internal_coord_to_atom_coordindates", since the atom coordinates keep unchanged after the N:CA length is set to other values.

  7. rob-miller commented on Jan 13, 2023

    @rob-miller
    Contributor
  8. rob-miller commented on Jan 13, 2023

    @rob-miller
    Contributor

    However there is a bug related to this for set_length() on a backbone bond, causing some atom coordinates to not be updated as you found.
    This fix has now been added to #3898, to work around it on the current code base you would need to change values directly in the IC_Chain.hedra dictionary. If you need/want to do this, you should know that the problem comes from multiple hedra specifying the same bond, e.g. N:CA or CA:C, and the value needs to be updated in all of them. Another option might be look at the #3898 fix to IC_Residue.pick_length() and monkey patch that on your installation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions