Re: [ccp4bb] question about CCP4 scripts

2013-05-09 Thread Tim Gruene
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Dear Joe,

most ccp4 programs make use of space group and cell information if
present in the input file. The script you list below does not have an
input file (apparently it creates a dummy mtz-file with only a list of
Miller indices), so there is nothing to extract. E.g. a simple test

# scalepack2mtz hklin test.sca hklout test.sca  eof
eof

confirms that scalepack2mtz extracts the information from the header
automatically and creates a valid mtz-file (I tend to give programs a
try the way I would like them to work, and if that does not work, I
start reading the manual or check on the web or post to a bb).

Regards,
Tim

On 05/09/2013 05:37 AM, 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
 
 

- -- 
Dr Tim Gruene
Institut fuer anorganische Chemie
Tammannstr. 4
D-37077 Goettingen

GPG Key ID = A46BEE1A
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iD8DBQFRi12sUxlJ7aRr7hoRAurSAKDnNjVeJN0GvhDLzKmaYUX0mVUWggCePvTF
s78KpaBbPA9j4XTg4IpOjBE=
=qxVe
-END PGP SIGNATURE-


Re: [ccp4bb] question about CCP4 scripts

2013-05-09 Thread Jeffrey B Bonanno
Typo:

To avoid crash/overwrite, should be
scalepack2mtz hklin test.sca hklout test.mtz  eof eof
 ^^^
jbb
Jeffrey Bonanno, Ph.D.
New York Structural Genomics Research Consortium

-Original Message-
From: CCP4 bulletin board [mailto:CCP4BB@JISCMAIL.AC.UK] On Behalf Of Tim Gruene
Sent: Thursday, May 09, 2013 4:26 AM
To: CCP4BB@JISCMAIL.AC.UK
Subject: Re: [ccp4bb] question about CCP4 scripts

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Dear Joe,

most ccp4 programs make use of space group and cell information if present in 
the input file. The script you list below does not have an input file 
(apparently it creates a dummy mtz-file with only a list of Miller indices), so 
there is nothing to extract. E.g. a simple test

# scalepack2mtz hklin test.sca hklout test.sca  eof eof

confirms that scalepack2mtz extracts the information from the header 
automatically and creates a valid mtz-file (I tend to give programs a try the 
way I would like them to work, and if that does not work, I start reading the 
manual or check on the web or post to a bb).

Regards,
Tim

On 05/09/2013 05:37 AM, 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
 
 

- --
Dr Tim Gruene
Institut fuer anorganische Chemie
Tammannstr. 4
D-37077 Goettingen

GPG Key ID = A46BEE1A
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iD8DBQFRi12sUxlJ7aRr7hoRAurSAKDnNjVeJN0GvhDLzKmaYUX0mVUWggCePvTF
s78KpaBbPA9j4XTg4IpOjBE=
=qxVe
-END PGP SIGNATURE-


Re: [ccp4bb] question about CCP4 scripts

2013-05-09 Thread Jeffrey B Bonanno
Looks like my signature messed up the script too...

scalepack2mtz hklin test.sca hklout test.mtz  eof eof
 ^^^


Re: [ccp4bb] question about CCP4 scripts

2013-05-09 Thread Ed Pozharski
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 /



[ccp4bb] question about CCP4 scripts

2013-05-08 Thread Joe Chen
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


Re: [ccp4bb] question about CCP4 scripts

2013-05-08 Thread jan
Hi Joe,
this line of code for csh/tcsh is awfully rickety-raggedy, it does the trick 
though.

Jan


setenv spacegroup  P3121
setenv noresidues  350
setenv lambda  1.5418

set unitcell = `head -3 ../hkl/output.sca | tail -1 | cut -b 4-60`

scalepack2mtz \
hklin ../hkl/output.sca \
hklout ./${dataset}_import.mtz \
 eof  ${dataset}_scalepack2mtz.log
symmetry $spacegroup
cell $unitcell
wave $lambda
end
eof

--
Jan Abendroth
Emerald BioStructures
Seattle / Bainbridge Island WA, USA
home: Jan.Abendroth_at_gmail.com
work: JAbendroth_at_embios.com
http://www.emeraldbiostructures.com

On May 8, 2013, at 8:37 PM, Joe Chen gch...@gmail.com 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