Re: [Chimera-users] downloading and saving multiple PDB's

Hi Dmitry, You sent this to the chimera-users list but chimerax-users@cgl.ucsf.edu (CC'd here) is the better address for ChimeraX questions. We try not confuse Chimera users with ChimeraX answers and vice versa. Since your text said "Chimerax" I will answer for ChimeraX. Not sure what you mean by "multiple" ... of course you can fetch structures from the PDB using their IDs, e.g. commands: open 1zik open 2gbp 2fw0 1plx 1plz <https://rbvi.ucsf.edu/chimerax/docs/user/commands/open.html#fetch> If by "multiple" you mean a huge number that is not practical to put in a single command, that is a different matter. Also, a single "save" command only saves one file and it does not have option to automatically figure out filename from model name. <https://rbvi.ucsf.edu/chimerax/docs/user/commands/save.html#pdb> However, ChimeraX does allow writing a single command script (.cxc file) and applying it to multiple input files when the .cxc file is opened with the "open" command and "forEachFile" option: <https://rbvi.ucsf.edu/chimerax/docs/user/commands/open.html#forEachFile> It also allows substituting part of the input file name as the output file name. However, it was intended for the case where all the input files are local files. So as far as I know you would have to first fetch all the files from the PDB so that they are in your local cache (~/Downloads/ChimeraX/PDB/ ) and then in a separate step, use your .cxc file with this forEachFile mechanism. To do so, you would probably also need to segragate these files into their own directory since you don't also want to run the script on all of the other structures you've previously fetched from the PDB using ChimeraX. 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 26, 2023, at 9:39 AM, Dmitry Semchonok via Chimera-users <chimera-users@cgl.ucsf.edu> wrote:
Dear colleagues,
Is there a way to
• download the multiple pdb/mmcif using Chimerax knowing their ID entry? • save multiple opened pdbs using their corresponding original names in Chimerax? Thank you in advance.
Kind regards, Dmitry

On Jun 26, 2023, at 10:55 AM, Elaine Meng via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
<https://rbvi.ucsf.edu/chimerax/docs/user/commands/open.html#fetch>
If by "multiple" you mean a huge number that is not practical to put in a single command, that is a different matter. Also, a single "save" command only saves one file and it does not have option to automatically figure out filename from model name.
This is not completely correct, in that if the “file name” you save contains the literal string “[NAME]” in it, then a file will be saved for each model (that was specified in the save command) and each file name will have the [NAME] part replaced with the model name. --Eric Eric Pettersen UCSF Computer Graphics Lab

Should probably also mention that this special feature is only available for PDB and mmCIF files. —Eric
On Jun 26, 2023, at 11:07 AM, Eric Pettersen via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
On Jun 26, 2023, at 10:55 AM, Elaine Meng via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
<https://rbvi.ucsf.edu/chimerax/docs/user/commands/open.html#fetch>
If by "multiple" you mean a huge number that is not practical to put in a single command, that is a different matter. Also, a single "save" command only saves one file and it does not have option to automatically figure out filename from model name.
This is not completely correct, in that if the “file name” you save contains the literal string “[NAME]” in it, then a file will be saved for each model (that was specified in the save command) and each file name will have the [NAME] part replaced with the model name.
--Eric
Eric Pettersen UCSF Computer Graphics Lab
_______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu Manage subscription:

Thanks Eric! Sorry I forgot about this convenient option. I just tried the following to see if it saves multiple files, and it does: open 2gbp 2fw0 1plx 1plz save test/[NAME].pdb models #2-4 ...namely, I get files in ~/Desktop/test/ named 1plx.pdb 1plz.pdb 2fw0.pdb One weirdness, however, is that 1plx is an NMR model (ensemble of 80 structures, opened as 80 submodels) and this approach only saves one structure (the last one) in the PDB file. We should investigate that. I don't have that problem if I save 1plx without the [NAME] mechanism, however. Elaine
On Jun 26, 2023, at 11:09 AM, Eric Pettersen <pett@cgl.ucsf.edu> wrote:
Should probably also mention that this special feature is only available for PDB and mmCIF files.
—Eric
On Jun 26, 2023, at 11:07 AM, Eric Pettersen via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
On Jun 26, 2023, at 10:55 AM, Elaine Meng via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
<https://rbvi.ucsf.edu/chimerax/docs/user/commands/open.html#fetch>
If by "multiple" you mean a huge number that is not practical to put in a single command, that is a different matter. Also, a single "save" command only saves one file and it does not have option to automatically figure out filename from model name.
This is not completely correct, in that if the “file name” you save contains the literal string “[NAME]” in it, then a file will be saved for each model (that was specified in the save command) and each file name will have the [NAME] part replaced with the model name.
--Eric
Eric Pettersen UCSF Computer Graphics Lab

Dear Elaine, Eric and Oliver, Elaine, yes, indeed, the email list I used was wrong. Thank you for mentioning that. Indeed - I managed to open the large number of files using the command you mentioned open 2gbp 2fw0 1plx 1plz And after I thought there is a command like save 2gbp.pdb #1 2fw0.pdb #2 .....exists. But it didn't work. Great that's the following command exists - so I was not far away )). save test/[NAME].pdb models #2-4 But in the case of this saving command will models #2-4 keep their original PDB name? Or shall I specify it separately? save test/[2fw0 1plx 1plz].pdb models #2-4 If not, is there a way to save the multiple PDB's with their original name? Kind regards Dmitry ________________________________ From: Elaine Meng <meng@cgl.ucsf.edu> Sent: 26 June 2023 20:51 To: Dmitry Semchonok <semchonok@gmail.com> Cc: Oliver Clarke via ChimeraX-users <chimerax-users@cgl.ucsf.edu> Subject: Re: [chimerax-users] [Chimera-users] downloading and saving multiple PDB's Thanks Eric! Sorry I forgot about this convenient option. I just tried the following to see if it saves multiple files, and it does: open 2gbp 2fw0 1plx 1plz save test/[NAME].pdb models #2-4 ...namely, I get files in ~/Desktop/test/ named 1plx.pdb 1plz.pdb 2fw0.pdb One weirdness, however, is that 1plx is an NMR model (ensemble of 80 structures, opened as 80 submodels) and this approach only saves one structure (the last one) in the PDB file. We should investigate that. I don't have that problem if I save 1plx without the [NAME] mechanism, however. Elaine
On Jun 26, 2023, at 11:09 AM, Eric Pettersen <pett@cgl.ucsf.edu> wrote:
Should probably also mention that this special feature is only available for PDB and mmCIF files.
—Eric
On Jun 26, 2023, at 11:07 AM, Eric Pettersen via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
On Jun 26, 2023, at 10:55 AM, Elaine Meng via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
<https://rbvi.ucsf.edu/chimerax/docs/user/commands/open.html#fetch>
If by "multiple" you mean a huge number that is not practical to put in a single command, that is a different matter. Also, a single "save" command only saves one file and it does not have option to automatically figure out filename from model name.
This is not completely correct, in that if the “file name” you save contains the literal string “[NAME]” in it, then a file will be saved for each model (that was specified in the save command) and each file name will have the [NAME] part replaced with the model name.
--Eric
Eric Pettersen UCSF Computer Graphics Lab

Hi Dmitry, When I fetch from RCSB the automatically cached file is named like 2fw0.pdb, which is the same name I get for the output using this [NAME] method. The [NAME] method uses the current model names, so if the model name is the same as the first part of the original filename, it will work the way you want. If the model name is not what you want in the output filename, you can change it (the model name) using the "rename" command: <https://rbvi.ucsf.edu/chimerax/docs/user/commands/rename.html> No you cannot put multiple names in the square brackets, only NAME or ID as mentioned in the "save" docs to insert the current model names or ID numbers. <https://rbvi.ucsf.edu/chimerax/docs/user/commands/save.html#pdb> 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 26, 2023, at 12:19 PM, Dmitry Semchonok via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Dear Elaine, Eric and Oliver,
Elaine, yes, indeed, the email list I used was wrong. Thank you for mentioning that.
Indeed - I managed to open the large number of files using the command you mentioned open 2gbp 2fw0 1plx 1plz And after I thought there is a command like save 2gbp.pdb #1 2fw0.pdb #2 .....exists. But it didn't work.
Great that's the following command exists - so I was not far away )). save test/[NAME].pdb models #2-4
But in the case of this saving command will models #2-4 keep their original PDB name? Or shall I specify it separately? save test/[2fw0 1plx 1plz].pdb models #2-4
If not, is there a way to save the multiple PDB's with their original name?
Kind regards Dmitry
From: Elaine Meng <meng@cgl.ucsf.edu> Sent: 26 June 2023 20:51 To: Dmitry Semchonok <semchonok@gmail.com> Cc: Oliver Clarke via ChimeraX-users <chimerax-users@cgl.ucsf.edu> Subject: Re: [chimerax-users] [Chimera-users] downloading and saving multiple PDB's
Thanks Eric! Sorry I forgot about this convenient option.
I just tried the following to see if it saves multiple files, and it does:
open 2gbp 2fw0 1plx 1plz save test/[NAME].pdb models #2-4
...namely, I get files in ~/Desktop/test/ named 1plx.pdb 1plz.pdb 2fw0.pdb
One weirdness, however, is that 1plx is an NMR model (ensemble of 80 structures, opened as 80 submodels) and this approach only saves one structure (the last one) in the PDB file. We should investigate that. I don't have that problem if I save 1plx without the [NAME] mechanism, however.
Elaine
On Jun 26, 2023, at 11:09 AM, Eric Pettersen <pett@cgl.ucsf.edu> wrote:
Should probably also mention that this special feature is only available for PDB and mmCIF files.
—Eric
On Jun 26, 2023, at 11:07 AM, Eric Pettersen via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
On Jun 26, 2023, at 10:55 AM, Elaine Meng via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
<https://rbvi.ucsf.edu/chimerax/docs/user/commands/open.html#fetch>
If by "multiple" you mean a huge number that is not practical to put in a single command, that is a different matter. Also, a single "save" command only saves one file and it does not have option to automatically figure out filename from model name.
This is not completely correct, in that if the “file name” you save contains the literal string “[NAME]” in it, then a file will be saved for each model (that was specified in the save command) and each file name will have the [NAME] part replaced with the model name.
--Eric
Eric Pettersen UCSF Computer Graphics Lab
_______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu Manage subscription:

Many thanks, Elaine. Kind regards, Dmitry ________________________________ From: Elaine Meng <meng@cgl.ucsf.edu> Sent: 26 June 2023 21:29 To: Dmitry Semchonok <semchonok@gmail.com> Cc: Oliver Clarke via ChimeraX-users <chimerax-users@cgl.ucsf.edu> Subject: Re: [chimerax-users] [Chimera-users] downloading and saving multiple PDB's Hi Dmitry, When I fetch from RCSB the automatically cached file is named like 2fw0.pdb, which is the same name I get for the output using this [NAME] method. The [NAME] method uses the current model names, so if the model name is the same as the first part of the original filename, it will work the way you want. If the model name is not what you want in the output filename, you can change it (the model name) using the "rename" command: <https://rbvi.ucsf.edu/chimerax/docs/user/commands/rename.html> No you cannot put multiple names in the square brackets, only NAME or ID as mentioned in the "save" docs to insert the current model names or ID numbers. <https://rbvi.ucsf.edu/chimerax/docs/user/commands/save.html#pdb> 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 26, 2023, at 12:19 PM, Dmitry Semchonok via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Dear Elaine, Eric and Oliver,
Elaine, yes, indeed, the email list I used was wrong. Thank you for mentioning that.
Indeed - I managed to open the large number of files using the command you mentioned open 2gbp 2fw0 1plx 1plz And after I thought there is a command like save 2gbp.pdb #1 2fw0.pdb #2 .....exists. But it didn't work.
Great that's the following command exists - so I was not far away )). save test/[NAME].pdb models #2-4
But in the case of this saving command will models #2-4 keep their original PDB name? Or shall I specify it separately? save test/[2fw0 1plx 1plz].pdb models #2-4
If not, is there a way to save the multiple PDB's with their original name?
Kind regards Dmitry
From: Elaine Meng <meng@cgl.ucsf.edu> Sent: 26 June 2023 20:51 To: Dmitry Semchonok <semchonok@gmail.com> Cc: Oliver Clarke via ChimeraX-users <chimerax-users@cgl.ucsf.edu> Subject: Re: [chimerax-users] [Chimera-users] downloading and saving multiple PDB's
Thanks Eric! Sorry I forgot about this convenient option.
I just tried the following to see if it saves multiple files, and it does:
open 2gbp 2fw0 1plx 1plz save test/[NAME].pdb models #2-4
...namely, I get files in ~/Desktop/test/ named 1plx.pdb 1plz.pdb 2fw0.pdb
One weirdness, however, is that 1plx is an NMR model (ensemble of 80 structures, opened as 80 submodels) and this approach only saves one structure (the last one) in the PDB file. We should investigate that. I don't have that problem if I save 1plx without the [NAME] mechanism, however.
Elaine
On Jun 26, 2023, at 11:09 AM, Eric Pettersen <pett@cgl.ucsf.edu> wrote:
Should probably also mention that this special feature is only available for PDB and mmCIF files.
—Eric
On Jun 26, 2023, at 11:07 AM, Eric Pettersen via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
On Jun 26, 2023, at 10:55 AM, Elaine Meng via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
<https://rbvi.ucsf.edu/chimerax/docs/user/commands/open.html#fetch>
If by "multiple" you mean a huge number that is not practical to put in a single command, that is a different matter. Also, a single "save" command only saves one file and it does not have option to automatically figure out filename from model name.
This is not completely correct, in that if the “file name” you save contains the literal string “[NAME]” in it, then a file will be saved for each model (that was specified in the save command) and each file name will have the [NAME] part replaced with the model name.
--Eric
Eric Pettersen UCSF Computer Graphics Lab
_______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu Manage subscription:
participants (3)
-
Dmitry Semchonok
-
Elaine Meng
-
Eric Pettersen