<div>Awesome, thanks!</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 25 Jun 2022 at 00:45, Tom Goddard <<a href="mailto:goddard@sonic.net">goddard@sonic.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Pranav,<br>
<br>
I improved the ChimeraX runscript command so it can pass arguments to a ChimeraX command file (.cxc suffix) replacing $1, $2, $3 ... in the commands with the given arguments. This will be in tomorrow's daily builds. For example,<br>
<br>
run radcolor.cxc mymap.mrc mymap.png<br>
<br>
where the radcolor.cxc text file contains<br>
<br>
# Color map radially and save an image<br>
open $1<br>
color radial palette rainbow<br>
save $2 height 512 width 512 transparentBackground true<br>
<br>
Thanks suggesting the idea.<br>
<br>
Tom<br>
<br>
<br>
> On Jun 24, 2022, at 12:09 PM, Tom Goddard via ChimeraX-users <<a href="mailto:chimerax-users@cgl.ucsf.edu" target="_blank">chimerax-users@cgl.ucsf.edu</a>> wrote:<br>
> <br>
> Hi Pranav,<br>
> <br>
> Currently ChimeraX does not have a way to substitute argument values into a *.cxc file except for the open command "foreach" option which allows substituting the file name in for $file. For simple series of commands you could define an alias, for example,<br>
> <br>
> alias radcolor open $1 ; color radial palette rainbow ; save $2 height 512 width 512 transparentBackground true<br>
> <br>
> This defines the radcolor command that you can use like<br>
> <br>
> radcolor mymap.mrc image.png<br>
> <br>
> Here's the documentation for the "alias" command<br>
> <br>
> <a href="https://www.cgl.ucsf.edu/chimerax/docs/user/commands/alias.html" rel="noreferrer" target="_blank">https://www.cgl.ucsf.edu/chimerax/docs/user/commands/alias.html</a><br>
> <br>
> The other mechanism for handing arguments to a script is the "runscript" command which passes arguments to Python scripts only. I could imagine runscript being enhanced so that it works with a *.cxc command script and substitutes arguments in for $1, $2, $3, ... occurring in the script.<br>
> <br>
> <a href="https://www.cgl.ucsf.edu/chimerax/docs/user/commands/runscript.html" rel="noreferrer" target="_blank">https://www.cgl.ucsf.edu/chimerax/docs/user/commands/runscript.html</a><br>
> <br>
> Tom<br>
> <br>
> <br>
> <br>
> <br>
>> On Jun 24, 2022, at 5:57 AM, Pranav Shah via ChimeraX-users <<a href="mailto:chimerax-users@cgl.ucsf.edu" target="_blank">chimerax-users@cgl.ucsf.edu</a>> wrote:<br>
>> <br>
>> Hi Team,<br>
>> Is it possible for one to declare a variable in a command file that<br>
>> can then be passed to via the chimeraX command line interface. A<br>
>> minimal example of something I would like to do is -<br>
>> command.cxc<br>
>> open $file<br>
>> color radial palette rainbow<br>
>> save $outfile.png height 512 width 512 transparentBackground True<br>
>> <br>
>> In the chimeraX command line window I would then like to run<br>
>> open command.cxc infile.mrc outfile.png<br>
>> Best,<br>
>> Pranav<br>
>> --<br>
>> Pranav Shah<br>
>> Postdoctoral Research Fellow.<br>
>> <br>
>> Division of Structural Biology,<br>
>> Wellcome Trust Centre for Human Genetics,<br>
>> University of Oxford,<br>
>> Roosevelt Drive, Oxford OX3 7BN,<br>
>> UK<br>
>> _______________________________________________<br>
>> ChimeraX-users mailing list<br>
>> <a href="mailto:ChimeraX-users@cgl.ucsf.edu" target="_blank">ChimeraX-users@cgl.ucsf.edu</a><br>
>> Manage subscription:<br>
>> <a href="https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users" rel="noreferrer" target="_blank">https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users</a><br>
>> <br>
> <br>
> <br>
> _______________________________________________<br>
> ChimeraX-users mailing list<br>
> <a href="mailto:ChimeraX-users@cgl.ucsf.edu" target="_blank">ChimeraX-users@cgl.ucsf.edu</a><br>
> Manage subscription:<br>
> <a href="https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users" rel="noreferrer" target="_blank">https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users</a><br>
> <br>
<br>
</blockquote></div></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">Best,<br>Pranav<br>--<br>Pranav Shah<br>Postdoctoral Research Fellow.<br><br>Division of Structural Biology,<br>Wellcome Trust Centre for Human Genetics,<br>University of Oxford,<br>Roosevelt Drive, Oxford OX3 7BN,<br>UK</div>