Hello All,
I am trying to write a small bash script to make my life easier for an analysis. I have multiple folders and inside them are 10 output files with an extension .pdbqt What I am trying to do is to read the folder content and then make a PyMol (.pml) file to load the molecules and then display it. When I close the PyMol, the script should go to the next folder and do the same thing again. Below I am pasting the code, any help is greatly appreciated :o
#!/bin/bash
for f in Frog-mol-ryan_*; do
if [ -d "${f}" ]; then
echo Loading structures in Pymol: $f
cat <<EOF >log.pml
load /server/John/Docking-Studies/docking-FC996-analog/MR1004/test/Frog-mol-ryan_*/out_Frog-ryan-mol_ligand_*.pdbqt
reset
load /server/John/Docking-Studies/Insilico-mod-FC996/docking-FC996-analog/PDBs/Holo-with-Bpore.pdb
cmd.hide("everything","holo-with-Bpore")
cmd.show("cartoon" ,"holo-with-Bpore")
cmd.show("sticks", "out_Frog-mol-ryan_ligand_*.pdbqt")
EOF
/usr/bin/pymol log.pml
fi
done
The output log.pml is:
load /server/John/Docking-Studies/Insilico-mod-FC996/docking-FC996-analog/MR1004/test/Frog-mol-ryan_*/out__ligand_*.pdbqt
reset
load /server/John/Docking-Studies/Insilico-mod-FC996/docking-FC996-analog/PDBs/Holo-with-Bpore.pdb
cmd.hide("everything","holo-with-Bpore")
cmd.show("cartoon" ,"holo-with-Bpore")
cmd.show("sticks", "out__ligand_*.pdbqt")
I am not able to pass the argument in cat EOF section.
Kindly help
Thanks