On 02/12/11 14:45, Simon Kolstoe wrote: > I've got a text file with multiple conformations of a ligand that has been docked to a protein using autodock, which I am trying to split into separate pdb files in order to visualise in pymol/coot etc. > > Previously I've used the script pasted below, but it is now falling over just after it creates the pdb file with the error: > > expr: syntax error > csplit: }: bad repetition count > ./split_results.com: line 11: syntax error near unexpected token `(' > ./split_results.com: line 11: `foreach f ($outputname.[0-9][0-9][0-9])' > This doesn't answer your question. But I'd just do it in Coot: (define (split-multi-alt-confs) (using-active-atom (let ((alt-confs (residue-alt-confs aa-imol aa-chain-id aa-res-no aa-ins-code))) (for-each (lambda (alt-conf) (let* ((ss (string-append "//*/*/*: ," alt-conf "")) (imol-new (new-molecule-by-atom-selection aa-imol ss)) (new-name (string-append (strip-extension (molecule-name aa-imol)) "-alt-conf-" alt-conf))) (set-molecule-name imol-new new-name))) (residue-alt-confs aa-imol aa-chain-id aa-res-no aa-ins-code))))) Centre on your interesting ligand with multiple alt-confs and then use scripting -> scheme (split-multi-alt-confs) If you want to write out the various pdb files, you can add in a (write-pdb-file imol-new (string-append (molecule-name imol-new) ".pdb")) before the set-molecule-name... line. Paul.