aboutsummaryrefslogtreecommitdiff
path: root/wqflask/maintenance/dataset
diff options
context:
space:
mode:
authorLei Yan2014-02-05 16:06:55 -0600
committerLei Yan2014-02-05 16:06:55 -0600
commitee026ab745359197e966bdcaaa33f06c8e7256e0 (patch)
tree6580a5b5875e35fe576d5cb615ad604cda2b27cc /wqflask/maintenance/dataset
parent2bc4ef27ad896e3acb7049035fcf30f00f9e84e0 (diff)
downloadgenenetwork2-ee026ab745359197e966bdcaaa33f06c8e7256e0.tar.gz
On branch master
Diffstat (limited to 'wqflask/maintenance/dataset')
-rw-r--r--wqflask/maintenance/dataset/genotypes.py11
-rw-r--r--wqflask/maintenance/dataset/specials.py10
2 files changed, 17 insertions, 4 deletions
diff --git a/wqflask/maintenance/dataset/genotypes.py b/wqflask/maintenance/dataset/genotypes.py
index 88d28cf6..b57d4651 100644
--- a/wqflask/maintenance/dataset/genotypes.py
+++ b/wqflask/maintenance/dataset/genotypes.py
@@ -32,8 +32,17 @@ def load_genos(file):
genotype['cm'] = cells[2]
genotype['mb'] = cells[3]
values = cells[4:]
+ values = [to_number(value) for value in values]
genotype['values'] = values
genotype['dicvalues'] = utilities.to_dic(strains, values)
genotypes.append(genotype)
return strains, genotypes
- \ No newline at end of file
+
+def to_number(char):
+ dic = {
+ 'b': -1,
+ 'd': 1,
+ 'h': 0,
+ 'u': None,
+ }
+ return dic.get(char.lower(), None)
diff --git a/wqflask/maintenance/dataset/specials.py b/wqflask/maintenance/dataset/specials.py
index ba9598fe..0273d24d 100644
--- a/wqflask/maintenance/dataset/specials.py
+++ b/wqflask/maintenance/dataset/specials.py
@@ -101,11 +101,8 @@ def bxd_correlations():
probeset = probesets.get_probeset(probesetid)
probesetname = probeset[1]
probesetdata = probesets.get_probesetdata(probesetdataid)
- print probesetdata
probesetdata = zip(*probesetdata)
probesetdata = utilities.to_dic([strain.lower() for strain in probesetdata[1]], probesetdata[2])
- print probesetdata
- return
#
for geno in genos:
genoname = geno['locus']
@@ -113,7 +110,14 @@ def bxd_correlations():
outputfile.write("%s\t" % probesetname)
outputfile.write("%s\t" % genoname)
#
+ dic1 = geno['dicvalues']
+ dic2 = probesetdata
+ keys, values1, values2 = utilities.overlap(dic1, dic2)
+ print keys
+ print values1
+ print values2
+ return
#
outputfile.write("%s\t" % "Overlap Number")
outputfile.write("%s\t" % "Pearson r")