diff --git a/chipathlon/db.py b/chipathlon/db.py index f9f485dd2ab9bcd6afd0ef52a378a821f4efc7f6..643a0f01b2d93b335fa1708813a6ac5b378f5778 100644 --- a/chipathlon/db.py +++ b/chipathlon/db.py @@ -39,13 +39,13 @@ class MongoDB(object): print "result_id %s doesn't exist." % (result_id,) return - def check_result(self, control_sample_ids, experiment_sample_ids, ref_genome, result_type, params, debug=False): + def check_result(self, file_name, control_sample_ids, experiment_sample_ids, ref_genome, result_type, params, debug=False): try: query = { "result_type": result_type, "ref_genome": ref_genome, "timestamp": {"$exists": True}, - "file_name": {"$exists": True} + "file_name": file_name } # In the case that there are 0 samples we just want to check for existence. query["control_sample_ids"] = {"$all": control_sample_ids} if (len(control_sample_ids) > 0) else {"$exists": True} diff --git a/chipathlon/workflow.py b/chipathlon/workflow.py index a7ab31ad81346211eb2e0c6aeb01f17f99a533d2..4e3ccd27c382d70e24c0c5a490d415da58c985b1 100644 --- a/chipathlon/workflow.py +++ b/chipathlon/workflow.py @@ -265,6 +265,7 @@ class Workflow(object): params[job_name] = job_arg_dict result_list.append( self.mdb.check_result( + name, outputs[name]["control_sample_ids"], outputs[name]["experiment_sample_ids"], ref_genome, @@ -321,7 +322,7 @@ class Workflow(object): # The output returned from the generator is more complex than # what the module needs module_outputs = {mod_file_name : outputs[mod_file_name]["file_name"] for mod_file_name in outputs} - + download_gen.module.add_jobs(self.dax, self.jobs, self.files, markers, inputs, additional_inputs, module_outputs) self._save_results(outputs, ref_genome) return