Commit 699d9178 authored by aknecht2's avatar aknecht2
Browse files

Fixed workflow_job extension checking. Fixed bowtie2 extension checking.

parent 47fa3240
......@@ -177,7 +177,7 @@ class Workflow(object):
self._add_file(base_file_name, base_file, "local")
genome_files = self.run_data["genomes"][run["align"]][assembly + "_files"] = {}
genome_files["base_file"] = base_file_name
genome_files["additional_files"] = []
genome_files["additional_files"] = {}
if base_file_ext in chipathlon.conf.genomes[run["align"]]["base_file"]:
prefix = os.path.splitext(base_file)[0]
missing = []
......@@ -189,7 +189,7 @@ class Workflow(object):
name = "%s.%s%s" % (gen_prefix, "" if no_ext else base_file_ext + ".", ext)
path = "%s.%s" % (prefix if no_ext else base_file, ext)
self._add_file(name, path, "local")
genome_files["additional_files"].append(name)
genome_files["additional_files"][ext] = name
if len(missing) > 0:
self.err += "Genome defined with tool '%s' and assembly '%s' is missing additional_files with extensions %s.\n" % (run["align"], assembly, missing)
else:
......@@ -272,9 +272,8 @@ class Workflow(object):
markers["tool"] = run["align"]
gen_prefix = "genome_%s_grch38p6" % (run["align"],)
input_files["ref_genome"] = self.run_data["genomes"][run["align"]]["grch38p6_files"]["base_file"]
for add_file in self.run_data["genomes"][run["align"]]["grch38p6_files"]["additional_files"]:
ext = os.path.splitext(add_file)[1]
additional_files["ref_genome" + ext] = add_file
for ext in chipathlon.conf.genomes[run["align"]]["additional_files"]:
additional_files["ref_genome" + ext] = self.run_data["genomes"][run["align"]]["grch38p6_files"]["additional_files"][ext]
for pair in run["input_sets"]:
for f in pair:
prefix = "%s_%s" % (run["experiment"], f["accession"])
......
......@@ -87,7 +87,7 @@ class WorkflowJob(object):
if self.base[self.jobname][ftype] is not None:
if (len(flist) == len(self.base[self.jobname][ftype])):
for i, f in enumerate(flist):
if not f["name"].split(".", 1)[-1] in chipathlon.conf.file_extensions[self.base[self.jobname][ftype][i]]:
if not any([f["name"][-len(ext):] == ext for ext in chipathlon.conf.file_extensions[self.base[self.jobname][ftype][i]]]):
self.err += "File '%s' is not of type '%s'. Should match one of '%s' extensions.\n" % (f["name"], self.base[self.jobname][ftype][i], chipathlon.conf.file_extensions[self.base[self.jobname][ftype][i]])
valid_files = False
else:
......
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