2
$\begingroup$

I'm trying to execute pymol from a shell script (and it is not working). I'm not executing the script on PyMOL but even if I do this, it doesn't work neither. However, if instead of a script the commands are manually written in PyMOL, everything goes well.

Here is the code:

#!/bin/bash
pwd
echo 'fetch 1OYT 
remove resn HOH
h_add elem O or elem N
select ligand, resn FSN 
' > scriptt.pml
pymol scriptt.pml

One of the problems, you will see, is that PyMOL does not remove the water molecules. Another issue is that the program does not exit. Do you have any idea what's going on there?

$\endgroup$
3
  • $\begingroup$ What program does not exist? What errors are you getting? Is pymol in your PATH? I have no experience with pymol, are you sure remove resn HOH is the right command to remove water? $\endgroup$
    – terdon
    Apr 5 '19 at 17:11
  • $\begingroup$ @terdon the post reads 'exit', not 'exist'. And the same commands typed in the program interface, works fine... $\endgroup$
    – user4378
    Apr 5 '19 at 17:23
  • $\begingroup$ I'm thought Pymol does hydrate and and remove water. I dunno about the command line, but there's options in the GUI $\endgroup$
    – M__
    Apr 5 '19 at 17:37
1
$\begingroup$

Your shell script is fine, and works as expected. The reason it hangs is that you aren't telling PyMol to exit after running your script, so it's still running and waiting for the next command. Just add a quit at the end and it should work:

#!/bin/bash
pwd
echo 'fetch 1OYT 
remove resn HOH
h_add elem O or elem N
select ligand, resn FSN 
select prot, 1OYT and not ligand, 
save lig.pdb, ligand 
save prot.pdb, prot
quit
' > scriptt.pml
pymol scriptt.pml
obabel prot.pdb -xr -O prot.pdbqt 
obabel lig.pdb -O lig.pdbqt
echo 'babel conversion is finished'
$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy