On Tue, 2010-12-14 at 08:02 +0100, Charles W. Carter, Jr wrote:
> I've run aground trying to find a program to write out individual pdb files from a long file with multiple (>100) models. My file does not contain separate chain IDs, so I cannot use moleman2 or splitpdb.p. I want to retain information about ligands, and so do not want to use drussel's program. CCP4 appears not to offer such capability. Anyone know how to do this?
>
> Thanks,
>
> Charlie
I assume that you have an NMR-style file where individual models are
correctly separated by MODEL/ENDMDL records. Let me know if it's
something else and I'll come up with a different one-liner
grep -n 'MODEL\|ENDMDL' models.pdb | cut -d: -f 1 | awk '{if(NR%2)
printf "sed -n %d,",$1+1; else printf "%dp > model_%03d.pdb\n",
$1-1,NR/2;}' | bash -sf
You multi-model file is models.pdb and it will be split into individual
files named model_###.pdb.
Cheers,
Ed.
--
"I'd jump in myself, if I weren't so good at whistling."
Julian, King of Lemurs
|