On Fri, Feb 15, 2013 at 8:39 AM, R.D. Oeffner
In the Phenix GUI under model tools, the program "Sort hetero atom groups" shopuld do what you want. You may have to enable alpha-test programs in the GUI preferences setttings.
Also available on the command line as "phenix.sort_hetams". You will need the latest nightly build for this (1.8.1 doesn't have it), and Rob is correct that you need to enable alpha-test features (but I'm changing that now). There is one potential flaw in the method that I only realized yesterday, which is that covalently bound HETATMs such as carbohydrate groups will be treated as free ligands unless they are already part of a contiguous protein chain (i.e. the chain IDs are the same and there are no TER records or other atoms intervening in the PDB file). In the future we need to take connectivity into account. However, for now you can specify an atom selection to be left unmodified if you wish. -Nat