Split NMR-style multiple model pdb files into individual models

From CCP4 wiki
Revision as of 16:38, 14 December 2010 by Pozharski (talk | contribs) (Created page with 'This assumes that you have a correctly formatted pdb file that contains both MODEL and ENDMDL records. It gets split into individual pdb files names model_###.pdb. grep -n 'MOD…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This assumes that you have a correctly formatted pdb file that contains both MODEL and ENDMDL records. It gets split into individual pdb files names model_###.pdb.

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