Support for saving pdb files with 2 models in the same file using command line

Hello Chimera team, I have been working with docking files obtained from cluspro and I'm working on a set of commands to open the files in chimera, perform a ksdssp and save them in a single individual file. The problem that I have found while doing it was that secondary structure was not well calculated for the second model, so when I run the save (write) command, I only obtain a file with 1 molecule and it does not include the MODEL 1 nor MODEL 2 header, which I need it so I can analyze it later. Here I send the code that I have been running (save_all.py) with the command and a log of the problems it present while running, as well as an example input (model.000.00.pdb) and output file (ch_model.000.00.pdb) that this code produces. Also, an example of the files that I would like to generate is included in ch_model.000.00_manually.pdb The save_all.py runs in the Ubuntu terminal as follows: chimera --nogui save_all.py I believe that the code could be improved by adding an option to "save multiple files in a single file" as the GUI can allow, but using the command line, I could not find that option. I would really appreciate if you had some insight about how it could be solved. Thank you for your attention and I wait for your prompt response. Raquel Cossío Ramírez Corelab Genomics at Tecnológico de Monterrey

Hi Raquel, When I open your example input file in Chimera and use "write," it does save both models #0.1 and #0.2 to a single PDB file. Example commands: open model.000.00.pdb write #0 chtest.pdb ...and then chtest.pdb looks the same to me (in the 3D graphics window when I open it) as your "manually" file. It includes HELIX and SHEET records because they are automatically calculated when the input file is read, and it includes both #0.1 and #0.2 because they are submodels of #0. Technically, it is not really correct PDB format to use a single multimodel file for different proteins. The multi-model format supposed to be used for different conformations of exactly the same atoms, as in an NMR ensemble or time steps of a trajectory. However, the "write" command or the Save PDB GUI can generate this kind of file if you tell it to do so. <https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/write.html> I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Jun 15, 2023, at 3:31 PM, Raquel Cossío Ramírez via Chimera-users <chimera-users@cgl.ucsf.edu> wrote:
Hello Chimera team,
I have been working with docking files obtained from cluspro and I'm working on a set of commands to open the files in chimera, perform a ksdssp and save them in a single individual file. The problem that I have found while doing it was that secondary structure was not well calculated for the second model, so when I run the save (write) command, I only obtain a file with 1 molecule and it does not include the MODEL 1 nor MODEL 2 header, which I need it so I can analyze it later. Here I send the code that I have been running (save_all.py) with the command and a log of the problems it present while running, as well as an example input (model.000.00.pdb) and output file (ch_model.000.00.pdb) that this code produces. Also, an example of the files that I would like to generate is included in ch_model.000.00_manually.pdb The save_all.py runs in the Ubuntu terminal as follows:
chimera --nogui save_all.py
I believe that the code could be improved by adding an option to "save multiple files in a single file" as the GUI can allow, but using the command line, I could not find that option.
I would really appreciate if you had some insight about how it could be solved. Thank you for your attention and I wait for your prompt response.
Raquel Cossío Ramírez
Corelab Genomics at Tecnológico de Monterrey <model.000.00.pdb><save_all_log.txt><save_all.py><ch_model.000.00.pdb><ch_model.000.00_manually.pdb>_______________________________________________ Chimera-users mailing list -- chimera-users@cgl.ucsf.edu: To unsubscribe send an email to chimera-users-leave@cgl.ucsf.edu Manage subscription:

Hi Raquel, Also, if you want the HELIX and SHEET records to include both proteins, combine them into a single model before writing the PDB file. Example commands: open model.000.00.pdb combine #0 model #1 write #1 chtest-combined.pdb <https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/combine.html> I hope this helps, Elaine
On Jun 15, 2023, at 5:22 PM, Elaine Meng <meng@cgl.ucsf.edu> wrote:
Hi Raquel, When I open your example input file in Chimera and use "write," it does save both models #0.1 and #0.2 to a single PDB file. Example commands:
open model.000.00.pdb write #0 chtest.pdb
...and then chtest.pdb looks the same to me (in the 3D graphics window when I open it) as your "manually" file. It includes HELIX and SHEET records because they are automatically calculated when the input file is read, and it includes both #0.1 and #0.2 because they are submodels of #0.
Technically, it is not really correct PDB format to use a single multimodel file for different proteins. The multi-model format supposed to be used for different conformations of exactly the same atoms, as in an NMR ensemble or time steps of a trajectory. However, the "write" command or the Save PDB GUI can generate this kind of file if you tell it to do so.
<https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/write.html>
I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Jun 15, 2023, at 3:31 PM, Raquel Cossío Ramírez via Chimera-users <chimera-users@cgl.ucsf.edu> wrote:
Hello Chimera team,
I have been working with docking files obtained from cluspro and I'm working on a set of commands to open the files in chimera, perform a ksdssp and save them in a single individual file. The problem that I have found while doing it was that secondary structure was not well calculated for the second model, so when I run the save (write) command, I only obtain a file with 1 molecule and it does not include the MODEL 1 nor MODEL 2 header, which I need it so I can analyze it later. Here I send the code that I have been running (save_all.py) with the command and a log of the problems it present while running, as well as an example input (model.000.00.pdb) and output file (ch_model.000.00.pdb) that this code produces. Also, an example of the files that I would like to generate is included in ch_model.000.00_manually.pdb The save_all.py runs in the Ubuntu terminal as follows:
chimera --nogui save_all.py
I believe that the code could be improved by adding an option to "save multiple files in a single file" as the GUI can allow, but using the command line, I could not find that option.
I would really appreciate if you had some insight about how it could be solved. Thank you for your attention and I wait for your prompt response.
Raquel Cossío Ramírez
Corelab Genomics at Tecnológico de Monterrey

Thank you a lot Elaine! This helps me a lot with my coding. Best regards, Raquel Get Outlook for Android<https://aka.ms/AAb9ysg> ________________________________ From: Elaine Meng <meng@cgl.ucsf.edu> Sent: Thursday, June 15, 2023 7:41:50 PM To: Raquel Cossío Ramírez <A01568041@tec.mx> Cc: chimera-users@cgl.ucsf.edu List <chimera-users@cgl.ucsf.edu> Subject: Re: [Chimera-users] Support for saving pdb files with 2 models in the same file using command line Hi Raquel, Also, if you want the HELIX and SHEET records to include both proteins, combine them into a single model before writing the PDB file. Example commands: open model.000.00.pdb combine #0 model #1 write #1 chtest-combined.pdb <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.rbvi.ucsf.edu%2Fchimera%2Fdocs%2FUsersGuide%2Fmidas%2Fcombine.html&data=05%7C01%7CA01568041%40tec.mx%7Cab99e4684d0c4087c86408db6e0ae35f%7Cc65a3ea60f7c400b89345a6dc1705645%7C0%7C0%7C638224765266122487%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=%2F8v8h1%2F8dm4RoyAf9HbFz8ocxqFnQ56xS6ONYw21OMI%3D&reserved=0<https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/combine.html>> I hope this helps, Elaine
On Jun 15, 2023, at 5:22 PM, Elaine Meng <meng@cgl.ucsf.edu> wrote:
Hi Raquel, When I open your example input file in Chimera and use "write," it does save both models #0.1 and #0.2 to a single PDB file. Example commands:
open model.000.00.pdb write #0 chtest.pdb
...and then chtest.pdb looks the same to me (in the 3D graphics window when I open it) as your "manually" file. It includes HELIX and SHEET records because they are automatically calculated when the input file is read, and it includes both #0.1 and #0.2 because they are submodels of #0.
Technically, it is not really correct PDB format to use a single multimodel file for different proteins. The multi-model format supposed to be used for different conformations of exactly the same atoms, as in an NMR ensemble or time steps of a trajectory. However, the "write" command or the Save PDB GUI can generate this kind of file if you tell it to do so.
I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Jun 15, 2023, at 3:31 PM, Raquel Cossío Ramírez via Chimera-users <chimera-users@cgl.ucsf.edu> wrote:
Hello Chimera team,
I have been working with docking files obtained from cluspro and I'm working on a set of commands to open the files in chimera, perform a ksdssp and save them in a single individual file. The problem that I have found while doing it was that secondary structure was not well calculated for the second model, so when I run the save (write) command, I only obtain a file with 1 molecule and it does not include the MODEL 1 nor MODEL 2 header, which I need it so I can analyze it later. Here I send the code that I have been running (save_all.py) with the command and a log of the problems it present while running, as well as an example input (model.000.00.pdb) and output file (ch_model.000.00.pdb) that this code produces. Also, an example of the files that I would like to generate is included in ch_model.000.00_manually.pdb The save_all.py runs in the Ubuntu terminal as follows:
chimera --nogui save_all.py
I believe that the code could be improved by adding an option to "save multiple files in a single file" as the GUI can allow, but using the command line, I could not find that option.
I would really appreciate if you had some insight about how it could be solved. Thank you for your attention and I wait for your prompt response.
Raquel Cossío Ramírez
Corelab Genomics at Tecnológico de Monterrey
participants (2)
-
Elaine Meng
-
Raquel Cossío Ramírez