Commit 0203d84f authored by aknecht2's avatar aknecht2
Browse files

Added new type of argument 'list' to handle necessary inputs for gem.

parent 28418e06
......@@ -88,7 +88,8 @@ resources = {
# stderr -> Any file argument that is redirected from stderr
argument_types = {
"argument": ["string", "numeric"],
"file": ["file", "rawfile", "stdout", "stderr"]
"file": ["file", "rawfile", "stdout", "stderr"],
"list": ["list"]
}
# Defines information about arguments
......
......@@ -11,6 +11,8 @@ gem_callpeak:
additional_inputs:
- read_dist:
type: file
- chr_fasta:
type: list
outputs:
- bed:
type: file
......
......@@ -44,8 +44,10 @@ class PeakCallGenerator(ModuleGenerator):
"control.bed": file_pair[1]["file_name"],
"prefix": prefix
}
chr_fasta = []
additional_inputs = {
"read.dist" : self.module.workflow_jobs['gem_callpeak'].raw_files.keys()[0]
"read.dist" : self.module.workflow_jobs['gem_callpeak'].raw_files.keys()[0],
"chr_fasta": self.run_data.genomes[run["genome"]]["chr_fasta"]
}
sample_data = [file_pair[0]["sample"], file_pair[1]["sample"]]
experiment_sample_ids = file_pair[0]["experiment_sample_ids"]
......
......@@ -167,6 +167,15 @@ class RunData(object):
chrom_name = "%s_%s" % (assembly, os.path.basename(self.data["genomes"][assembly]["chrom.sizes"]))
self._add_file(chrom_name, self.data["genomes"][assembly]["chrom.sizes"], "local")
self.genomes[assembly]["chrom.sizes"] = chrom_name
self.genomes[assembly]["chr_fasta"] = []
# Load chromosome files here:
base_dir = os.path.dirname(os.path.dirname(self.data["genomes"][assembly]["chrom.sizes"] + "/"))
for root, files, dirs in os.walk(base_dir):
for f in files:
if f.startswith("chr"):
self._add_file(f, root + "/" + f, "local")
self.genomes[assembly]["chr_fasta"].append(f)
break
else:
print self.err
raise SystemExit(1)
......
......@@ -323,6 +323,9 @@ class WorkflowJob(object):
for param in inputs + additional_inputs:
if param["type"] == "file":
job.uses(param["file"], link=Link.INPUT)
elif param["type"] == "list":
for f in param["value"]:
job.uses(f["file"], link=Link.INPUT)
for output_file in outputs:
job.uses(output_file["file"], link=Link.OUTPUT, transfer=True)
# Redirect stdout / stderr
......
......@@ -405,6 +405,15 @@ class WorkflowModule(object):
"file": master_files[arg_params[param_name]],
"type": param_info["type"]
})
elif param_info["type"] in chipathlon.conf.argument_types["list"]:
sub_list = []
for val in arg_params[param_name]:
sub_list.append({
"name": arg_params[param_name],
"file": master_files[arg_params[param_name]],
"type": "file"
})
param_list.append(sub_list)
else:
param_list.append({
"name": param_name,
......
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