> "Resist the urge to duplicate the work of others" should be the first rule of 
> programming if its not already (although it's the hardest rule to follow).



I completely agree in principal, but certainly practicality is different.  If 
you're doing anything complex, or even doing several simple independent jobs, 
then investing the time to learn a good PDB parser is critical. 

On the other hand, what OP wants to do is this:

egrep "^ATOM" 1ABC.pdb  | cut -b 31-38 | tr -d ' ' > 1ABC.X_Coordinate.dat

which I wrote faster than I could download any parser, much less begin to 
understand how to use it.  

Of course, if OP isn't on *nix or OS X, then good luck to him. :)

One caveat is that some programs output misformatted PDB files.  But there's no 
guarantee that any parser you use will correct for whatever error is in your 
PDB files.  And thankfully, that's become drastically less frequent, especially 
with the major remediations of the PDB in recent years.



For Unix newbies:
egrep pulls lines starting with ATOM
cut -b 31-38 pulls bytes 31-38 from each line
tr -d ' ' removes the leading spaces from the field
> 1ABC.X_Coordinate.dat redirects the output into a file


Column specs for ATOM records are here:
http://deposit.rcsb.org/adit/docs/pdb_atom_format.html



-Alex




Reply via email to