Difference between revisions of "Conversion between different data file formats"

From CUC3
Jump to navigation Jump to search
import>Csw34
import>Csw34
Line 18: Line 18:
 
cat tmp1 tmp2 > input.crd
 
cat tmp1 tmp2 > input.crd
 
rm tmp1 tmp2
 
rm tmp1 tmp2
  +
  +
Note: for [[CHARMM]], conversion between crd and pdb can be done by CHARMM itself using an appropriate input file. More info can be found on the CHARMM page for [[

Revision as of 10:21, 1 May 2008

For AMBER

xyz -> inpcrd

  awk '{printf("%.7f %.7f %.7f "), $1, $2, $3} {getline} {printf("%.7f %.7f %.7f\n"), $1, $2, $3}' input.xyz > input.inpcrd

For AMBER and CHARMM

crd -> pdb

  tail +2 input.crd > tmp
  awk '{printf"%4s%7d %-4s %4s%5d%12.3f%8.3f%8.3f\n", "ATOM",$1,$4,$3,$2,$5,$6,$7}' tmp > input.pdb
  rm tmp

pdb -> crd

  awk '{if ($1!="TER" && $1!="END") printf"%5d%5d%4s  %-4s%17.12f%17.12f%17.12f%6s  %-4d\n", $2,$5,$4,$3,$6,$7,$8,"NAME",$5}' input.pdb > tmp1
  wc -l tmp1 | awk '{print $1}'> tmp2
  cat tmp1 tmp2 > input.crd
  rm tmp1 tmp2

Note: for CHARMM, conversion between crd and pdb can be done by CHARMM itself using an appropriate input file. More info can be found on the CHARMM page for [[