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