Commit c6c1bb38 authored by aknecht2's avatar aknecht2
Browse files

Fixed issues with peak call generators.

parent 7c43c9e4
......@@ -74,10 +74,11 @@ class ModuleGenerator(object):
all_jobs = prev_results[0].all_jobs
all_markers = final_result.all_markers
results = []
for job_name in self.module.get_job_names(all_markers[self.module.name])[:-1]:
for job_dict in self.module.get_job_list(all_markers[self.module.name])[:-1]:
job_name = job_dict.keys()[0]
job_info = job_dict[job_name]
all_jobs.append(self.workflow_jobs[job_name])
output_list = self.module.get_job_params(all_markers[self.module.name], job_name)["outputs"]
for output_info in output_list:
for output_info in job_info["outputs"]:
logical_name = output_info.keys()[0]
result = Result(logical_name, final_result.control_samples, final_result.signal_samples, all_markers, all_jobs, should_save=False)
results.append(result)
......
......@@ -227,9 +227,9 @@ class PeakCallGenerator(ModuleGenerator):
should_save = True
)
run.add_result("peak_call", result)
self.call_pairs[result.full_name] = paired_result
self.call_pairs[result.full_name] = paired_result
return run.get_results("peak_call", "results_sorted.narrowPeak")
return run.get_results("peak_call", "results_sorted.bed")
def find_prev_results(self, run, result):
"""
......
......@@ -44,7 +44,7 @@ class WorkflowModule(object):
pass
return
def _get_job_list(self, markers):
def get_job_list(self, markers):
"""
:param markers: A dictionary containing marker values for the module.
:type markers: dict
......@@ -119,7 +119,7 @@ class WorkflowModule(object):
# If the key is a job, we need to add the job for every
# possible marker depending on recursion depth.
for marker_values in itertools.product(*[marker[1] for marker in add_markers.iteritems()]):
wlist = self._get_job_list(dict(zip(self.order, marker_values)))
wlist = self.get_job_list(dict(zip(self.order, marker_values)))
wlist.append(item)
elif "[" in key and "]" in key:
# Split by either [ or ]
......@@ -159,7 +159,7 @@ class WorkflowModule(object):
return
def get_job_params(self, markers, job_name):
job_list = self._get_job_list(markers)
job_list = self.get_job_list(markers)
for job_dict in job_list:
if job_name == job_dict.keys()[0]:
return job_dict[job_name]
......@@ -172,7 +172,7 @@ class WorkflowModule(object):
Returns a list of job names that match the provided markers.
"""
job_list = self._get_job_list(markers)
job_list = self.get_job_list(markers)
job_names = []
for job_dict in job_list:
job_names.append(job_dict.keys()[0])
......@@ -288,7 +288,7 @@ class WorkflowModule(object):
inputs = []
additional_inputs = []
outputs = []
job_list = self._get_job_list(markers)
job_list = self.get_job_list(markers)
for job_dict in job_list:
job_name = job_dict.keys()[0]
job_info = job_dict[job_name]
......@@ -323,7 +323,7 @@ class WorkflowModule(object):
Walk through the jobs in the modules and add the jobs to the workflow.
"""
job_list = self._get_job_list(markers)
job_list = self.get_job_list(markers)
for job_dict in job_list:
job_name = job_dict.keys()[0]
job_info = job_dict[job_name]
......@@ -352,7 +352,7 @@ class WorkflowModule(object):
def get_dependent_jobs(self, dax, master_jobs, master_files, markers, inputs, additional_inputs, outputs):
dep_list = []
job_list = self._get_job_list(markers)
job_list = self.get_job_list(markers)
for job_dict in job_list:
job_name = job_dict.keys()[0]
job_info = job_dict[job_name]
......@@ -363,7 +363,7 @@ class WorkflowModule(object):
return dep_list
def get_final_outputs(self, markers):
job_list = self._get_job_list(markers)
job_list = self.get_job_list(markers)
job_dict = job_list[-1]
job_name = job_dict.keys()[0]
outputs = job_dict[job_name]["outputs"]
......
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