Xplor fit backbone.inp - Xplor script to overlay NMR structures by a specific atom selection

From NMR Wiki

(Redirected from Xplor fit backbone.inp)
Jump to: navigation, search

This file (when run through NIH-XPLOR) will fit structures according to the atom selection and output as pdb files prefixed with "fitted_" part of the name.

To use it, first edit in four places marked with uppercase comments (psf file, atom selection and list of input files in two places)

Here is how to copy/paste files in UNIX command line.

remarks based on file  nmr/average.inp
remarks original author: Axel T. Brunger
 
{== PUT PATH TO YOUR PSF FILE HERE ==>}
structure @../peptide.psf end                     {*Read the structure file.*}
 
{== MODIFY FITTED ATOM SELECTION TO YOUR NEEDS ==}
vector idend (store9) (
                        (name ca or name c or name n)
)
 
   {*============ The first stage consists of computing the mean structure.*}
 
eval ($nfile=0)
vector do (store1=0) (all)
vector do (store2=0) (all)
vector do (store3=0) (all)
vector do (store4=0) (all)
 
evaluate ($count = 0)
{== TYPE IN ACTUAL FILE NAMES ==}
for $1 in
(
"file1.pdb"
"file2.pdb"
)
loop main
 
evaluate ($count = $count + 1)
coor @@$1
 
   if ($count=1) then
      coor copy end              {*Store first structure in comparison set.*}
   end if
 
   coor sele=( recall9 ) fit end
 
                      {* swap equivalent groups to minimize rms difference *}
 
   vector do (store1=store1+x) (all)
   vector do (store2=store2+y) (all)
   vector do (store3=store3+z) (all)
   vector do (store4=store4+x*x+y*y+z*z) (all)
   eval ($nfile=$nfile+1)
end loop main
 
vector do (x = store1 / $nfile) (all)
vector do (y = store2 / $nfile) (all)
vector do (z = store3 / $nfile) (all)
vector do (bcomp=sqrt(max(0,store4/$nfile-(x**2+y**2+z**2)))) (all)
 
 
        {*The second stage consists of computing an overall rms difference.*}
 
evaluate ($ave_rmsd_all=0.)
evaluate ($ave_rmsd_back=0.)
 
coor copy end
 
evaluate ($count = 0)
{== TYPE IN ACTUAL FILE NAMES ==}
for $1 in
(
"file1.pdb"
"file2.pdb"
)
loop main
 
evaluate ($count = $count + 1)
coor @@$1
        coor fit sele=( recall9 ) end
        coor rms sele=( recall9 ) end
        eval ($out_file = "fitted_" + $1)
        write coor output=$out_file end
        eval ($ave_rmsd_back=$ave_rmsd_back + $result)
        coor rms select (not hydro and (recall9) ) end
   coor rms selection=( not hydrogen )end
   evaluate ($ave_rmsd_all =$ave_rmsd_all + $result)
end loop main
 
evaluate ($ave_rmsd_back=$ave_rmsd_back / $nfile)
evaluate ($ave_rmsd_all =$ave_rmsd_all  / $nfile)
display ave. rms diff. to the mean struct. for non-h atoms= $ave_rmsd_all
display ave. rms diff. to the mean struct. for the backbone= $ave_rmsd_back
 
   {*====== Finally, the average structure and RMSDs are written to a file.*}
coor swap end
vector do (b=bcomp) ( all )
 
remarks unminimized average over $nfile files
remarks ave. rms diff. to the mean struct. for non-h atoms= $ave_rmsd_all
remarks ave. rms diff. to the mean struct. for the backbone= $ave_rmsd_back
remarks b array (last column) is the rms difference from the mean
 
{====>}            {*Write average coordinates and RMSDs to specified file.*}
write coordinates output=average.pdb end
 
 
stop
Personal tools