My software notes

January 25, 2006

re-order the PDB file

Filed under: xplor/xplor-nih/cns — kpwu @ 12:06 am

Please save the followng lines in a shell script file, the script could be worked well in most cases, that is very convinient for change the PDB residue number from 1 to designated number, for example change from 1 to 331, when your protein is a part of C-terminal domain.

Enjoy it
—————————————————-

#!/bin/sh

## Author: Kuen-Phon Wu, 06/10/2004, v 0.5
#############  set up pdb file name ##############
PDB=gb1-2gb1.pdb
output=x.pdb
###############

#### just adjust the $5-33, which -33 is the number you want to minus
####  if you want to plus, just do an addition like +33

awk ‘ $1 ~ \
 /ATOM/{printf (“%s%7s%5s%4s%6s%12.3f%8.3f%8.3f%6.2f%6.2f\n”,\
  $1,$2,$3,$4,$5-33,$6,$7,$8,$9,$10) }
 ‘ $PDB  > _temp

### do sed for LYS+, HIS+,and  ARG+
sed -e ‘s/LYS+ / LYS+/g’ -e ‘s/ARG+ / ARG+/g’ -e ‘s/HIS+ / HIS+/g’ \
 _temp >$output
rm -f _temp

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: