[buster-discuss] Bug in sftools that affects map display from BUSTER

Pietro Roversi pietro@globalphasing.com
Wed, 30 Jan 2002 17:51:33 +0000


This is a multi-part message in MIME format.
--------------25AAABA5E0BB9340A408850B
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Dear everyone,

		today in the CCP4 program sftools we found a bug that affect the
display of BUSTER maps for a number of space groups, including all
monoclinic ones.

	At the end of the BUSTER job sftools is called to read the BUSTER
output mtz file $BDG_job/shell.01/mlphas.mtz and transfer the data to
the CCP4 asymmetric unit, writing the file
$BDG_job/shell.01/$BDG_job.final.mtz (this is done at the very bottom of
the script $BDG_home/bin/buster/runbuster.sh). The resulting
$BDG_job/shell.01/$BDG_job.final.mtzfile, if present, is used to display
teh maps after the BUSTER job is finished.

	It turns out that during this asymmetric unit conversion, sftools
corrupts the BUSTER phases of 2Fo-Fc and Fo-Fc Fourier coefficients for
all space groups where CCP4/TNT asymmetric unit conventions differ
(including all monoclinic ones). 

	[Quite apart from BUSTER, this bug will generally affect the phases
output by sftools upon change of asymmetric unit for all phase ('P')
colums that are following any ABCD Hendrickson Lattmann coefficients
columns in any mtzfile. Only the phases in those mtz columns preceding
the ABCD columns will be converted correctly.] 

	Clemens Vonrhein has come up with a fix, whic was then approved by Bart
Hazes, the author of sftools. While you wait for CCP4 to incorporate
this bug fix, you have two options: 

	1. Download afresh the tar files with the buster binary from the web
page, and put it( in place in your BUSTER installation - for eahc
platform you run on; we have modified the order of the columns in the
mlphas.mtz file so that the sftools bug - although still present- won't
kick in when converting the mtz file to CCP4 a.u..

	2. Apply Clemens' patch to your sftools source code (it is attached
below in file sftools.f.diff) and recompile sftools for all your
platforms. 

	One can apply this patch by using:

  % cd $CCP4/src/sftools_
  % patch sftools.f < sftools.f.diff

	and recompiling sftools

	Best wishes, and regards,
	
	Pietro, Eric and Clemens
--------------25AAABA5E0BB9340A408850B
Content-Type: text/plain; charset=us-ascii;
 name="sftools.f.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="sftools.f.diff"

Index: sftools.f
===================================================================
RCS file: /home/somasys/Repository/ccp4/src/sftools_/sftools.f,v
retrieving revision 1.3
diff -c -r1.3 sftools.f
*** sftools.f	25 Jun 2001 10:44:25 -0000	1.3
--- sftools.f	30 Jan 2002 15:43:59 -0000
***************
*** 3308,3314 ****
        integer i,j,k,l,nexthkl,noffnew,noffold,isym,multi,kpos,nspace
        integer indx(3),idx_in(3),idx_out(3),inpck,nxist,idxist(24)
        integer gt_int,numbhl
!       real pshft,phares,packmat(9),gt_real,phashft,value,inrange
        logical input,centro,verbose,is_int,missing
  
        asunit='CCP4'
--- 3308,3314 ----
        integer i,j,k,l,nexthkl,noffnew,noffold,isym,multi,kpos,nspace
        integer indx(3),idx_in(3),idx_out(3),inpck,nxist,idxist(24)
        integer gt_int,numbhl
!       real pshft,pshft2,phares,packmat(9),gt_real,phashft,value,inrange
        logical input,centro,verbose,is_int,missing
  
        asunit='CCP4'
***************
*** 3420,3428 ****
                ref(kpos)  =value*cos(pshft)-ref(kpos+1)*sin(pshft)
                ref(kpos+1)=value*sin(pshft)+ref(kpos+1)*cos(pshft)
                value=ref(kpos+2)
!               pshft=pshft*2
!               ref(kpos+2)=value*cos(pshft)-ref(kpos+3)*sin(pshft)
!               ref(kpos+3)=value*sin(pshft)+ref(kpos+3)*cos(pshft)
              endif
    400     continue
          endif
--- 3420,3428 ----
                ref(kpos)  =value*cos(pshft)-ref(kpos+1)*sin(pshft)
                ref(kpos+1)=value*sin(pshft)+ref(kpos+1)*cos(pshft)
                value=ref(kpos+2)
!               pshft2=pshft*2
!               ref(kpos+2)=value*cos(pshft2)-ref(kpos+3)*sin(pshft2)
!               ref(kpos+3)=value*sin(pshft2)+ref(kpos+3)*cos(pshft2)
              endif
    400     continue
          endif
***************
*** 9244,9250 ****
        character type2(maxcol)*1
        integer nreduc,kount,l,k,inpck,indx(3),noff,nmult
        integer nsysabs,isym,matrix(9),gt_int,numbhl
!       real pshft,phares,value,inrange
        logical input,centro,verbose,missing
  
        asunit='CCP4'
--- 9244,9250 ----
        character type2(maxcol)*1
        integer nreduc,kount,l,k,inpck,indx(3),noff,nmult
        integer nsysabs,isym,matrix(9),gt_int,numbhl
!       real pshft,pshft2,phares,value,inrange
        logical input,centro,verbose,missing
  
        asunit='CCP4'
***************
*** 9352,9360 ****
                  ref(noff+k)  =value*cos(pshft)-ref(noff+k+1)*sin(pshft)
                  ref(noff+k+1)=value*sin(pshft)+ref(noff+k+1)*cos(pshft)
                  value=ref(noff+k+2)
!                 pshft=pshft*2
!                 ref(noff+k+2)=value*cos(pshft)-ref(noff+k+3)*sin(pshft)
!                 ref(noff+k+3)=value*sin(pshft)+ref(noff+k+3)*cos(pshft)
                endif
    200       continue
              if(isym.eq.0) nsysabs=nsysabs+1
--- 9352,9362 ----
                  ref(noff+k)  =value*cos(pshft)-ref(noff+k+1)*sin(pshft)
                  ref(noff+k+1)=value*sin(pshft)+ref(noff+k+1)*cos(pshft)
                  value=ref(noff+k+2)
!                 pshft2=pshft*2
!                 ref(noff+k+2)=value*cos(pshft2)-
!      .               ref(noff+k+3)*sin(pshft2)
!                 ref(noff+k+3)=value*sin(pshft2)+
!      .               ref(noff+k+3)*cos(pshft2)
                endif
    200       continue
              if(isym.eq.0) nsysabs=nsysabs+1

--------------25AAABA5E0BB9340A408850B--