
Hi Vincent, The "foreach" option is not inside the cxc file. First you make the cxc file. Then you use the "open" command (with the "foreach" option to specify the input data files) to open the cxc file. See the help, which actually has an example: <https://rbvi.ucsf.edu/chimerax/docs/user/commands/open.html#forEachFile> Here is another example. The cxc file (let's call it blah.cxc) could contain volume flip save $file-flipped.mrc Then you would use command open blah.cxc foreach /My-Path/*.mrc I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Dec 13, 2023, at 1:21 AM, vincent Chaptal <vincent.chaptal@ibcp.fr> wrote:
Hi Elaine,
this would very very useful. To make sure I get it right, would a script like this work:
#flip-maps.cxc open foreach /My-Path/*.mrc volume flip save /My-Path/*-flipped.mrc
thanks. Vincent
Le 13/12/2023 à 01:23, Elaine Meng via ChimeraX-users a écrit :
Hi Rayaees, You could have used a ChimeraX command script (.cxc) and opened that .cxc file with the "foreach" option of "open" to open each input map file individually, then flip with "volume flip", then save the result with "save", then do the next one, etc.
See the option explained here:
<https://rbvi.ucsf.edu/chimerax/docs/user/commands/open.html#forEachFile>
However, since you already have all of them open and flipped, I can't think of any simple way to do it.
Maybe you could start over and try the foreach way instead? But it's up to you...
Also to be safe I would strongly recommend against saving them all to the same name as the input file, in case something goes wrong. You don't want to lose all your original data by overwriting it with a mistake (e.g. blank files).
Best, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Dec 12, 2023, at 3:39 PM, Rayees Mattoo via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Hi, I volume flipped 20 different models (#1 to #20) and now I want to save all the 20 flipped maps as .mrc with the same name as before and add flip in their names. How could I modify the save command line to do that?
Best