Commit 7b1a0602 authored by aknecht2's avatar aknecht2
Browse files

Adjusted db to use signal instead of experiment. Updated requirements for...

Adjusted db to use signal instead of experiment.  Updated requirements for experiment validation in preparation for helper script.
parent fbaaabb7
......@@ -219,7 +219,6 @@ class MongoDB(object):
try:
cursor = self.db.experiments.find({
"target": {"$exists": True},
"revoked_files.0": {"$exists": False},
"@id": "/experiments/%s/" % (experiment_id,)
})
if cursor.count() == 1:
......@@ -261,7 +260,6 @@ class MongoDB(object):
data = ""
cursor = self.db.experiments.find({
"target": {"$exists": True},
"revoked_files.0": {"$exists": False},
"assembly.0": {"$exists": True},
"assembly.1": {"$exists": False},
"@id": "/experiments/%s/" % (experiment_id,)
......@@ -353,7 +351,6 @@ class MongoDB(object):
# Next, we check that there is a least 1 possible control
check3 = self.db.experiments.find({
"target": {"$exists": True},
"revoked_files.0": {"$exists": False},
"assembly.0": {"$exists": True},
"assembly.1": {"$exists": False},
"possible_controls.0": {"$exists": True},
......@@ -372,7 +369,6 @@ class MongoDB(object):
{
"$match": {
"target": {"$exists": True},
"revoked_files.0": {"$exists": False},
"assembly.0": {"$exists": True},
"assembly.1": {"$exists": False},
"possible_controls.0": {"$exists": True},
......@@ -410,12 +406,12 @@ class MongoDB(object):
# 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"] == 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):
signal_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(signal_inputs) > 0):
msg = "Succesfully retrieved input files for experiment with id '%s'.\n" % (experiment_id,)
data = {
"control": control_inputs,
"experiment": experiment_inputs
"signal": signal_inputs
}
else:
valid = False
......
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