xplor MD trajectories -> BIOSYM

Lukasz Salwinski lukasz at wlheye.jsei.ucla.edu
Sat Jan 20 00:27:28 EST 1996


Is there any way to make insightII read xplor-generated 
MD trajectories ? I've tried the naive/brute force approach
(ie tried to read xplor binary format as though it was 
insightII .his file) but apparently it didn't work :(

lukasz





----- End Included Message -----

Here is what i received when i asked that question to BIOSYM.
Basically, you have to transform all your snapshot into PDBs and run
this:
>
>
>
>
Tutorial on converting a PDB file(s) of multiple conformations into an *arc file


This tutorial includes two awk scripts; break.awk and car2arc.awk, and one BCL macro; Pdb_to_Arc.bcl.

If you are starting with a single PDB file which contains coordinates of multiple conformations, you will first
need to run the break.awk script to separate this file into several pdb files each containing one conformation.

The InsightII BCL macro reads each pdb file and writes out a car file then calls up the second awk script to
convert the car files into one archive file. 

Procedure:

 1. Extract the following three scripts and save them in the same directory, along with the PDB file(s) that
   you want to convert. 
 2. If necessary, run the break.awk script:

   nawk -f break.awk < pdb_file_to_be_broken_up

   If not, be sure the pdb filenames have following structure:
   rootname_1.pdb
   rootname_2.pdb
   rootname_3.pdb
   ...
 3. Start the InsightII program. 
 4. Source this BCL macro using the Viewer module's File/Source_File command. 
 5. Select the Pdb_to_Arc command found under the Viewer module's Custom pulldown. 
 6. Type in the Pdb_Root_Name. If you have used break.awk this name is tmp, otherwise it is the
   rootname you have chosen. 
 7. Fill in Start_Frame and End_Frame and Execute. 

---------------------------- break.awk ----------------------------

######################################################################
# break.awk: to break a pdb file with multiple conformations
#            into many pdb files with single conformation.
#
# usage:     nawk -f break.awk < pdb_file_to_be_broken_up
#
# output:    many small pdb files named "tmp_*.pdb"
#
# limits:    I assumed that there are less than 20 conformations in
#            the pdb file to be broken up. User can increase this number.
#
######################################################################

BEGIN { start = 0
        counter = 0
        file_name[1]  = "tmp_1.pdb"
        file_name[2]  = "tmp_2.pdb"
        file_name[3]  = "tmp_3.pdb"
        file_name[4]  = "tmp_4.pdb"
        file_name[5]  = "tmp_5.pdb"
        file_name[6]  = "tmp_6.pdb"
        file_name[7]  = "tmp_7.pdb"
        file_name[8]  = "tmp_8.pdb"
        file_name[9]  = "tmp_9.pdb"
        file_name[10] = "tmp_10.pdb"
        file_name[11] = "tmp_11.pdb"
        file_name[12] = "tmp_12.pdb"
        file_name[13] = "tmp_13.pdb"
        file_name[14] = "tmp_14.pdb"
        file_name[15] = "tmp_15.pdb"
        file_name[16] = "tmp_16.pdb"
        file_name[17] = "tmp_17.pdb"
        file_name[18] = "tmp_18.pdb"
        file_name[19] = "tmp_19.pdb"
        file_name[20] = "tmp_20.pdb"
      }

   $1 == "MODEL" { start = 1
                   counter = counter + 1
                   next
                 }
   $1 == "ENDMDL" { start = 0
                    next
                  }
   start == 1 {
                print $0 > file_name[counter]
              }
END { }

---------------------------- break.awk ----------------------------


---------------------------- Pdb_to_Arc.bcl -----------------------

#############################################################
# Pdb_to_Arc.bcl   it does pdb --> *car --> *arc
#
# usage:   first source it with Viewer/File/Source_file
#          then use it under the Viewer/Custom pulldown.
#############################################################

define_macro Pdb_to_Arc \
             Lstring Pdb_Root_Name \
             int Start_Frame    \
             int End_Frame

  int index

  Builder

  foreach $index from $Start_Frame to $End_Frame
      get Molecule PDB User ("./"//$Pdb_Root_Name//_//$index//.pdb) TEMP -Heteroatom -Reference_Object
      Potentials Accept -Print_Potentials Accept -Print_Part_Chargs Accept temp
      Put Molecule Biosym temp ("./"//temp_//$index) -Transformed -Displayed -PBC_File
      delete *
  end

  BCL_Unix "/bin/rm -f temp*.mdf"
  BCL_Unix "nawk -f car2arc.awk temp*.car > final.arc "
  BCL_Unix "/bin/rm -f temp*.car"

End_macro
Add_to_pulldown Pdb_to_Arc custom

---------------------------- Pdb_to_Arc.bcl -----------------------


---------------------------- car2arc.awk --------------------------

##################################################################
# car2arc.awk: 
#
# Function:  Converts a collection of .car/.cor files into a single .arc file
#            Each file must correspond to the exact same molecule.
#  
# Syntax:      nawk -f car2arc.awk test*.car > test.arc
##################################################################

BEGIN {n=0}
{
   if (n<2){ #pass through the first 2 lines of the first file
      n++
      print $0
      next
   }
   if (match($1,"!BIOSYM")){ #on all other files, skip the first 2 lines
      getline
      next
   }
   print $0
}

---------------------------- car2arc.awk --------------------------



Jean-Luc Pellequer



More information about the X-plor mailing list