Commit 5710ee45 authored by Philippe BORDRON's avatar Philippe BORDRON
Browse files

Add a warning when condition repartition on multiplate is incorrect

parent 83131de9
......@@ -20,6 +20,16 @@ def conditionInSamples(condition):
return True
return False
def makeConditionToPlatesDict(project):
result = dict()
for s in d["samples"]:
if s["project"] == project:
try:
result[s["condition"]].add(s["run"])
except KeyError:
result[s["condition"]] = set([s["run"]])
return result
# Calculate the minimum number of replicates for a gene to have an expression value (>0) for it to be conserved in analysis.
# The default is the minimum number of samples in a condition if comparisons are to be made, 1 if no comparisons asked.
def calculateMinRep():
......@@ -209,6 +219,19 @@ for c in conditions:
eprint("ERROR make_multiplates_config.py: No samples found for condition: "+c)
sys.exit()
# Verify that comparison conditions are on the same plates
if (project in d["comparisons"]):
hasError = False
condInPlate = makeConditionToPlatesDict(project)
for c in d["comparisons"][project]["comps"]:
notSame = condInPlate[c["condition1"]] != condInPlate[c["condition2"]]
if notSame:
eprint("WARNING make_multiplates_config.py: Conditions for comparison '{}' vs '{}' must be on the same plates".format(c["condition1"], c["condition2"]))
hasError = True
#if hasError:
# sys.exit()
# Verify if sample names are all unique and that all samples have been aligned on same reference genome
sampleNames = set()
refs = set()
......
Markdown is supported
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