diff options
Diffstat (limited to 'wqflask/maintenance')
-rw-r--r-- | wqflask/maintenance/dataset/genotypes.py | 11 | ||||
-rw-r--r-- | wqflask/maintenance/dataset/specials.py | 10 |
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") |