Hi Edward,
just in case someone has a similar problem with attaching protons and
incorrect atom numbering, there is an incredibly easy way to fix it without
having to write your own pdb filter, since the atoms are just numbered
consecutively. Just use the bio3d package in R (not in CRAN) and employ the
oneliner below:
library(bio3d)
pdb <- read.pdb("my.pdb")
pdb$atom[, "eleno"] <- 1:length( pdb$atom[, "eleno"] )
write.pdb(pdb, file="my_corrected.pdb")
That will strip the PDB file of all of its headers, but that generally should
not be a problem.
Cheers,
Martin