1
$\begingroup$

I am trying to extract the hydrogen atoms attached to the Ca carbon in N no. of proteins. I would be needing the coordinates to calculate its centroid. How should I do it in python ?

$\endgroup$
0

2 Answers 2

2
$\begingroup$

OK, tried to figure out a way using Biopython library, I believe there are tens of faster ways, having 1lkk_pdb_test.pdb as input :

ATOM      1  N   LEU A 122      49.672   7.391  11.364  1.00 20.16           N  
ANISOU    1  N   LEU A 122     2561   2767   2050    670   -700     42       N  
ATOM      2  CA  LEU A 122      50.030   7.561  12.734  1.00 20.25           C  
ANISOU    2  CA  LEU A 122     2020   3335   2058   -226   -571    629       C  
ATOM      3  C   LEU A 122      48.886   7.480  13.726  1.00 16.62           C  
ANISOU    3  C   LEU A 122     1863   2277   1944   -333   -710    706       C  
ATOM      4  O   LEU A 122      47.816   8.070  13.517  1.00 15.23           O  
ANISOU    4  O   LEU A 122     2132   1556   1887   -122   -845    184       O  
ATOM      5  CB  LEU A 122      51.116   8.488  13.074  1.00 21.98           C  
ANISOU    5  CB  LEU A 122     1769   3688   2587   -148   -358    491       C  
ATOM      6  CG  LEU A 122      51.381   8.978  14.477  1.00 22.50           C  
ANISOU    6  CG  LEU A 122     2191   3459   2586   -263   -523    565       C  
ATOM      7  CD1 LEU A 122      52.229   8.017  15.285  1.00 23.90           C  
ANISOU    7  CD1 LEU A 122     2795   3452   2500   -216   -104    138       C  
ATOM      8  CD2 LEU A 122      51.959  10.377  14.502  1.00 26.42           C  
ANISOU    8  CD2 LEU A 122     3125   3322   3222    375   -323    398       C  
ATOM      9  H1  LEU A 122      48.995   6.786  11.300  1.00 30.24           H  
ANISOU    9  H1  LEU A 122     3829   3829   3829      0      0      0       H  
ATOM     10  H2  LEU A 122      49.399   8.188  11.020  1.00 30.24           H  
ANISOU   10  H2  LEU A 122     3829   3829   3829      0      0      0       H  
ATOM     11  H3  LEU A 122      50.392   7.090  10.897  1.00 30.24           H  
ANISOU   11  H3  LEU A 122     3829   3829   3829      0      0      0       H  
ATOM     12  HA  LEU A 122      50.481   6.686  12.910  1.00 24.30           H  
ANISOU   12  HA  LEU A 122     3077   3077   3077      0      0      0       H  
ATOM     13  HB2 LEU A 122      51.955   8.066  12.760  1.00 26.37           H  
ANISOU   13  HB2 LEU A 122     3339   3339   3339      0      0      0       H  
ATOM     14  HB3 LEU A 122      50.982   9.295  12.515  1.00 26.37           H  
ANISOU   14  HB3 LEU A 122     3339   3339   3339      0      0      0       H  
ATOM     15  HG  LEU A 122      50.493   9.028  14.933  1.00 27.00           H  
ANISOU   15  HG  LEU A 122     3419   3419   3419      0      0      0       H  
ATOM     16 HD11 LEU A 122      51.771   7.153  15.351  1.00 35.85           H  
ANISOU   16 HD11 LEU A 122     4540   4540   4540      0      0      0       H  
ATOM     17 HD12 LEU A 122      53.095   7.895  14.844  1.00 35.85           H  
ANISOU   17 HD12 LEU A 122     4540   4540   4540      0      0      0       H  
ATOM     18 HD13 LEU A 122      52.368   8.382  16.184  1.00 35.85           H  
ANISOU   18 HD13 LEU A 122     4540   4540   4540      0      0      0       H  
ATOM     19 HD21 LEU A 122      52.806  10.390  14.010  1.00 39.63           H  
ANISOU   19 HD21 LEU A 122     5019   5019   5019      0      0      0       H  
ATOM     20 HD22 LEU A 122      51.327  10.999  14.083  1.00 39.63           H  
ANISOU   20 HD22 LEU A 122     5019   5019   5019      0      0      0       H  
ATOM     21 HD23 LEU A 122      52.116  10.649  15.431  1.00 39.63           H  
ANISOU   21 HD23 LEU A 122     5019   5019   5019      0      0      0       H  
ATOM     22  N   GLU A 123      49.124   6.750  14.812  1.00 14.09           N  
ANISOU   22  N   GLU A 123     1166   1937   2055   -326   -424    468       N  
ATOM     23  CA  GLU A 123      48.215   6.514  15.890  1.00 12.65           C  
ANISOU   23  CA  GLU A 123     1143   1584   1903   -273   -331    -29       C  
ATOM     24  C   GLU A 123      46.790   6.330  15.399  1.00 10.88           C  
ANISOU   24  C   GLU A 123     1138   1238   1605   -155   -376    -53       C  
ATOM     25  O   GLU A 123      45.875   7.059  15.809  1.00 10.93           O  
ANISOU   25  O   GLU A 123     1300   1048   1652     37   -173   -144       O  
ATOM     26  CB  GLU A 123      48.256   7.537  17.028  1.00 14.54           C  
ANISOU   26  CB  GLU A 123     1615   1778   1930   -299   -450   -280       C  
ATOM     27  CG  GLU A 123      47.696   6.998  18.341  1.00 19.07           C  
ANISOU   27  CG  GLU A 123     2450   2721   1808   -148   -132   -221       C  
ATOM     28  CD  GLU A 123      47.620   7.948  19.490  1.00 21.48           C  
ANISOU   28  CD  GLU A 123     3199   2805   1858    113    106      6       C  
ATOM     29  OE1 GLU A 123      47.461   9.187  19.266  1.00 25.80           O  
ANISOU   29  OE1 GLU A 123     4100   2736   2608   1002   -257     -4       O  
ATOM     30  OE2 GLU A 123      47.491   7.497  20.672  1.00 22.45           O  
ANISOU   30  OE2 GLU A 123     3024   3373   1819    545    690    367       O  
ATOM     31  H   GLU A 123      49.919   6.375  14.873  1.00 16.91           H  
ANISOU   31  H   GLU A 123     2141   2141   2141      0      0      0       H  
ATOM     32  HA  GLU A 123      48.484   5.640  16.294  1.00 15.18           H  
ANISOU   32  HA  GLU A 123     1922   1922   1922      0      0      0       H  
ATOM     33  HB2 GLU A 123      49.194   7.821  17.171  1.00 17.45           H  
ANISOU   33  HB2 GLU A 123     2210   2210   2210      0      0      0       H  
ATOM     34  HB3 GLU A 123      47.737   8.336  16.761  1.00 17.45           H  
ANISOU   34  HB3 GLU A 123     2210   2210   2210      0      0      0       H  
ATOM     35  HG2 GLU A 123      46.784   6.654  18.167  1.00 22.88           H  
ANISOU   35  HG2 GLU A 123     2897   2897   2897      0      0      0       H  
ATOM     36  HG3 GLU A 123      48.252   6.227  18.618  1.00 22.88           H  
ANISOU   36  HG3 GLU A 123     2897   2897   2897      0      0      0       H  
ATOM     37  N   PRO A 124      46.576   5.340  14.522  1.00  9.86           N  
ANISOU   37  N   PRO A 124      893   1140   1575     13   -285      8       N  
ATOM     38  CA  PRO A 124      45.182   5.138  14.041  1.00  8.89           C  
ANISOU   38  CA  PRO A 124      875   1151   1229     -6   -227     93       C  
ATOM     39  C   PRO A 124      44.244   4.845  15.208  1.00  8.67           C  
ANISOU   39  C   PRO A 124      858   1071   1245    -81   -189    -53       C  
ATOM     40  O   PRO A 124      44.593   4.143  16.165  1.00  8.98           O  
ANISOU   40  O   PRO A 124     1088   1065   1134    -47   -410    127       O  
ATOM     41  CB  PRO A 124      45.309   3.946  13.121  1.00  9.41           C  
ANISOU   41  CB  PRO A 124     1048   1085   1312     99     -1    -37       C  
ATOM     42  CG  PRO A 124      46.555   3.221  13.556  1.00  9.55           C  
ANISOU   42  CG  PRO A 124     1054   1161   1282     62   -243      6       C  
ATOM     43  CD  PRO A 124      47.489   4.326  13.988  1.00 10.06           C  
ANISOU   43  CD  PRO A 124      911   1179   1591    122   -319   -125       C  
ATOM     44  HA  PRO A 124      44.868   5.939  13.533  1.00 10.67           H  
ANISOU   44  HA  PRO A 124     1351   1351   1351      0      0      0       H  
ATOM     45  HB2 PRO A 124      44.517   3.357  13.204  1.00 11.29           H  
ANISOU   45  HB2 PRO A 124     1429   1429   1429      0      0      0       H  
ATOM     46  HB3 PRO A 124      45.388   4.241  12.180  1.00 11.29           H  
ANISOU   46  HB3 PRO A 124     1429   1429   1429      0      0      0       H  
ATOM     47  HG2 PRO A 124      46.363   2.605  14.307  1.00 11.46           H  
ANISOU   47  HG2 PRO A 124     1451   1451   1451      0      0      0       H  
ATOM     48  HG3 PRO A 124      46.943   2.702  12.807  1.00 11.46           H  
ANISOU   48  HG3 PRO A 124     1451   1451   1451      0      0      0       H  
ATOM     49  HD2 PRO A 124      48.119   4.010  14.683  1.00 12.07           H  
ANISOU   49  HD2 PRO A 124     1528   1528   1528      0      0      0       H  
ATOM     50  HD3 PRO A 124      48.005   4.678  13.220  1.00 12.07           H  
ANISOU   50  HD3 PRO A 124     1528   1528   1528      0      0      0       H  
END                                                                             

my code is:

import Bio

from Bio.PDB import PDBParser


print('imported Biopython module vesion : ' , Bio.__version__)


parser = PDBParser (QUIET = True)

structure = parser.get_structure('test',  '1lkk_pdb_test.pdb')


atoms = structure.get_atoms()
    

coordz = []

for i in [i for i in atoms]:
    
    if i.get_id() == 'HA' :
     
        print(i.get_parent(), i.get_parent().id, i, i.coord)
        
        coordz.append(i.coord)        

print('coordz list : ')

for i in coordz :
    print(i , type(i))


output:

imported Biopython module vesion :  1.80
imported Biopython module vesion :  1.80
<Residue LEU het=  resseq=122 icode= > (' ', 122, ' ') <Atom HA> [50.481  6.686 12.91 ]
<Residue GLU het=  resseq=123 icode= > (' ', 123, ' ') <Atom HA> [48.484  5.64  16.294]
<Residue PRO het=  resseq=124 icode= > (' ', 124, ' ') <Atom HA> [44.868  5.939 13.533]
coordz list : 
[50.481  6.686 12.91 ] <class 'numpy.ndarray'>
[48.484  5.64  16.294] <class 'numpy.ndarray'>
[44.868  5.939 13.533] <class 'numpy.ndarray'>

as per the reason HA represent Cα hydrogen, please refer to _

Westbrook, John D et al. “The chemical component dictionary: complete descriptions of constituent molecules in experimentally determined 3D macromolecules in the Protein Data Bank.” Bioinformatics (Oxford, England) vol. 31,8 (2015): 1274-8. doi:10.1093/bioinformatics/btu789

httpswww.ncbi.nlm.nih.govpmcarticlesPMC4393513pdfbtu789.pdf

Chemical Component Dictionary

as explamples pages for Leucine links to :

https://www.ebi.ac.uk/pdbe-srv/pdbechem/chemicalCompound/show/LEU

and http://ligand-expo.rcsb.org/reports/L/LEU/LEU_D3L3.gif

lot of trouble to find a diagram:

enter image description here

Just loop over all your proteins in a similar way and store the coords as you need/wish, remember coordinates are retrieved as numpy arrays.

$\endgroup$
1
$\begingroup$

I would import the PDB into the molecular dynamics package GROMACS and use the built-in utilities to calculate the centroid (https://manual.gromacs.org/current/onlinehelp/gmx-rms.html). This is much simpler than trying to write your own utility for this. Other pre-written calculations to perform on your PDB files: https://manual.gromacs.org/current/user-guide/cmdline.html

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.