Conversion between different data file formats: Difference between revisions

From CUC3
Jump to navigation Jump to search
import>Em427
No edit summary
import>Msb50
No edit summary
 
(18 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==== For [[AMBER]] ====
'''xyz -> inpcrd'''


xyz -> inpcrd
prepare file xyz2inpcrd containing the following line:


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


==== For [[AMBER]] and [[CHARMM]] ====
next type
crd -> pdb


awk -f xyz2inpcrd input.xyz outpur.inpcrd
tail +2 input.crd > tmp
awk '{printf"%4s%7d %-4s%4s %s%5d%11.3f%8.3f%8.3f\n", "ATOM",$1,$4,$3,"A",$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
'''crd -> pdb'''
wc -l tmp1 | awk '{print $1}'> tmp2
cat tmp1 tmp2 > input.crd
rm tmp1 tmp2


Notes:
tail +2 input.crd > input.crd_nohead
awk '{printf"%4s%7d %-4s %4s%5d%12.3f%8.3f%8.3f\n", "ATOM",$1,$4,$3,$2,$5,$6,$7}' input.crd_nohead > input.pdb
1. Conversion between .crd and .pdb can be done by [[CHARMM]]- more info can be found on the page for [[converting between '.crd' and '.pdb']]
rm input.crd_nohead

2. The same thing can be done by [[VMD]] - both for [[AMBER]] and [[CHARMM]] files.

3. In [[AMBER]] package you can find useful program called ''ambpdb''. It can convert many formats and binary output files as well as add some interesting information like hydrogen bonds or salt bridges.

Latest revision as of 16:24, 7 October 2008

For AMBER

xyz -> inpcrd

  awk '{printf("%12.7f %11.7f %11.7f "), $1, $2, $3} {getline} {printf("%11.7f %11.7f %11.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 %s%5d%11.3f%8.3f%8.3f\n", "ATOM",$1,$4,$3,"A",$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

Notes:

1. Conversion between .crd and .pdb can be done by CHARMM- more info can be found on the page for converting between '.crd' and '.pdb'

2. The same thing can be done by VMD - both for AMBER and CHARMM files.

3. In AMBER package you can find useful program called ambpdb. It can convert many formats and binary output files as well as add some interesting information like hydrogen bonds or salt bridges.