Entering edit mode
9.5 years ago
venu
7.1k
I've modeled a protein. Here I want to replace ATOM
with HETATM
when fourth column contains UNK
. Here is a sample of pdb file.
ATOM 7525 HB2 PHE A 462 24.643 -50.200 29.725 1.00 0.00 H
ATOM 7526 HD1 PHE A 462 22.585 -51.535 30.162 1.00 0.00 H
ATOM 7527 HD2 PHE A 462 25.166 -52.418 26.825 1.00 0.00 H
ATOM 7528 HE1 PHE A 462 20.867 -53.074 29.206 1.00 0.00 H
ATOM 7529 HE2 PHE A 462 23.429 -53.905 25.870 1.00 0.00 H
ATOM 7530 HZ PHE A 462 21.293 -54.268 27.091 1.00 0.00 H
TER 7531 HZ PHE A 462
ATOM 7532 O1 UNK 1 8.575 -36.095 63.165 1.00 0.00 O
ATOM 7533 O2 UNK 1 10.566 -35.374 62.229 1.00 0.00 O
ATOM 7534 N3 UNK 1 6.742 -36.630 57.870 1.00 0.00 N
ATOM 7535 N4 UNK 1 9.871 -33.867 59.866 1.00 0.00 N
ATOM 7536 C5 UNK 1 8.179 -34.893 58.559 1.00 0.00 C
ATOM 7537 C6 UNK 1 6.720 -35.389 58.665 1.00 0.00 C
I've tried sed
, but unable to give a condition on specific column and replace first column.
I thought it
awk
extracts the lines containing UNK. Thank youYou can move the comment to an answer :).