This script will have a memory issue. My pymol will stuck if I have more than 3
files be processed.
file_list = [f'{m:02d}' for m in list(range(1,30,1))]
[cmd.do("load model.000."+str(k)+"_minimized.pdb") for k in file_list]
object_list=cmd.get_object_list('(model.000.*_minimized)')
chains=[('A','F'),('B', 'F'),('C','F'),('D','F'),('E','F')]
run
C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\pymol\pymol_path\Pymol-script-repo\list_hb.py
[cmd.do("list_hb chain F, chain A:E,
write_distances_file=hb_"+str(file)+".txt") for file in object_list ]
I modified from the sample script here
https://www.pymolwiki.org/index.php/Process_All_Files_In_Directory
Save the following lines in a file named as, eg. multiple_hb.py and make sure
list_hb.py in the working directory of searching directory.
Then run multiple_hb.py in the pymol command line.
from pymol import cmd
from glob import glob
for file in glob("model.000.*.pdb"):
print(file)
#file_list = [f'{m:02d}' for m in list(range(0,30,1))]
cmd.load(file)
obj=cmd.get_object_list('all')
print(obj)
#chains=[('A','F'),('B', 'F'),('C','F'),('D','F'),('E','F')]
cmd.do("run list_hb.py")
cmd.do("list_hb chain F, chain A:E,
write_distances_file=hb_"+str(obj[0])+".txt")
cmd.delete("all”)
On Jun 16, 2020, at 11:15 AM,
[email protected]<mailto:[email protected]>
wrote:
Send PyMOL-users mailing list submissions to
[email protected]<mailto:[email protected]>
To subscribe or unsubscribe via the World Wide Web, visit
https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.sourceforge.net%2Flists%2Flistinfo%2Fpymol-users&data=02%7C01%7Cqic8%40pitt.edu%7C4ec7afdbd857446afad308d812081e49%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1%7C0%7C637279173371378327&sdata=v28nxT%2ByGrbeZCuvUvBY327R7wDd2z%2FSDo13H8%2BoPwc%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. Re: hydrogen bond list for a series of files
(Mooers, Blaine H.M. (HSC))
2. Re: hydrogen bond list for a series of files (Chen, Qiang)
----------------------------------------------------------------------
Message: 1
Date: Tue, 16 Jun 2020 14:51:38 +0000
From: "Mooers, Blaine H.M. (HSC)" <[email protected]>
To: "Chen, Qiang" <[email protected]>, "[email protected]"
<[email protected]>
Subject: Re: [PyMOL] hydrogen bond list for a series of files
Message-ID:
<[email protected]>
Content-Type: text/plain; charset="Windows-1252"
Hi Charlie,
This will give the desired list.
file_list = [f'{m:02d}' for m in list(range(1,30,1))]
print(file_list)
Best regards,
Blaine
Blaine Mooers, Ph.D.
Associate Professor
Department of Biochemistry and Molecular Biology
College of Medicine
University of Oklahoma Health Sciences Center
S.L. Young Biomedical Research Center (BRC) Rm. 466
975 NE 10th Street, BRC 466
Oklahoma City, OK 73104-5419
________________________________________
From: Chen, Qiang [[email protected]]
Sent: Tuesday, June 16, 2020 9:26 AM
To: Mooers, Blaine H.M. (HSC); [email protected]
Subject: [EXTERNAL] Re: hydrogen bond list for a series of files
Hi, Blaine,
Then the question becomes how to generate a list with 30 or 300 numbers.
Will this work?
file_list=list(range(00, 30))
Thanks!
Charles
________________________________
From: Mooers, Blaine H.M. (HSC) <[email protected]>
Sent: Tuesday, June 16, 2020 9:57 AM
To: Chen, Qiang <[email protected]>; [email protected]
<[email protected]>
Subject: RE: hydrogen bond list for a series of files
Hi Charles,
You are right and I am wrong about the files needing to be loaded.
The object name has the pesky pdb file extension stripped off, so lets use the
object name instead of using Python to strip it off for us.
We no longer need to use glob.
We do need to the create a list of strings that encode the indexing of the
files.
This code worked for me with two files.
Adapt to your 30 or 300 files.
file_list = ['01','02']
[cmd.do("load model.000."+str(k)+"_minimized.pdb") for k in file_list]
object_list=cmd.get_object_list('(model.000.*_minimized)')
chains=[('A','F'),('B', 'F'),('C','F'),('D','F'),('E','F')]
run
C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\pymol\pymol_path\Pymol-script-repo\list_hb.py
[cmd.do("list_hb chain F, chain A:E,
write_distances_file=hb_"+str(file)+".txt") for file in object_list ]
Best regards,
Blaine
Blaine Mooers, Ph.D.
Associate Professor
Department of Biochemistry and Molecular Biology
College of Medicine
University of Oklahoma Health Sciences Center
S.L. Young Biomedical Research Center (BRC) Rm. 466
975 NE 10th Street, BRC 466
Oklahoma City, OK 73104-5419
________________________________________
From: Chen, Qiang [[email protected]]
Sent: Monday, June 15, 2020 10:18 PM
To: Mooers, Blaine H.M. (HSC); [email protected]
Subject: [EXTERNAL] Re: hydrogen bond list for a series of files
Thanks, Dr. Mooers.
I modified a little.
It seems the pdb files need be loaded.
I put all the following lines in a file multifile_hb.pml
run
C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\pymol\pymol_path\Pymol-script-repo\list_hb.py
import glob
load model.000.*_minimized.pdb
#chains=[('A','F'),('B', 'F'),('C','F'),('D','F'),('E','F')]
[cmd.do("list_hb chain F, chain A:E,
write_distances_file=hb_"+str(file)+".txt") for file in
glob.glob("model.000.??_minimized.pdb")]
A little not so perfect is that the output file,
hb_model.000.??_minimized.pdb.txt
Is is possible to do something like this
write_distances_file=hb_"+basename(file)+".txt"
Then the output will be
hb_model.000.??_minimized.txt
I tried, and this simple thing does not work.
Any suggestion?
Thanks!
Charles
________________________________
From: Mooers, Blaine H.M. (HSC) <[email protected]>
Sent: Monday, June 15, 2020 9:44 PM
To: Chen, Qiang <[email protected]>; [email protected]
<[email protected]>
Subject: RE: hydrogen bond list for a series of files
Hi Charles,
Make sure that PyMOL's present working directory is where the pdb files are
stored.
Copy and paste each of the four lines below one at a time on the command line
in PyMOL.
run
list_hb.py<https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Furldefense.proofpoint.com%2Fv2%2Furl%3Fu%3Dhttp-3A__list-5Fhb.py%26d%3DDwQF-g%26c%3DVjzId-SM5S6aVB_cCGQ0d3uo9UfKByQ3sI6Audoy6dY%26r%3Dk0gMbcsdOcdbPUNV5tW66KQSZfXL0ewVDPVBp7tqbks%26m%3DX2B3s7D21CBjGtOAQJ2noNR7vnKXPiHiT2eLIRiSC18%26s%3DKYQX_tOI8_HnmseLbJRMv7UTirG78evoaztp35Gg74E%26e%3D&data=02%7C01%7Cqic8%40pitt.edu%7C4ec7afdbd857446afad308d812081e49%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1%7C0%7C637279173371388314&sdata=3P2lfWf2Q00u%2FEXkXRI4PiebkpUWkT%2Fx9vU2Zn2WV60%3D&reserved=0<https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Furldefense.proofpoint.com%2Fv2%2Furl%3Fu%3Dhttps-3A__nam05.safelinks.protection.outlook.com_-3Furl-3Dhttps-253A-252F-252Furldefense.proofpoint.com-252Fv2-252Furl-253Fu-253Dhttp-2D3A-5F-5Flist-2D5Fhb.py-2526d-253DDwQF-2Dg-2526c-253DVjzId-2DSM5S6aVB-5FcCGQ0d3uo9UfKByQ3sI6Audoy6dY-2526r-253Dk0gMbcsdOcdbPUNV5tW66KQSZfXL0ewVDPVBp7tqbks-2526m-253DX2B3s7D21CBjGtOAQJ2noNR7vnKXPiHiT2eLIRiSC18-2526s-253DKYQX-5FtOI8-5FHnmseLbJRMv7UTirG78evoaztp35Gg74E-2526e-253D-26amp-3Bdata-3D02-257C01-257Cqic8-2540pitt.edu-257C2ea32a0b061443a37f1908d811fd40fd-257C9ef9f489e0a04eeb87cc3a526112fd0d-257C1-257C0-257C637279126707606574-26amp-3Bsdata-3D8VnRodmeEUrqQfFm7fe0gqd02cYPsKv8VxPcb09RIkQ-253D-26amp-3Breserved-3D0%26d%3DDwMF-g%26c%3DVjzId-SM5S6aVB_cCGQ0d3uo9UfKByQ3sI6Audoy6dY%26r%3Dk0gMbcsdOcdbPUNV5tW66KQSZfXL0ewVDPVBp7tqbks%26m%3DQ6LxvA7WaglxixxzDsbpjU7pbOFqJPXxmweHw0k_x7I%26s%3D6cyeevFFP1ip0quoSgRLS9fqrvVtj8JlnLJWMpJWqFg%26e%3D&data=02%7C01%7Cqic8%40pitt.edu%7C4ec7afdbd857446afad308d812081e49%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1%7C0%7C637279173371388314&sdata=UAhgDbT%2BFe4seXKcS%2FKeKAdARmT8pHxKdUB3yyz2rk4%3D&reserved=0>>
import glob
chains = [('A','B'), ('A','C'), ('A','D'), ('A','E'), ('B','C'), ('B','D'),
('B','E'), ('C','D'), ('C','E'), ('D','E') ]
[[cmd.do("list_hb chain "+ str(i) +", chain " +str(j) + ",
write_distances_file=hb_"+ str(file) + "_" + str(i) + "_" +str( j) +
"_001.txt") for i, j in chains] for file in glob.glob("model.??.pdb")]
Note that you do not have to load the pdb files into PyMOL.
If you want to analyze more than 99 files and less than 999 files, add a third
question mark to the argument of glob.glob().
Best regards,
Blaine
Blaine Mooers, Ph.D.
Associate Professor
Department of Biochemistry and Molecular Biology
College of Medicine
University of Oklahoma Health Sciences Center
S.L. Young Biomedical Research Center (BRC) Rm. 466
975 NE 10th Street, BRC 466
Oklahoma City, OK 73104-5419
________________________________________
From: Chen, Qiang [[email protected]]
Sent: Monday, June 15, 2020 2:53 PM
To: [email protected]
Subject: [EXTERNAL] [PyMOL] hydrogen bond list for a series of files
Hi, Pymol users
Could you help me do this in an efficient way?
Let me describe the task I try to do.
I have a series of numerically ordered files, say model00.pdb model.01.pdb ??
model.30.pdb
All the pdb have the same protein composition, chain A, B, C, D, and E. Their
relative position is different in each file.
I would like to check the hydrogen bonds between, say, chain A and B.
Thanks to Prof. Robert L. Campbell, I can list the hydrogen bonds in one pdb
and print the list as the follows
list_hb chain A, chain B, write_distances_file=hb_A_B_01.txt
How can I process the 30 files in an efficient way? what if I have 300 pdb
files?
Shell script, python, or anything else?
Thanks!
Charles Chen
_______________________________________________
PyMOL-users mailing list
Archives:
https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Furldefense.proofpoint.com%2Fv2%2Furl%3Fu%3Dhttp-3A__www.mail-2Darchive.com_pymol-2Dusers-40lists.sourceforge.net%26d%3DDwIGaQ%26c%3DVjzId-SM5S6aVB_cCGQ0d3uo9UfKByQ3sI6Audoy6dY%26r%3Dk0gMbcsdOcdbPUNV5tW66KQSZfXL0ewVDPVBp7tqbks%26m%3DxyAmhZRZYDjhbBLdiMRRk6wCJ14kA5UeQYC4urBFvQw%26s%3DaOpeSOw9Gqop8KF8Xf_lkPoBC_MSbb5i0cKlRaIAulI%26e%3D&data=02%7C01%7Cqic8%40pitt.edu%7C4ec7afdbd857446afad308d812081e49%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1%7C0%7C637279173371388314&sdata=Nj27saqQ0NO7f2sQ2B5tJdKbpCaabdaPk6YKhpfXvrs%3D&reserved=0<https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Furldefense.proofpoint.com%2Fv2%2Furl%3Fu%3Dhttps-3A__nam05.safelinks.protection.outlook.com_-3Furl-3Dhttps-253A-252F-252Furldefense.proofpoint.com-252Fv2-252Furl-253Fu-253Dhttp-2D3A-5F-5Fwww.mail-2D2Darchive.com-5Fpymol-2D2Dusers-2D40lists.sourceforge.net-2526d-253DDwIGaQ-2526c-253DVjzId-2DSM5S6aVB-5FcCGQ0d3uo9UfKByQ3sI6Audoy6dY-2526r-253Dk0gMbcsdOcdbPUNV5tW66KQSZfXL0ewVDPVBp7tqbks-2526m-253DxyAmhZRZYDjhbBLdiMRRk6wCJ14kA5UeQYC4urBFvQw-2526s-253DaOpeSOw9Gqop8KF8Xf-5FlkPoBC-5FMSbb5i0cKlRaIAulI-2526e-253D-26amp-3Bdata-3D02-257C01-257Cqic8-2540pitt.edu-257C01a30e93a2ca4a40b37308d81196d7ba-257C9ef9f489e0a04eeb87cc3a526112fd0d-257C1-257C0-257C637278686852886299-26amp-3Bsdata-3DH-252BbXZ7ylGnf8aHeqS8UfkWyeYYuKCLZv1GikWVh2gAM-253D-26amp-3Breserved-3D0%26d%3DDwMF-g%26c%3DVjzId-SM5S6aVB_cCGQ0d3uo9UfKByQ3sI6Audoy6dY%26r%3Dk0gMbcsdOcdbPUNV5tW66KQSZfXL0ewVDPVBp7tqbks%26m%3DX2B3s7D21CBjGtOAQJ2noNR7vnKXPiHiT2eLIRiSC18%26s%3DUml8pWJGL1VV1FRsRqY0A8xQ-ZVcOqvXJIUCvJgGjSY%26e%3D&data=02%7C01%7Cqic8%40pitt.edu%7C4ec7afdbd857446afad308d812081e49%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1%7C0%7C637279173371388314&sdata=KMnRP7MISFydbuZGP3Lv7%2BhFnl13MEF1WEQ%2BPDuF494%3D&reserved=0>
Unsubscribe:
https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Furldefense.proofpoint.com%2Fv2%2Furl%3Fu%3Dhttps-3A__sourceforge.net_projects_pymol_lists_pymol-2Dusers_unsubscribe%26d%3DDwIGaQ%26c%3DVjzId-SM5S6aVB_cCGQ0d3uo9UfKByQ3sI6Audoy6dY%26r%3Dk0gMbcsdOcdbPUNV5tW66KQSZfXL0ewVDPVBp7tqbks%26m%3DxyAmhZRZYDjhbBLdiMRRk6wCJ14kA5UeQYC4urBFvQw%26s%3DPY-g0XYMB9DqXC06Iixbjxfqf8jB9Pb_GFu8zClx3oY%26e%3D&data=02%7C01%7Cqic8%40pitt.edu%7C4ec7afdbd857446afad308d812081e49%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1%7C0%7C637279173371388314&sdata=J7iovKUIEHJ28eMxPcjWJ1ukh6hunV8eq4Sf4Rq1c4U%3D&reserved=0<https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Furldefense.proofpoint.com%2Fv2%2Furl%3Fu%3Dhttps-3A__nam05.safelinks.protection.outlook.com_-3Furl-3Dhttps-253A-252F-252Furldefense.proofpoint.com-252Fv2-252Furl-253Fu-253Dhttps-2D3A-5F-5Fsourceforge.net-5Fprojects-5Fpymol-5Flists-5Fpymol-2D2Dusers-5Funsubscribe-2526d-253DDwIGaQ-2526c-253DVjzId-2DSM5S6aVB-5FcCGQ0d3uo9UfKByQ3sI6Audoy6dY-2526r-253Dk0gMbcsdOcdbPUNV5tW66KQSZfXL0ewVDPVBp7tqbks-2526m-253DxyAmhZRZYDjhbBLdiMRRk6wCJ14kA5UeQYC4urBFvQw-2526s-253DPY-2Dg0XYMB9DqXC06Iixbjxfqf8jB9Pb-5FGFu8zClx3oY-2526e-253D-26amp-3Bdata-3D02-257C01-257Cqic8-2540pitt.edu-257C01a30e93a2ca4a40b37308d81196d7ba-257C9ef9f489e0a04eeb87cc3a526112fd0d-257C1-257C0-257C637278686852886299-26amp-3Bsdata-3Do1asKPIbwdAFwN-252FCJSTCXDg-252BndmmLXC8VJW8z48Y-252BAA-253D-26amp-3Breserved-3D0%26d%3DDwMF-g%26c%3DVjzId-SM5S6aVB_cCGQ0d3uo9UfKByQ3sI6Audoy6dY%26r%3Dk0gMbcsdOcdbPUNV5tW66KQSZfXL0ewVDPVBp7tqbks%26m%3DX2B3s7D21CBjGtOAQJ2noNR7vnKXPiHiT2eLIRiSC18%26s%3D52GYpWEgXcbl5EqO1gYdzX31C41KuEUPECZU1zDR_TU%26e%3D&data=02%7C01%7Cqic8%40pitt.edu%7C4ec7afdbd857446afad308d812081e49%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1%7C0%7C637279173371398312&sdata=MNwexB0N5N91cfjWjfFxuJUG6UwzjwxfRQdclayPPQQ%3D&reserved=0>
------------------------------
Message: 2
Date: Tue, 16 Jun 2020 15:15:11 +0000
From: "Chen, Qiang" <[email protected]>
To: "Mooers, Blaine H.M. (HSC)" <[email protected]>,
"[email protected]"
<[email protected]>
Subject: Re: [PyMOL] hydrogen bond list for a series of files
Message-ID:
<bl0pr04mb4660485ca7e2c00bf335ab34fa...@bl0pr04mb4660.namprd04.prod.outlook.com>
Content-Type: text/plain; charset="windows-1252"
Great, thanks!
Really appreciate your help!
Charles
________________________________
From: Mooers, Blaine H.M. (HSC) <[email protected]>
Sent: Tuesday, June 16, 2020 10:51 AM
To: Chen, Qiang <[email protected]>; [email protected]
<[email protected]>
Subject: RE: hydrogen bond list for a series of files
Hi Charlie,
This will give the desired list.
file_list = [f'{m:02d}' for m in list(range(1,30,1))]
print(file_list)
Best regards,
Blaine
Blaine Mooers, Ph.D.
Associate Professor
Department of Biochemistry and Molecular Biology
College of Medicine
University of Oklahoma Health Sciences Center
S.L. Young Biomedical Research Center (BRC) Rm. 466
975 NE 10th Street, BRC 466
Oklahoma City, OK 73104-5419
________________________________________
From: Chen, Qiang [[email protected]]
Sent: Tuesday, June 16, 2020 9:26 AM
To: Mooers, Blaine H.M. (HSC); [email protected]
Subject: [EXTERNAL] Re: hydrogen bond list for a series of files
Hi, Blaine,
Then the question becomes how to generate a list with 30 or 300 numbers.
Will this work?
file_list=list(range(00, 30))
Thanks!
Charles
________________________________
From: Mooers, Blaine H.M. (HSC) <[email protected]>
Sent: Tuesday, June 16, 2020 9:57 AM
To: Chen, Qiang <[email protected]>; [email protected]
<[email protected]>
Subject: RE: hydrogen bond list for a series of files
Hi Charles,
You are right and I am wrong about the files needing to be loaded.
The object name has the pesky pdb file extension stripped off, so lets use the
object name instead of using Python to strip it off for us.
We no longer need to use glob.
We do need to the create a list of strings that encode the indexing of the
files.
This code worked for me with two files.
Adapt to your 30 or 300 files.
file_list = ['01','02']
[cmd.do("load model.000."+str(k)+"_minimized.pdb") for k in file_list]
object_list=cmd.get_object_list('(model.000.*_minimized)')
chains=[('A','F'),('B', 'F'),('C','F'),('D','F'),('E','F')]
run
C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\pymol\pymol_path\Pymol-script-repo\list_hb.py
[cmd.do("list_hb chain F, chain A:E,
write_distances_file=hb_"+str(file)+".txt") for file in object_list ]
Best regards,
Blaine
Blaine Mooers, Ph.D.
Associate Professor
Department of Biochemistry and Molecular Biology
College of Medicine
University of Oklahoma Health Sciences Center
S.L. Young Biomedical Research Center (BRC) Rm. 466
975 NE 10th Street, BRC 466
Oklahoma City, OK 73104-5419
________________________________________
From: Chen, Qiang [[email protected]]
Sent: Monday, June 15, 2020 10:18 PM
To: Mooers, Blaine H.M. (HSC); [email protected]
Subject: [EXTERNAL] Re: hydrogen bond list for a series of files
Thanks, Dr. Mooers.
I modified a little.
It seems the pdb files need be loaded.
I put all the following lines in a file multifile_hb.pml
run
C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\pymol\pymol_path\Pymol-script-repo\list_hb.py
import glob
load model.000.*_minimized.pdb
#chains=[('A','F'),('B', 'F'),('C','F'),('D','F'),('E','F')]
[cmd.do("list_hb chain F, chain A:E,
write_distances_file=hb_"+str(file)+".txt") for file in
glob.glob("model.000.??_minimized.pdb")]
A little not so perfect is that the output file,
hb_model.000.??_minimized.pdb.txt
Is is possible to do something like this
write_distances_file=hb_"+basename(file)+".txt"
Then the output will be
hb_model.000.??_minimized.txt
I tried, and this simple thing does not work.
Any suggestion?
Thanks!
Charles
________________________________
From: Mooers, Blaine H.M. (HSC) <[email protected]>
Sent: Monday, June 15, 2020 9:44 PM
To: Chen, Qiang <[email protected]>; [email protected]
<[email protected]>
Subject: RE: hydrogen bond list for a series of files
Hi Charles,
Make sure that PyMOL's present working directory is where the pdb files are
stored.
Copy and paste each of the four lines below one at a time on the command line
in PyMOL.
run
list_hb.py<https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Furldefense.proofpoint.com%2Fv2%2Furl%3Fu%3Dhttp-3A__list-5Fhb.py%26d%3DDwQF-g%26c%3DVjzId-SM5S6aVB_cCGQ0d3uo9UfKByQ3sI6Audoy6dY%26r%3Dk0gMbcsdOcdbPUNV5tW66KQSZfXL0ewVDPVBp7tqbks%26m%3DX2B3s7D21CBjGtOAQJ2noNR7vnKXPiHiT2eLIRiSC18%26s%3DKYQX_tOI8_HnmseLbJRMv7UTirG78evoaztp35Gg74E%26e%3D&data=02%7C01%7Cqic8%40pitt.edu%7C4ec7afdbd857446afad308d812081e49%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1%7C0%7C637279173371398312&sdata=ilvH%2BGXKjFH7emRi360ey7DCVVXcuWaR0cNmrcs%2BCZs%3D&reserved=0<https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Furldefense.proofpoint.com%2Fv2%2Furl%3Fu%3Dhttps-3A__nam05.safelinks.protection.outlook.com_-3Furl-3Dhttps-253A-252F-252Furldefense.proofpoint.com-252Fv2-252Furl-253Fu-253Dhttp-2D3A-5F-5Flist-2D5Fhb.py-2526d-253DDwQF-2Dg-2526c-253DVjzId-2DSM5S6aVB-5FcCGQ0d3uo9UfKByQ3sI6Audoy6dY-2526r-253Dk0gMbcsdOcdbPUNV5tW66KQSZfXL0ewVDPVBp7tqbks-2526m-253DX2B3s7D21CBjGtOAQJ2noNR7vnKXPiHiT2eLIRiSC18-2526s-253DKYQX-5FtOI8-5FHnmseLbJRMv7UTirG78evoaztp35Gg74E-2526e-253D-26amp-3Bdata-3D02-257C01-257Cqic8-2540pitt.edu-257C2ea32a0b061443a37f1908d811fd40fd-257C9ef9f489e0a04eeb87cc3a526112fd0d-257C1-257C0-257C637279126707606574-26amp-3Bsdata-3D8VnRodmeEUrqQfFm7fe0gqd02cYPsKv8VxPcb09RIkQ-253D-26amp-3Breserved-3D0%26d%3DDwMF-g%26c%3DVjzId-SM5S6aVB_cCGQ0d3uo9UfKByQ3sI6Audoy6dY%26r%3Dk0gMbcsdOcdbPUNV5tW66KQSZfXL0ewVDPVBp7tqbks%26m%3DQ6LxvA7WaglxixxzDsbpjU7pbOFqJPXxmweHw0k_x7I%26s%3D6cyeevFFP1ip0quoSgRLS9fqrvVtj8JlnLJWMpJWqFg%26e%3D&data=02%7C01%7Cqic8%40pitt.edu%7C4ec7afdbd857446afad308d812081e49%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1%7C0%7C637279173371398312&sdata=0rqBcuqgLy243MKuKcWJnqKh8kL5JPs24Ya4hRWvW0M%3D&reserved=0>>
import glob
chains = [('A','B'), ('A','C'), ('A','D'), ('A','E'), ('B','C'), ('B','D'),
('B','E'), ('C','D'), ('C','E'), ('D','E') ]
[[cmd.do("list_hb chain "+ str(i) +", chain " +str(j) + ",
write_distances_file=hb_"+ str(file) + "_" + str(i) + "_" +str( j) +
"_001.txt") for i, j in chains] for file in glob.glob("model.??.pdb")]
Note that you do not have to load the pdb files into PyMOL.
If you want to analyze more than 99 files and less than 999 files, add a third
question mark to the argument of glob.glob().
Best regards,
Blaine
Blaine Mooers, Ph.D.
Associate Professor
Department of Biochemistry and Molecular Biology
College of Medicine
University of Oklahoma Health Sciences Center
S.L. Young Biomedical Research Center (BRC) Rm. 466
975 NE 10th Street, BRC 466
Oklahoma City, OK 73104-5419
________________________________________
From: Chen, Qiang [[email protected]]
Sent: Monday, June 15, 2020 2:53 PM
To: [email protected]
Subject: [EXTERNAL] [PyMOL] hydrogen bond list for a series of files
Hi, Pymol users
Could you help me do this in an efficient way?
Let me describe the task I try to do.
I have a series of numerically ordered files, say model00.pdb model.01.pdb ??
model.30.pdb
All the pdb have the same protein composition, chain A, B, C, D, and E. Their
relative position is different in each file.
I would like to check the hydrogen bonds between, say, chain A and B.
Thanks to Prof. Robert L. Campbell, I can list the hydrogen bonds in one pdb
and print the list as the follows
list_hb chain A, chain B, write_distances_file=hb_A_B_01.txt
How can I process the 30 files in an efficient way? what if I have 300 pdb
files?
Shell script, python, or anything else?
Thanks!
Charles Chen
_______________________________________________
PyMOL-users mailing list
Archives:
https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Furldefense.proofpoint.com%2Fv2%2Furl%3Fu%3Dhttp-3A__www.mail-2Darchive.com_pymol-2Dusers-40lists.sourceforge.net%26d%3DDwIGaQ%26c%3DVjzId-SM5S6aVB_cCGQ0d3uo9UfKByQ3sI6Audoy6dY%26r%3Dk0gMbcsdOcdbPUNV5tW66KQSZfXL0ewVDPVBp7tqbks%26m%3DxyAmhZRZYDjhbBLdiMRRk6wCJ14kA5UeQYC4urBFvQw%26s%3DaOpeSOw9Gqop8KF8Xf_lkPoBC_MSbb5i0cKlRaIAulI%26e%3D&data=02%7C01%7Cqic8%40pitt.edu%7C4ec7afdbd857446afad308d812081e49%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1%7C0%7C637279173371398312&sdata=dA2FsS4JYlgy%2BzEDUf7Ym7ZjxZpt67MzbjQLcqhLZtA%3D&reserved=0<https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Furldefense.proofpoint.com%2Fv2%2Furl%3Fu%3Dhttps-3A__nam05.safelinks.protection.outlook.com_-3Furl-3Dhttps-253A-252F-252Furldefense.proofpoint.com-252Fv2-252Furl-253Fu-253Dhttp-2D3A-5F-5Fwww.mail-2D2Darchive.com-5Fpymol-2D2Dusers-2D40lists.sourceforge.net-2526d-253DDwIGaQ-2526c-253DVjzId-2DSM5S6aVB-5FcCGQ0d3uo9UfKByQ3sI6Audoy6dY-2526r-253Dk0gMbcsdOcdbPUNV5tW66KQSZfXL0ewVDPVBp7tqbks-2526m-253DxyAmhZRZYDjhbBLdiMRRk6wCJ14kA5UeQYC4urBFvQw-2526s-253DaOpeSOw9Gqop8KF8Xf-5FlkPoBC-5FMSbb5i0cKlRaIAulI-2526e-253D-26amp-3Bdata-3D02-257C01-257Cqic8-2540pitt.edu-257C01a30e93a2ca4a40b37308d81196d7ba-257C9ef9f489e0a04eeb87cc3a526112fd0d-257C1-257C0-257C637278686852886299-26amp-3Bsdata-3DH-252BbXZ7ylGnf8aHeqS8UfkWyeYYuKCLZv1GikWVh2gAM-253D-26amp-3Breserved-3D0%26d%3DDwMF-g%26c%3DVjzId-SM5S6aVB_cCGQ0d3uo9UfKByQ3sI6Audoy6dY%26r%3Dk0gMbcsdOcdbPUNV5tW66KQSZfXL0ewVDPVBp7tqbks%26m%3DX2B3s7D21CBjGtOAQJ2noNR7vnKXPiHiT2eLIRiSC18%26s%3DUml8pWJGL1VV1FRsRqY0A8xQ-ZVcOqvXJIUCvJgGjSY%26e%3D&data=02%7C01%7Cqic8%40pitt.edu%7C4ec7afdbd857446afad308d812081e49%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1%7C0%7C637279173371408309&sdata=ntuExgK7Jy5fzjZKQkolAYAbTFp9JcAAVtTJpaBO52E%3D&reserved=0>
Unsubscribe:
https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Furldefense.proofpoint.com%2Fv2%2Furl%3Fu%3Dhttps-3A__sourceforge.net_projects_pymol_lists_pymol-2Dusers_unsubscribe%26d%3DDwIGaQ%26c%3DVjzId-SM5S6aVB_cCGQ0d3uo9UfKByQ3sI6Audoy6dY%26r%3Dk0gMbcsdOcdbPUNV5tW66KQSZfXL0ewVDPVBp7tqbks%26m%3DxyAmhZRZYDjhbBLdiMRRk6wCJ14kA5UeQYC4urBFvQw%26s%3DPY-g0XYMB9DqXC06Iixbjxfqf8jB9Pb_GFu8zClx3oY%26e%3D&data=02%7C01%7Cqic8%40pitt.edu%7C4ec7afdbd857446afad308d812081e49%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1%7C0%7C637279173371408309&sdata=xulJjUVGYDp4FlQS%2F2cOaj%2BesmBZ2mKHFbBhghAW%2Fek%3D&reserved=0<https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Furldefense.proofpoint.com%2Fv2%2Furl%3Fu%3Dhttps-3A__nam05.safelinks.protection.outlook.com_-3Furl-3Dhttps-253A-252F-252Furldefense.proofpoint.com-252Fv2-252Furl-253Fu-253Dhttps-2D3A-5F-5Fsourceforge.net-5Fprojects-5Fpymol-5Flists-5Fpymol-2D2Dusers-5Funsubscribe-2526d-253DDwIGaQ-2526c-253DVjzId-2DSM5S6aVB-5FcCGQ0d3uo9UfKByQ3sI6Audoy6dY-2526r-253Dk0gMbcsdOcdbPUNV5tW66KQSZfXL0ewVDPVBp7tqbks-2526m-253DxyAmhZRZYDjhbBLdiMRRk6wCJ14kA5UeQYC4urBFvQw-2526s-253DPY-2Dg0XYMB9DqXC06Iixbjxfqf8jB9Pb-5FGFu8zClx3oY-2526e-253D-26amp-3Bdata-3D02-257C01-257Cqic8-2540pitt.edu-257C01a30e93a2ca4a40b37308d81196d7ba-257C9ef9f489e0a04eeb87cc3a526112fd0d-257C1-257C0-257C637278686852886299-26amp-3Bsdata-3Do1asKPIbwdAFwN-252FCJSTCXDg-252BndmmLXC8VJW8z48Y-252BAA-253D-26amp-3Breserved-3D0%26d%3DDwMF-g%26c%3DVjzId-SM5S6aVB_cCGQ0d3uo9UfKByQ3sI6Audoy6dY%26r%3Dk0gMbcsdOcdbPUNV5tW66KQSZfXL0ewVDPVBp7tqbks%26m%3DX2B3s7D21CBjGtOAQJ2noNR7vnKXPiHiT2eLIRiSC18%26s%3D52GYpWEgXcbl5EqO1gYdzX31C41KuEUPECZU1zDR_TU%26e%3D&data=02%7C01%7Cqic8%40pitt.edu%7C4ec7afdbd857446afad308d812081e49%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1%7C0%7C637279173371408309&sdata=CsHgBohQtDcnbhYGJ6IWPNjZzpGLkPYSIR4ys%2Fy2wC0%3D&reserved=0>
-------------- next part --------------
An HTML attachment was scrubbed...
------------------------------
------------------------------
Subject: Digest Footer
_______________________________________________
PyMOL-users mailing list
[email protected]
https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.sourceforge.net%2Flists%2Flistinfo%2Fpymol-users&data=02%7C01%7Cqic8%40pitt.edu%7C4ec7afdbd857446afad308d812081e49%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1%7C0%7C637279173371408309&sdata=xWJOyonGPnYfhmNOqZP3SPZxA75whMdLZfZVGNyAtUU%3D&reserved=0
Unsubscribe:
https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fpymol%2Flists%2Fpymol-users%2Funsubscribe&data=02%7C01%7Cqic8%40pitt.edu%7C4ec7afdbd857446afad308d812081e49%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1%7C0%7C637279173371408309&sdata=6I5fj6RgavUMUFysgpciHBNIzIeZGS74y%2FIMLD3xp9Y%3D&reserved=0
------------------------------
End of PyMOL-users Digest, Vol 169, Issue 26
********************************************
_______________________________________________
PyMOL-users mailing list
Archives: http://www.mail-archive.com/[email protected]
Unsubscribe:
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe