@@ -0,0 +1,1002 @@
+#!/usr/bin/python%0A%0Aimport json%0Aimport sys%0A%0A'''%0A%0AThis is very much a thrown-together script. Sometime i'll set down and do a better job integrating this%0Ainto the modelseed API.%0A%0AGiven a JSON object calculate the false positive, negative rates. Optionally omit everything that isn't%0Ain the specified media.%0A%0A'''%0A%0Aif len(sys.argv) %3C 1:%0A    raise IOError(%22Usage: $prog %5BPhenotype_json_file%5D %5BMedia%5D%22)%0A%0As = json.load(open(sys.argv%5B1%5D, %22r%22))%0A%0Aif len(sys.argv) %3E 2:%0A    media = sys.argv%5B2%5D%0Aelse:%0A    media = None%0A%0Asims = s%5B%22phenotypeSimulations%22%5D%0A%0ACN = 0%0ACP = 0%0AFN = 0%0AFP = 0%0A%0Afor sim in sims:%0A    med = sim%5B0%5D%5B1%5D%0A    typ = sim%5B3%5D%0A    if media is not None:%0A        if media != med:%0A            continue%0A    if typ == %22CN%22:%0A        CN +=1%0A    elif typ == %22CP%22:%0A        CP += 1%0A    elif typ == %22FN%22:%0A        FN += 1%0A    elif typ == %22FP%22:%0A        FP += 1%0A%0Aprint %22CN (correct negative): %25d%22 %25(CN)%0Aprint %22CP (correct positive): %25d%22 %25(CP)%0Aprint %22FN (false negative): %25d%22 %25(FN)%0Aprint %22FP (false positive): %25d%22 %25(FP)%0A

Improve commenting.