Hi Catherine,
If all the pseudobonds you intend to add are within one structure (call it 's'), then the code would be:

pbg = s.pseudobond_group("name of pseudobond group")
pbg.new_pseudobond(atom1, atom2)

If at least some of the pseudobonds are between structures, then instead:

pbg = session.pb_manager.get_group("name of pseudobond group")
pbg.new_pseudobond(atom1, atom2)

You don't say whether this pseudobond is meant to convey that those CAs are in the same chain but that the structure between them is missing.  If so, than you should specifically create "missing structure" pseudobonds, with:

pbg = s.pseudobond_group(s.PBG_MISSING_STRUCTURE)
pbg.new_pseudobond(atom1, atom2)

--Eric

Eric Pettersen
UCSF Computer Graphics Lab


On Jan 24, 2025, at 8:30 AM, Nguyen, Catherine via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:

Hello, 

I was hoping to get your help. I am trying to write a bundle and I am struggling to figure out how I can add psuedo-bonds using python as I want to connect two amino acids by the CA. Would you be able to help me find a way to do this?

I hope to hear from you soon,

Best wishes, 
Catherine

_______________________________________________
ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu
To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu
Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/