Dear Eleanore,

Ooops - the ccp4bb rejects attachements with *.sh ending? Let's try it
again with *.sh.txt ...

The attached script works for me - fantastic what one can do with
SFTOOLS :-)

Cheers

Clemens

On Wed, Aug 17, 2011 at 04:55:59PM +0100, Eleanor Dodson wrote:
> There are 2 rogue reflections in a data set I have here. How can I
> eliminate them?
> I thought sftools did this but i cant seem to get the syntax right.
> Short of dumping the whole file, using an editor, then
> reconstructing it I am stuck..
> 
> Eleanor

-- 

***************************************************************
* Clemens Vonrhein, Ph.D.     vonrhein AT GlobalPhasing DOT com
*
*  Global Phasing Ltd.
*  Sheraton House, Castle Park 
*  Cambridge CB3 0AX, UK
*--------------------------------------------------------------
* BUSTER Development Group      (http://www.globalphasing.com)
***************************************************************
#!/bin/sh

# vonrh...@globalphasing.com 20110816

# input MTZ file
mtz=in.mtz

# output MTZ file
out=out.mtz

# space-separated list of h,k,l indeices to reject
hkls="1,0,-25 1,0,-24"

######################################################
[ "X$mtz" = "X" ] && echo " ERROR: please define input MTZ file" && exit 1
[ "X$out" = "X" ] && echo " ERROR: please define output MTZ file" && exit 1
[ ! -f $mtz     ] && echo " ERROR: input file $mtz not found" && exit 1
[   -f $out     ] && echo " ERROR: output file $mtz exists (please remove and 
re-run)" && exit 1

for hkl in $hkls
do
  sftools <<e
mode batch
read $mtz
`echo $hkl | awk '{i=split($1,a,",")
print "select index H =",a[1]
print "select index K =",a[2]
print "select index L =",a[3]
}'`
select invert
write __$$.mtz1
select all
quit
Y
e
  mv __$$.mtz1 __$$.mtz
  mtz=__$$.mtz
done
mv -v $mtz $out

Reply via email to