[chimerax-users] downloading and saving maps from EMDB

Tom Goddard goddard at sonic.net
Thu Jul 14 19:44:44 PDT 2022


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: fetch_maps.py
Type: text/x-python-script
Size: 240 bytes
Desc: not available
URL: <http://www.rbvi.ucsf.edu/pipermail/chimerax-users/attachments/20220714/cc75a8a9/attachment.bin>
-------------- next part --------------


> On Jul 12, 2022, at 1:38 PM, Elaine Meng via ChimeraX-users <chimerax-users at 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 at 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 at cgl.ucsf.edu
> Manage subscription:
> https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users
> 



More information about the ChimeraX-users mailing list