In case anyone has a similar problem, here is my solution
from pymol import cmd
from glob import glob
cmd.do("run list_hb.py")
for file in glob("model*.pdb"):
print(file)
cmd.load(file)
obj=cmd.get_object_list('all')
print(obj)
#hydrogen bonds
cmd.do("list_hb all, all, write_distances_file=hb_"+str(obj[0])+".txt")
#salt bridge
cmd.do("select negative, (resn ASP+GLU and name OD*+OE*)")
cmd.do("select positive, (resn Lys and name NZ) or (resn ARG and name NE +
NH*)")
cmd.do("pairwise_dist negative, positive, 4, show=N, output="+str(obj[0]))
________________________________
From: [email protected]
<[email protected]>
Sent: Thursday, February 11, 2021 7:02 AM
To: [email protected] <[email protected]>
Subject: PyMOL-users Digest, Vol 177, Issue 5
Send PyMOL-users mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.sourceforge.net%2Flists%2Flistinfo%2Fpymol-users&data=04%7C01%7Cqic8%40pitt.edu%7Ce1b907f15a9b4977cd4108d8ce84e463%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1%7C0%7C637486417450124995%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=GIej770e5oQdn%2FMzFCZ%2BrBEO9PCc3oJ3JLZuKHC1WWg%3D&reserved=0
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of PyMOL-users digest..."
Today's Topics:
1. Salt bridges in same chains (Chen, Qiang)
----------------------------------------------------------------------
Message: 1
Date: Wed, 10 Feb 2021 15:09:28 +0000
From: "Chen, Qiang" <[email protected]>
To: "[email protected]"
<[email protected]>
Subject: [PyMOL] Salt bridges in same chains
Message-ID:
<dm6pr04mb4667a3774965c75ab387beb9fa...@dm6pr04mb4667.namprd04.prod.outlook.com>
Content-Type: text/plain; charset="iso-8859-1"
Hi, All,
I am writing a script to find all salt bridges in a pentameric proteins in 50
models.
The issues are
1. There are no salt bridges found in the same chain. But I find some if I
use this command.
>pairwise_dist /model00000//A/LYS+ARG/NZ+NE+NH*,
>/model00000//A/ASP+GLU/OD*+OE*, 4, show=N, output=P
My guess is that pairwise_dist does not take the same sel1, sel2 as a valid
input. Any solutions/suggestions?
2. The script is apparently not optimized. Any suggestions?
Thanks!
Charles
Here are what I am using now.
from pymol import cmd
from glob import glob
for file in glob("model*.pdb"):
print(file)
cmd.load(file)
obj=cmd.get_object_list('all')
print(obj)
#salt bridge
cmd.do("pairwise_dist ///A/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*,
///A/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 4, show=N, output="+str(obj[0])+"_A_A")
cmd.do("pairwise_dist ///A/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*,
///B/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 4, show=N, output="+str(obj[0])+"_A_B")
cmd.do("pairwise_dist ///A/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*,
///C/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 4, show=N, output="+str(obj[0])+"_A_C")
cmd.do("pairwise_dist ///A/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*,
///D/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 4, show=N, output="+str(obj[0])+"_A_D")
cmd.do("pairwise_dist ///A/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*,
///E/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 4, show=N, output="+str(obj[0])+"_A_E")
cmd.do("pairwise_dist ///B/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*,
///B/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 4, show=N, output="+str(obj[0])+"_B_B")
cmd.do("pairwise_dist ///B/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*,
///C/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 4, show=N, output="+str(obj[0])+"_B_C")
cmd.do("pairwise_dist ///B/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*,
///D/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 4, show=N, output="+str(obj[0])+"_B_D")
cmd.do("pairwise_dist ///B/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*,
///E/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 4, show=N, output="+str(obj[0])+"_B_E")
cmd.do("pairwise_dist ///C/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*,
///C/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 4, show=N, output="+str(obj[0])+"_C_C")
cmd.do("pairwise_dist ///C/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*,
///D/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 4, show=N, output="+str(obj[0])+"_C_D")
cmd.do("pairwise_dist ///C/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*,
///E/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 4, show=N, output="+str(obj[0])+"_C_E")
cmd.do("pairwise_dist ///D/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*,
///D/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 4, show=N, output="+str(obj[0])+"_D_D")
cmd.do("pairwise_dist ///D/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*,
///E/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 4, show=N, output="+str(obj[0])+"_D_E")
cmd.do("pairwise_dist ///E/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*,
///E/ASP+GLU+LYS+ARG/OD*+OE*+NZ+NE+NH*, 4, show=N, output="+str(obj[0])+"_E_E")
cmd.delete("all")
-------------- next part --------------
An HTML attachment was scrubbed...
------------------------------
------------------------------
Subject: Digest Footer
_______________________________________________
PyMOL-users mailing list
[email protected]
https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.sourceforge.net%2Flists%2Flistinfo%2Fpymol-users&data=04%7C01%7Cqic8%40pitt.edu%7Ce1b907f15a9b4977cd4108d8ce84e463%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1%7C0%7C637486417450134990%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=3xxot6OY1TN1olL%2FgxNjlMNi1SfX83ykykyFp1bRhtw%3D&reserved=0
Unsubscribe:
https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fpymol%2Flists%2Fpymol-users%2Funsubscribe&data=04%7C01%7Cqic8%40pitt.edu%7Ce1b907f15a9b4977cd4108d8ce84e463%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1%7C0%7C637486417450134990%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=3AIV32DDr4NZ7r70FImMZAFKHW%2F5nxQggpSwRwoAqow%3D&reserved=0
------------------------------
End of PyMOL-users Digest, Vol 177, Issue 5
*******************************************
_______________________________________________
PyMOL-users mailing list
Archives: http://www.mail-archive.com/[email protected]
Unsubscribe:
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe