ADL: Customizing the script submit4.py

Amor A. San Juan amorasj at bii.a-star.edu.sg
Thu Jan 24 01:58:29 PST 2008


Hi everyone!

Thanks for all who took the time to help me about the script to submit
virtual screening jobs to cluster.

Now, I need further help again so please bear with me. The original
submit4.py didnt run successfully in our linux system. I tried to do a bit
of debugging and some script errors persisted.

-------------------
Original submit4.py
-------------------
#!/usr/bin/env python
#
# Usage: submit4.py stem ndlgs

import sys, posix, time

path = "/applications/autodock"

stem = sys.argv[1]
ndlgs = int(sys.argv[2])
ndlg_start = 1
if (len(sys.argv) == 4):
  ndlg_start = int(sys.argv[3])

cwd = posix.getcwd()

created = time.time()
jobIDsName = """%s.%.2f.jobIDs""" % (stem, created)
command = """touch %s\n""" % (jobIDsName,)
posix.system(command)

for i in xrange(ndlg_start, (ndlg_start + ndlgs)):
    #
    jobname = """%s.%03d""" % (stem, i)
    #
    command = """echo "ulimit -s unlimited
echo SHELL is $SHELL
echo PATH is $PATH
cd %s
%s/autodock4 -p %s.dpf -l %s.dlg" > %s.j
chmod +x %s.j
qsub -l cput=23:00:00 -l nodes=1:ppn=1 -l walltime=23:30:00 -l mem=512mb 
%s.j >> %s
""" % (cwd, path, stem, jobname, jobname, jobname, jobname, jobIDsName)
    #
    posix.system(command)
    #
    # next i

command = """echo "Job %s was launched on %d processors with these
job_identifiers:"

cat %s\n""" % (stem, ndlgs, jobIDsName,)
posix.system(command)

----------------------------------
My modified version of submit4.py
----------------------------------
#!/usr/bin/python
#
# Usage: submit4.py stem ndlgs

import sys, posix, time

set path = "/HOME01/BII/biiamor/2007/AD/i86Linux2"

stem = sys.argv[1]
ndlgs = int[sys.argv[2]]
set ndlg_start = 1
if (len"(sys.argv)" == 4):
  ndlg_start = int[sys.argv[3]]

set cwd = posix.getcwd[]

set created = time.time[]
jobIDsName = """%s.%.2f.jobIDs""" % [stem, created]
command = """touch %s\n""" % [jobIDsName,]
posix.system[command]

for i in xrange[ndlg_start, [ndlg_start + ndlgs]]:
    #
    jobname = """%s.%03d""" % [stem, i]

echo SHELL is $SHELL
echo PATH is $PATH
cd %s
%s/autodock4 -p %s.dpf -l %s.dlg" > %s.j
chmod +x %s.j
qsub -l cput=23:00:00 -l nodes=1:ppn=1 -l walltime=23:30:00 -l mem=512mb 
%s.j >> %s
""" % [cwd, path, stem, jobname, jobname, jobname, jobname, jobIDsName]
    #
    set posix.system[command]
    #
    # next i

command = """echo "Job %s was launched on %d processors with these
job_identifiers:"

cat %s\n""" % [stem, ndlgs, jobIDsName,]
posix.system[command]


========================

See the error flags below:

========================

[biiamor at hilbert test]$ csh -v submit4.py

import sys, posix, time

set path = "/HOME01/BII/biiamor/2007/AD/i86Linux2"

stem = sys.argv[1]
stem: No match.
ndlgs = int[sys.argv[2]]
ndlgs: No match.
set ndlg_start = 1
if ( len"(sys.argv)" == 4 ) :
ndlg_start = int[sys.argv[3]]
ndlg_start: No match.

set cwd = posix.getcwd[]

set created = time.time[]
jobIDsName = """%s.%.2f.jobIDs""" % [stem, created]
jobIDsName: Command not found.
command = """touch %s\n""" % [jobIDsName,]
command: No match.
posix.system[command]
posix.system[command]: No match.

for i in xrange[ndlg_start, [ndlg_start + ndlgs]]:
for: Command not found.

jobname = """%s.%03d""" % [stem, i]
jobname: Command not found.

echo SHELL is $SHELL
SHELL is /bin/bash
echo PATH is $PATH
PATH is /HOME01/BII/biiamor/2007/AD/i86Linux2
cd %s
%s: No such file or directory.

||||||||||||||||||||||||||||||||||||||||||

QUESTIONS/Explanations:
1. First error above shows 'No match'. Can someone give an idea what is
this stem about? Do I need to customize it to the path folder I am in? How
about ndlg?

2. Note that I changed the () symbols into [] and the effect is that the
script didnt complain for syntax error. Also, I used several 'set'
arguments. Actually, my default shell is bash but it seems this original
submit4.py is in csh. But then, I was able to manage this by prompting the
csh and not bash, whenever I execute this script.

3. Several error flags of 'command not found' is seen. What is the word to
translate a csh command to bash to shut-off this complaint error?

4. Lastly, the 's' directory can not be found as stated in the error flag
at the bottom. I know that I need to direct the path for the folder
containing the parameters where gpf, dpf etc are located. How to do it?
And where to place it, if for example this directory is located at
/HOME01/BII/biiamor/2008/test


Thanks for the patience.


Amor





More information about the autodock mailing list