Extracting fields from a Protein Data Bank file (PDB) using python
Sometime, for large pdb
files, one cannot use the split
command from python.
Below is the python line to extract fields from a pdb
file:
Sample output:
# Original line
HETATM10000 O HOH B3257 2.509 40.006 -4.097 1.00 0.00 O
# Splitted line
['HETATM', '10000', ' O ', 'HOH', 'B', '3257', ' 2.509', ' 40.006', ' -4.097']
# Go back to pdb formatted line
HETATM10000 O HOH B3257 2.509 40.006 -4.097