Commit dfaec1ed authored by aknecht2's avatar aknecht2
Browse files

Added generic _add_file function.

parent 474a5f59
......@@ -70,6 +70,13 @@ class Workflow(object):
sys.exit(1)
return
def _add_file(self, name, path, site):
f = File(name)
f.addPFN(PFN(path, site))
self.files[name] = f
self.dax.addFile(f)
return
def _raise(self):
if self.err:
raise SystemExit(self.err)
......@@ -164,15 +171,12 @@ class Workflow(object):
if assembly in self.run_data["genomes"][run["align"]]:
base_file = self.run_data["genomes"][run["align"]][assembly]
if os.path.isfile(base_file):
(base_file_prefix,base_file_ext) = os.path.splitext(os.path.basename(base_file))
base_file_ext = base_file_ext[1:]
(base_file_prefix, base_file_ext) = os.path.splitext(os.path.basename(base_file))
base_file_ext = base_file_ext[1:]
base_file_name = gen_prefix + "." + base_file_ext
f = File(base_file_name)
f.addPFN(PFN(base_file, "local"))
self.files[base_file_name] = f
self.dax.addFile(f)
self._add_file(base_file_name)
if base_file_ext in chipathlon.conf.genomes[run["align"]]["base_file"]:
prefix = os.path.splitext(base_file)[0]
prefix = os.path.splitext(base_file)[0]
missing = []
for ext in chipathlon.conf.genomes[run["align"]]["additional_files"]:
if not os.path.isfile(prefix + "." + ext) and not os.path.isfile(base_file + "." + ext):
......
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