Hello Joe,
You're either going to have to supply your script with something like a
.sca file and extract unit cell and space group from it, or you'll have
to supply those values on the command line.
First option in csh, apropos Jan's script:
#!/bin/csh -f
#
# run as "./phils_script1.csh dummy.sca"
#
set cell = `head -3 $1 | tail -1 | cut -b 2-60`
set sg = `head -3 $1 | tail -1 | cut -b 61-80`
unique hklout unique.mtz << eof
labout F=F SIGF=SIGF
symmetry $sg
resolution 1.6
cell $cell
eof
---- end script 1
The other option is to explicitly itemize everything
#!/bin/csh -f
#
# "./phils_script2.csh 79.1 79.1 37.9 90. 90. 90. P43212"
#
unique hklout unique.mtz << eof
labout F=F SIGF=SIGF
symmetry $7
resolution 1.6
cell $1 $2 $3 $4 $5 $6
eof
---- end script 2
In general I'd recommend putting some argument error checking in these
scripts, but that would make this post too long.
If still in print I recommend the "C shell Field Guide" by Anderson and
Anderson if you want to get further into Csh scripting. Python's also
not a bad option. At all costs avoid Perl.
Phil Jeffrey
Princeton
On 5/8/13 11:37 PM, Joe Chen wrote:
> Hi All,
>
>
> I am trying to write a shell script to streamline a few steps, one of
> which is Unique, see below. As you can see, this program requires
> symmetry and cell parameters. In CCP4 GUI Scalepack2mtz, these info are
> automatically extracted from .sca file (first two lines). But I don't
> know if there is a way to do this in script, so I don't need to type
> these values for each dataset. Thank you in advance for your help.
>
>
> #!/bin/sh
> # unique.exam
> #
> # runnnable test script for the program "unique" - this will use this
> # program to generate a reflection list containing null values.
> #
>
> set -e
>
> unique hklout ${CCP4_SCR}/unique_out.mtz << eof
> labout F=F SIGF=SIGF
> symmetry p43212
> resolution 1.6
> cell 78.1 78.1 55.2 90.0 90.0 90.0
> eof
>
>
> --
> Best regards,
>
> Joe
|