This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Job: Collaboration Request to Accomplish a Task

I am looking for a collaborator to assist me in accomplishing this task.

I am trying to construct a polypeptide backbone chain made up of Glycine given only the CA XYZ coordinates of each residue.

In other words: I need to turn these CA atoms:

ATOM      1 CA   GLY A   1    1.408   31.978  -3.772     1.0   0.0          C   
ATOM      2 CA   GLY A   2    0.217   30.077  -0.712     1.0   0.0          C   
ATOM      3 CA   GLY A   3    3.487   28.223  -0.125     1.0   0.0          C   
ATOM      4 CA   GLY A   4    5.525   31.454  -0.244     1.0   0.0          C   
ATOM      5 CA   GLY A   5    2.976   33.18   2.017      1.0   0.0          C   

Into a connected backbone chain made up of Glycines as such:

ATOM      1 N   GLY A   1       2.508  32.931  -3.959  1.00  6.83           N  
ATOM      2 CA  GLY A   1       1.408  31.978  -3.772  1.00  6.25           C  
ATOM      3 C   GLY A   1       1.317  31.570  -2.293  1.00  5.33           C  
ATOM      4 O   GLY A   1       1.981  32.133  -1.424  1.00  5.71           O  
ATOM      5 N   GLY A   2       0.480  30.561  -2.065  1.00  5.99           N  
ATOM      6 CA  GLY A   2       0.217  30.077  -0.712  1.00  5.52           C  
ATOM      7 C   GLY A   2       1.500  29.591  -0.024  1.00  5.18           C  
ATOM      8 O   GLY A   2       1.782  29.941   1.143  1.00  5.40           O  
ATOM      9 N   GLY A   3       2.290  28.779  -0.730  1.00  5.59           N  
ATOM     10 CA  GLY A   3       3.487  28.223  -0.125  1.00  6.37           C  
ATOM     11 C   GLY A   3       4.456  29.346   0.273  1.00  5.81           C  
ATOM     12 O   GLY A   3       5.051  29.325   1.346  1.00  5.99           O  
ATOM     13 N   GLY A   4       4.630  30.358  -0.603  1.00  5.62           N  
ATOM     14 CA  GLY A   4       5.525  31.454  -0.244  1.00  5.95           C  
ATOM     15 C   GLY A   4       4.939  32.296   0.873  1.00  5.10           C  
ATOM     16 O   GLY A   4       5.691  32.806   1.723  1.00  5.86           O  
ATOM     17 N   GLY A   5       3.596  32.448   0.926  1.00  4.76           N  
ATOM     18 CA  GLY A   5       2.976  33.180   2.017  1.00  4.68           C  
ATOM     19 C   GLY A   5       3.328  32.578   3.389  1.00  4.33           C  
ATOM     20 O   GLY A   5       3.461  33.316   4.385  1.00  4.87           O  

If you are able to write a python script that accomplishes this task you will be a co-author in my publication when it comes out.

This task will be included as part of a larger project that is concerned with De Novo protein design. So your work will be cruicial to the entire project.

pdb protein-design python

1 answer

its simple parshing of pdb file, several ways of doing this like

a) GREP **grep "GLY" test.pdb>output.pdb

grep "CA" output.pdb>output2.pdb**

b) AWK

You can do like based on your example in awk:

awk '$3 == "CA" {print $0}' test.pdb>output.pdb

and I assume you will work a real PDB file which will be have many residues not just GLY, then this can be done like

*awk '$3 == "CA" {print $0}' test.pdb>output_CA.pdb awk '$4 == "GLY" {print $0}' output_CA.pdb >output_CA_GLY.pdb*

Do you really need in python ? It is also possible in similar way!,

Wait, i think you miss understood the task.

I am not trying to extract GLY from a PDB file. I have a file (test.pdb) that ONLY has GLY's CA atoms (top example). and I am trying to add the remaining C, O, and N atoms to make up a full GLY amino acid, but also all of the GLY amino acids are oriented in the correct direction that makes them connect to each other and thus form a backbone.

So i want to go from the top example to the bottom example. :-)

Thank you for trying, I appreciate it :-)

And I would prefer it written in python so it can fit into my other python scripts.

Log in to answer this question.