Hi Charlie,
hope there are simpler solutions. Meanwhile, here is the universal one -:) :
step 1:
save the lines below (between *****) in a file called split_pdb.py:
*****
import os
import iotbx.pdb
import sys
def run(args):
pdb_inp = iotbx.pdb.input(file_name = args[0])
hierarchy = pdb_inp.construct_hierarchy()
for i_model, model in enumerate(hierarchy.models()):
r = iotbx.pdb.hierarchy.root()
r.append_model(model.detached_copy())
r.write_pdb_file(file_name = "model_%s.pdb"%str(i_model))
if (__name__ == "__main__"):
run(args=sys.argv[1:])
*****
step 2: Run it as:
phenix.python split_pdbs.py pdb2q3p.ent
Note 1: The example file - pdb2q3p.ent (from PDB) contains multiple models,
so you see the result of running the above command. You will need to
replace pdb2q3p.ent with your file.
Note 2: You need to have PHENIX installed.
Let me know if you have any questions or need any help. With a few lines of
modifications I can make the above script as sophisticated/customized as
necessary. We can do it off-list, of course.
Good luck!
Pavel.
On Mon, Dec 13, 2010 at 11:02 PM, Charles W. Carter, Jr
<[email protected]>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
>