
import os

'''
Submits a job for every sample defined in the info dict
'''

script_path = "/lustre/home/ekoch/code_repos/BaSiCs/Examples/THINGS/"

submit_file = os.path.join(script_path, "submit_THINGS.pbs")

# Load in the info dict for the names
execfile(os.path.join(script_path, "info_THINGS.py"))

datapath = "/lustre/home/ekoch/THINGS/"

for name in galaxy_props:
    galaxy_path = os.path.join(datapath, name)
    # Now submit it!
    os.system("qsub -v INP={1} {0}".format(submit_file, galaxy_path))

@@ -3,16 +3,46 @@
 mport os
+%0Afrom datetime import datetime
 %0A%0A'''%0ASu
@@ -100,16 +100,89 @@
 ct%0A'''%0A%0A
+%0Adef timestring():%0A    return datetime.now().strftime(%22%25Y%25m%25d%25H%25M%25S%25f%22)%0A%0A
 script_p
@@ -513,16 +513,243 @@
 , name)%0A
+    now_time = timestring()%0A    error_file = %5C%0A        os.path.join(galaxy_path, %22%7B0%7D_bubbles_%7B1%7D.err%22.format(name, now_time))%0A    output_file = %5C%0A        os.path.join(galaxy_path, %22%7B0%7D_bubbles_%7B1%7D.out%22.format(name, now_time))%0A
     # No
@@ -780,16 +780,30 @@
 em(%22qsub
+ -e %7B2%7D -o %7B3%7D
  -v INP=
@@ -830,23 +830,219 @@
 it_file,
- galaxy_path
+%0A                                                         galaxy_path,%0A                                                         error_file,%0A                                                         output_file
 ))%0A

Write the error and output files with the galaxy name and in the right folder