[chimerax-users] using variables in command files
Pranav Shah
p.shah.lab at gmail.com
Fri Jun 24 12:19:17 PDT 2022
nvm, turns out I had to upgrade pip inthe ChimX sessh.
Best,
Pranav
--
Pranav Shah
Postdoctoral Research Fellow.
Division of Structural Biology,
Wellcome Trust Centre for Human Genetics,
University of Oxford,
Roosevelt Drive, Oxford OX3 7BN,
UK
On Fri, Jun 24, 2022 at 8:16 PM Pranav Shah <p.shah.lab at gmail.com> wrote:
>
> Yeah, it would be really nice to be able to pass multiple commands to
> a script. I did think about putting together an alias with multiple
> lines, but thought it would be too unwieldy. Writing a python script
> ended up being the most efficient. Having said that, how does one get
> a voxelsize from a map? I tried to use mrcfile which I know is
> installed but ChimeraX doesnt appear to be able to load it.
>
> Best,
> Pranav
> --
> Pranav Shah
> Postdoctoral Research Fellow.
>
> Division of Structural Biology,
> Wellcome Trust Centre for Human Genetics,
> University of Oxford,
> Roosevelt Drive, Oxford OX3 7BN,
> UK
>
> On Fri, Jun 24, 2022 at 8:09 PM Tom Goddard <goddard at sonic.net> wrote:
> >
> > Hi Pranav,
> >
> > 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,
> >
> > alias radcolor open $1 ; color radial palette rainbow ; save $2 height 512 width 512 transparentBackground true
> >
> > This defines the radcolor command that you can use like
> >
> > radcolor mymap.mrc image.png
> >
> > Here's the documentation for the "alias" command
> >
> > https://www.cgl.ucsf.edu/chimerax/docs/user/commands/alias.html
> >
> > 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.
> >
> > https://www.cgl.ucsf.edu/chimerax/docs/user/commands/runscript.html
> >
> > Tom
> >
> >
> >
> >
> > > On Jun 24, 2022, at 5:57 AM, Pranav Shah via ChimeraX-users <chimerax-users at cgl.ucsf.edu> wrote:
> > >
> > > Hi Team,
> > > Is it possible for one to declare a variable in a command file that
> > > can then be passed to via the chimeraX command line interface. A
> > > minimal example of something I would like to do is -
> > > command.cxc
> > > open $file
> > > color radial palette rainbow
> > > save $outfile.png height 512 width 512 transparentBackground True
> > >
> > > In the chimeraX command line window I would then like to run
> > > open command.cxc infile.mrc outfile.png
> > > Best,
> > > Pranav
> > > --
> > > Pranav Shah
> > > Postdoctoral Research Fellow.
> > >
> > > Division of Structural Biology,
> > > Wellcome Trust Centre for Human Genetics,
> > > University of Oxford,
> > > Roosevelt Drive, Oxford OX3 7BN,
> > > UK
> > > _______________________________________________
> > > 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