Simon

This appears to be a csh or tcsh script: if so the first line must be
"#!/bin/csh" or "#!/bin/tcsh", otherwise it takes it to be a sh
script.

Cheers

-- Ian

On 2 December 2011 14:45, Simon Kolstoe <s.kols...@ucl.ac.uk> wrote:
> Hi there,
>
> 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])'
>
> Can any of you wizzy programmers give me a hand with getting this to work 
> again? (it's on a mac just in the normal terminal)
>
> Thanks,
>
> Simon
>
> The script:
>
> #!
> grep '^DOCKED' output.dlg | cut -c9- > my_docking.pdbqt
> cut -c-66 my_docking.pdbqt > my_docking.pdb
> # csh to split pdb files from autodock output.
> # edit outputname.
> #
> set outputname=output
> set a=`grep ENDMDL my_docking.pdb | wc -l`
> set b=`expr $a - 2`
> csplit -k -s -n 3 -f $outputname. my_docking.pdb '/^ENDMDL/+1' '{'$b'}'
> foreach f ($outputname.[0-9][0-9][0-9])
> mv $f $f.pdb
> end

Reply via email to