Commit 831f8a51 authored by aknecht2's avatar aknecht2
Browse files

Fixed whitespace errors and re-updated pep8 compliance.

parent 646bda8b
......@@ -20,16 +20,19 @@ file_extensions = {
"bed": ["bed", "narrowPeak", "broadPeak"],
"bwa_genome": ["amb", "ann", "bwt", "pac", "sa"],
"bowtie2_genome": ["1.bt2", "2.bt2", "3.bt2", "4.bt2", "rev.1.bt2", "rev.2.bt2"],
"quality" : ["quality"]
"quality": ["quality"]
}
# list of resources that can be specified per job (step) in
# the workflow and corresponding Pegasus profile info
resources = { "walltime" :{ "namespace" : "globus",
"key" : "maxwalltime"
resources = {
"walltime": {
"namespace": "globus",
"key": "maxwalltime"
},
"memory" : { "namespace" : "condor",
"key" : "request_memory"
"memory": {
"namespace": "condor",
"key": "request_memory"
}
}
......
......@@ -47,6 +47,8 @@ def downloadFile(url, localpath, urltype="ftp://", retries=3, overwrite=True, ch
else:
print "File already exists, skipping download.\n"
return
# http://pythoncentral.io/how-to-check-if-a-string-is-a-number-in-python-including-unicode/
def is_number(s):
try:
......
......@@ -15,6 +15,7 @@ import random
from pprint import pprint
from Pegasus.DAX3 import *
class Workflow(object):
def __init__(self, jobhome, run_file, param_file, config_file, host, username, password):
......@@ -253,7 +254,7 @@ class Workflow(object):
# For each fastq, have Pegasus do the http fetching.
# Files are named EXPID_ACCESSION.fastq.gz
output_name = "%s_%s.fastq.gz" % (run["experiment"], f["accession"])
self._add_file(output_name,"http://" + f["url"],"dummylocal")
self._add_file(output_name, "http://" + f["url"], "dummylocal")
return
def _add_align(self):
......@@ -334,7 +335,7 @@ class Workflow(object):
for key in self.config["profile"][namespace]:
sites += """\n\t<profile namespace="%s" key="%s">%s</profile> """ % (namespace, key, self.config["profile"][namespace][key])
sites +="""</site>
sites += """</site>
<site handle="dummylocal" arch="x86_64" os="LINUX">
<directory type="shared-scratch" path="%s">
<file-server operation="all" url="file://%s" />
......
......@@ -92,10 +92,10 @@ class WorkflowJob(object):
try:
if not is_number(self.params[resource_type]):
self.err += "Resource specification of type '%s' for '%s' must be numeric.\n" \
% (resource_type,self.jobname)
% (resource_type, self.jobname)
except TypeError:
self.err += "Resource specification of type '%s' for '%s' is missing a value.\n" \
% (resource_type,self.jobname)
% (resource_type, self.jobname)
except KeyError:
pass
return
......@@ -136,7 +136,7 @@ class WorkflowJob(object):
print self.err
return None
def _add_job_resources(self,job):
def _add_job_resources(self, job):
"""
Add the job's resources (memory, walltime, etc.) via Pegasus
Profiles.
......@@ -148,7 +148,7 @@ class WorkflowJob(object):
resource_value = self.base[self.jobname][resource_type]
ns = chipathlon.conf.resources[resource_type]["namespace"]
key = chipathlon.conf.resources[resource_type]["key"]
job.profile(ns,key,resource_value)
job.profile(ns, key, resource_value)
def _create_arg_list(self, input_files, output_files):
"""
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment