aboutsummaryrefslogtreecommitdiff
path: root/wqflask/maintenance/dataset/probesets.py
diff options
context:
space:
mode:
Diffstat (limited to 'wqflask/maintenance/dataset/probesets.py')
-rw-r--r--wqflask/maintenance/dataset/probesets.py26
1 files changed, 23 insertions, 3 deletions
diff --git a/wqflask/maintenance/dataset/probesets.py b/wqflask/maintenance/dataset/probesets.py
index 06b9a394..26d794a8 100644
--- a/wqflask/maintenance/dataset/probesets.py
+++ b/wqflask/maintenance/dataset/probesets.py
@@ -1,6 +1,7 @@
import sys
import utilities
+import datastructure
import genotypes
def get_probesetxref(probesetfreezeid):
@@ -48,7 +49,7 @@ def get_probesetxref_probesetfreezeid(locus, probesetfreezeid):
def get_probesetxref_inbredsetid(locus, inbredsetid):
cursor = utilities.get_cursor()
sql = """
- SELECT ProbeSetXRef.`ProbeSetId`, ProbeSetXRef.`mean`, ProbeSetXRef.`LRS`, ProbeSetXRef.`Locus`
+ SELECT ProbeSetXRef.`ProbeSetId`, ProbeSetXRef.`mean`, ProbeSetXRef.`LRS`, ProbeSetXRef.`Locus`, ProbeSetXRef.`ProbeSetFreezeId`
FROM (ProbeSetXRef, ProbeSetFreeze, ProbeFreeze)
WHERE ProbeSetXRef.`ProbeSetFreezeId`=ProbeSetFreeze.`Id`
AND ProbeSetFreeze.`ProbeFreezeId`=ProbeFreeze.`Id`
@@ -63,6 +64,13 @@ def get_normalized_probeset(locus, inbredsetid):
probesetxrefs = get_probesetxref_inbredsetid(locus, inbredsetid)
for probesetxref in probesetxrefs:
normalized_probeset = []
+ #
+ probesetfreezeid = probesetxref[4]
+ probesetfreeze = datastructure.get_probesetfreeze(probesetfreezeid)
+ normalized_probeset.append(probesetfreeze[0])
+ normalized_probeset.append(probesetfreeze[1])
+ normalized_probeset.append(probesetfreeze[2])
+ #
probesetid = probesetxref[0]
probeset = get_probeset(probesetid)
normalized_probeset.append(probeset[1])
@@ -71,13 +79,25 @@ def get_normalized_probeset(locus, inbredsetid):
normalized_probeset.append(probeset[4])
normalized_probeset.append(probeset[5])
normalized_probeset.append(probeset[6])
+ #
normalized_probeset.append(probesetxref[1])
normalized_probeset.append(probesetxref[2])
+ #
locus = probesetxref[3]
geno = genotypes.get_geno(inbredsetid=inbredsetid, name=locus)
normalized_probeset.append(geno[2])
normalized_probeset.append(geno[3])
+ #
normalized_probesets.append(normalized_probeset)
- print normalized_probesets[:2]
-get_normalized_probeset(locus="rs3663871", inbredsetid=1)
+locus="rs3663871"
+inbredsetid=1
+
+results = get_normalized_probeset(locus=locus, inbredsetid=inbredsetid)
+file = open('probesets_%s.txt' % (locus), 'w+')
+file.write("GN dataset ID\t\n")
+file.flush()
+for row in results:
+ file.write(row[0])
+ file.flush()
+file.close()