Sunday, May 16, 2010

More on File Mainpulations

Hey,

Sometimes its tedious to get the file as u want it to be. One such case is obtaining ATOM records from a PDB file. For those of you who dont know about pdb files (http://www.wwpdb.org/documentation/format32/v3.2.html) the link is a good place to start.

But in short it contains various sections like HEADERS,ATOM,HETATM,CONECT etc. ATOM records always begin with the word 'ATOM' , HETATM records with 'HETATM' and so on.

At times you would want to extract just the atom record. Instead going through the routine procedure of opening it in a text editor and then deleting all the lines that does not being with ATOM, heres a short,easy and a single line command.
grep 'ATOM  ' pdbid.pdb>| atom.pdb
Thats it .. You have the atom records saved in atom.pdb

No comments:

Post a Comment