0

I am trying to conduct some analysis with my single-chain PDB file (766 residues long), but it requires a chain ID. Currently, there isn't one.

Here is a snippet of the pdb file:

ATOM      1  N   MET     1     -69.269  78.953 -91.441  1.00  0.00           N  
ATOM      2  CA  MET     1     -69.264  78.650 -92.891  1.00  0.00           C  
ATOM      4  C   MET     1     -69.371  79.939 -93.633  1.00  0.00           C  
ATOM      5  O   MET     1     -68.379  80.649 -93.799  1.00  0.00           O  
ATOM      3  CB  MET     1     -70.475  77.774 -93.251  1.00  0.00           C  
ATOM      6  CG  MET     1     -70.505  76.455 -92.477  1.00  0.00           C  
ATOM      7  SD  MET     1     -69.115  75.332 -92.806  1.00  0.00           S  
ATOM      8  CE  MET     1     -69.473  74.270 -91.377  1.00  0.00           C  
ATOM      9  N   ASP     2     -70.583  80.284 -94.111  1.00  0.00           N  
ATOM     10  CA  ASP     2     -70.688  81.539 -94.789  1.00  0.00           C  
ATOM     12  C   ASP     2     -70.661  82.602 -93.737  1.00  0.00           C  
ATOM     13  O   ASP     2     -71.088  82.377 -92.606  1.00  0.00           O  
ATOM     11  CB  ASP     2     -71.963  81.733 -95.626  1.00  0.00           C  
ATOM     14  CG  ASP     2     -71.691  82.908 -96.557  1.00  0.00           C  
ATOM     15  OD1 ASP     2     -70.569  82.953 -97.130  1.00  0.00           O  
ATOM     16  OD2 ASP     2     -72.598  83.768 -96.717  1.00  0.00           O1-
ATOM     17  N   HIS     3     -70.129  83.791 -94.077  1.00  0.00           N  
ATOM     18  CA  HIS     3     -70.045  84.846 -93.110  1.00  0.00           C  
ATOM     20  C   HIS     3     -71.342  85.581 -93.094  1.00  0.00           C  
ATOM     21  O   HIS     3     -72.113  85.574 -94.052  1.00  0.00           O  
ATOM     19  CB  HIS     3     -68.925  85.865 -93.404  1.00  0.00           C  
ATOM     23  CG  HIS     3     -68.749  86.908 -92.336  1.00  0.00           C  
ATOM     25  CD2 HIS     3     -67.998  86.879 -91.200  1.00  0.00           C  
ATOM     22  ND1 HIS     3     -69.357  88.144 -92.351  1.00  0.00           N  
ATOM     26  CE1 HIS     3     -68.947  88.797 -91.234  1.00  0.00           C  
ATOM     24  NE2 HIS     3     -68.121  88.068 -90.504  1.00  0.00           N

What's the best way for me to label the chain as chain A?

skhan21
  • 11
  • 6

1 Answers1

0

Here's the answer.

We need to read the file line by line and put a chain into column 22 of each line that begins with ATOM. Assuming the file is called myfile.pdb, we are trying to replace the empty space that is separated by 17 characters from ATOM with the letter A. This can be accomplished with a relatively simple sed command.

sed 's/^\(ATOM.\{17\}\) /\1A/' myfile.pdb > newfile.pdb

Hope this is helpful!

skhan21
  • 11
  • 6