downloading and saving maps from EMDB

Hello, I have a text file list of 30-40 maps from emdb that I would like to download and save using chimeraX. Each map should be named for example 5995.mrc, where 5995 is the actual EMDB id. Is there a way to do this using CLI to make it faster than downloading 1 by 1? I am not sure how to instruct chimeraX to take the file name from the open models. open 5995 from emdb #opens the file and assigns #1 save ???.mrc models #1 #save the model 1 but how to instruct chimerax to take the model's name Ideally would be something like this: Input: emdb-ID.txt Output: 40 single .mrc maps named according to their EMDBIDs. open emdb-ID.txt from emdb save all, models #1-40 name=???? Please let me know if I can implement this. Thank you and best regards, Nebojša Bogdanović, Ph.D Department of Physiology and Biophysics, School of Medicine, Case Western Reserve University

Hello, If you had a set of input files (say multiple .mrc files or multiple .pdb files), you could use the "forEachFile" option of the "open" command to run a ChimeraX command script (.cxc) on each one and derive the output names from the input names, as explained here: <https://rbvi.ucsf.edu/chimerax/docs/user/commands/open.html#forEachFile> However, I don't think this mechanism generalizes to a list of EMDB IDs instead of input data files. Your situation may require a different kind of script (shell? python?) -- which is beyond my skill set, so others would need to advise. Best, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Jul 12, 2022, at 10:03 AM, Nebojsa Bogdanovic via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Hello,
I have a text file list of 30-40 maps from emdb that I would like to download and save using chimeraX. Each map should be named for example 5995.mrc, where 5995 is the actual EMDB id. Is there a way to do this using CLI to make it faster than downloading 1 by 1? I am not sure how to instruct chimeraX to take the file name from the open models.
open 5995 from emdb #opens the file and assigns #1 save ???.mrc models #1 #save the model 1 but how to instruct chimerax to take the model's name
Ideally would be something like this:
Input: emdb-ID.txt Output: 40 single .mrc maps named according to their EMDBIDs.
open emdb-ID.txt from emdb save all, models #1-40 name=????
Please let me know if I can implement this.
Thank you and best regards,
Nebojša Bogdanović, Ph.D Department of Physiology and Biophysics, School of Medicine, Case Western Reserve University

Here's some Python code you can open in ChimeraX to fetch EMDB maps and save them to MRC files. # Fetch EMDB maps and save them to MRC files. ids = ['5995', '1080', '12555'] from chimerax.core.commands import run for id in ids: run(session, f'open {id} from emdb') run(session, f'save {id}.mrc') run(session, f'close') Tom
On Jul 12, 2022, at 1:38 PM, Elaine Meng via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Hello, If you had a set of input files (say multiple .mrc files or multiple .pdb files), you could use the "forEachFile" option of the "open" command to run a ChimeraX command script (.cxc) on each one and derive the output names from the input names, as explained here: <https://rbvi.ucsf.edu/chimerax/docs/user/commands/open.html#forEachFile>
However, I don't think this mechanism generalizes to a list of EMDB IDs instead of input data files. Your situation may require a different kind of script (shell? python?) -- which is beyond my skill set, so others would need to advise. Best, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Jul 12, 2022, at 10:03 AM, Nebojsa Bogdanovic via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Hello,
I have a text file list of 30-40 maps from emdb that I would like to download and save using chimeraX. Each map should be named for example 5995.mrc, where 5995 is the actual EMDB id. Is there a way to do this using CLI to make it faster than downloading 1 by 1? I am not sure how to instruct chimeraX to take the file name from the open models.
open 5995 from emdb #opens the file and assigns #1 save ???.mrc models #1 #save the model 1 but how to instruct chimerax to take the model's name
Ideally would be something like this:
Input: emdb-ID.txt Output: 40 single .mrc maps named according to their EMDBIDs.
open emdb-ID.txt from emdb save all, models #1-40 name=????
Please let me know if I can implement this.
Thank you and best regards,
Nebojša Bogdanović, Ph.D Department of Physiology and Biophysics, School of Medicine, Case Western Reserve University
_______________________________________________ ChimeraX-users mailing list ChimeraX-users@cgl.ucsf.edu Manage subscription: https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users
participants (3)
-
Elaine Meng
-
Nebojsa Bogdanovic
-
Tom Goddard