This is a test version of Biostars. For the public version, visit https://www.biostars.org.
extracting atomic coordinates on UNIX

Hi everyone,

I have a PDB file and am tasked with extracting the atomic coordinates. I have gotten to the point where the lines are highlighted in UNIX but not sure exactly how to extract.

Thanks in advance for any help!

pdb

1 answer

In each line of the PDB file we check that the first column contains ATOM, and that one of the four backbone atoms is in 3rd column.

awk '{if ($1=="ATOM" && $3=="CA") print $0; if ($1=="ATOM" && $3=="C") print $0; if ($1=="ATOM" && $3=="N") print $0; if ($1=="ATOM" && $3=="O") print $0}' 4ZRY.PDB > 4ZRY_backbone.pdb

Thank you so much for the help!

Log in to answer this question.