Commit 5692acb8 authored by aknecht2's avatar aknecht2
Browse files

Updated get_samples by experiment to use file_type param instead of just using...

Updated get_samples by experiment to use file_type param instead of just using fastq.  Will be used for the helper script & useful for finding valid signal / control samples.
parent 5e9457f0
......@@ -344,7 +344,7 @@ class MongoDB(object):
)
return (valid, msg, data)
def get_samples(self, experiment_id):
def get_samples(self, experiment_id, file_type):
valid = True
msg = ""
data = {}
......@@ -409,8 +409,8 @@ class MongoDB(object):
cursor = self.db.experiments.aggregate(pipeline)
# We should have only 1 document
document = cursor.next()
control_inputs = [sample for control in document["possible_controls"] for sample in control["samples"] if ("file_type" in sample and sample["file_type"] == "fastq")]
experiment_inputs = [sample for sample in document["samples"][0] if ("file_type" in sample and sample["file_type"] == "fastq")]
control_inputs = [sample for control in document["possible_controls"] for sample in control["samples"] if ("file_type" in sample and sample["file_type"] == file_type)]
experiment_inputs = [sample for sample in document["samples"][0] if ("file_type" in sample and sample["file_type"] == file_type)]
if (len(control_inputs) > 0 and len(experiment_inputs) > 0):
msg = "Succesfully retrieved input files for experiment with id '%s'.\n" % (experiment_id,)
data = {
......
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