At this point you do have the scalepack2mtz output file (BTW,
imosflm/aimless is wholeheartedly recommended by this convert), and you
can easily extract all the info from there.  There is mtzdmp, of course,
but it's easier to parse the actual mtz file (hey, the records are
actually text).  Like so:

egrep -oa "SYMINF.{74}" foo.mtz | awk '{print "symm "$5}'

Gives you the space group *number*, most ccp4 programs I know accept
that in addition to string symbol.  But if you really need the latter, 

echo symm $(egrep -oa "SYMINF.{74}" foo.mtz | cut -d"'" -f 2 | sed
s/""//g) 

will do.

As for unit cell parameters, this should work

egrep -oa "CELL.{76}" foo.mtz | sed -n 1p

Keep in mind that this extracts the "global cell" and will be
problematic if you have multi-dataset file (which I presume you don't).
If you need Nth dataset grab DCELL record, e.g. for the dataset #1

egrep -oa "DCELL.{75}" foo.mtz | sed -n 2p

Cheers and 

https://xkcd.com/208/


Ed

On Wed, 2013-05-08 at 23:37 -0400, 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

-- 
Edwin Pozharski, PhD, Assistant Professor
University of Maryland, Baltimore
----------------------------------------------
When the Way is forgotten duty and justice appear;
Then knowledge and wisdom are born along with hypocrisy.
When harmonious relationships dissolve then respect and devotion arise;
When a nation falls to chaos then loyalty and patriotism are born.
------------------------------   / Lao Tse /

Reply via email to