-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate_job_histogram.py
36 lines (29 loc) · 1.2 KB
/
create_job_histogram.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import os, sys, datetime
"""
This needs module load python/2.6.5 in .bash_profile
"""
def create_job_file(sample):
command = "Rscript /gpfs/home/gerikson/scripts/Wellderly_scripts/GitHub/Coverage_histogram.R"
jobfile = jobs_folder + str(sample) + ".job"
outjob = open(jobfile, 'w')
outjob.write("#!/bin/csh\n")
outjob.write("#PBS -S /bin/bash\n")
outjob.write("#PBS -l nodes=1:ppn=1\n")
outjob.write("#PBS -l mem=24gb\n")
outjob.write("#PBS -l walltime=500:00:00\n")
outjob.write("#PBS -l cput=9600:00:00\n")
outjob.write("#PBS -m n\n")
outjob.write(command + "\n")
outjob.close()
execute = QSUB + ' -e '+ jobs_folder + str(sample) + '.job.err -o ' + jobs_folder + str(sample) + '.job.out ' + jobfile
print execute
sys.stdout.flush()
clustnum = os.popen(execute, 'r')
jobnum = clustnum.readline().strip()
clustnum.close()
print 'start'
print datetime.datetime.now().time()
counter = 0
QSUB = "qsub -q workq -M gerikson@scripps.edu -l mem=24G -l cput=9600:00:00 -l walltime=500:00:00 "
jobs_folder = "/gpfs/group/stsi/data/projects/wellderly/GenomeComb/jobfolder/hist_allData."
create_job_file("Total_coverage_hist")