aboutsummaryrefslogtreecommitdiff
path: root/wqflask/maintenance/dataset/specials.py
diff options
context:
space:
mode:
authorLei Yan2014-02-05 13:43:34 -0600
committerLei Yan2014-02-05 13:43:34 -0600
commit94b5018690f73cfad133d2d4c81ca0e8d4a7a7d4 (patch)
tree5b9e07d648e891486f065140f9d9f58bba143054 /wqflask/maintenance/dataset/specials.py
parentc30c4ed7afaf6e312476506a63db74541d019260 (diff)
downloadgenenetwork2-94b5018690f73cfad133d2d4c81ca0e8d4a7a7d4.tar.gz
On branch master
Diffstat (limited to 'wqflask/maintenance/dataset/specials.py')
-rw-r--r--wqflask/maintenance/dataset/specials.py56
1 files changed, 50 insertions, 6 deletions
diff --git a/wqflask/maintenance/dataset/specials.py b/wqflask/maintenance/dataset/specials.py
index 52a2389f..90ab1c5f 100644
--- a/wqflask/maintenance/dataset/specials.py
+++ b/wqflask/maintenance/dataset/specials.py
@@ -3,6 +3,52 @@ import genotypes
import probesets
"""
+For: Rob, GeneNetwork
+Date: 2014-02-04
+Function:
+ For BXD group, fetch probesets with given locus.
+
+locus="rs3663871"
+"""
+def bxd_probesets_locus(locus):
+ #
+ inbredsetid=1
+ #
+ file = open('probesets_%s.txt' % (locus), 'w+')
+ file.write("GN Dataset ID\t")
+ file.write("Dataset Full Name\t")
+ file.write("ProbeSet Name\t")
+ file.write("Symbol\t")
+ file.write("ProbeSet Description\t")
+ file.write("Probe Target Description\t")
+ file.write("ProbeSet Chr\t")
+ file.write("ProbeSet Mb\t")
+ file.write("Mean\t")
+ file.write("LRS\t")
+ file.write("Geno Chr\t")
+ file.write("Geno Mb\t")
+ file.write("\n")
+ file.flush()
+ #
+ results = get_normalized_probeset(locus=locus, inbredsetid=inbredsetid)
+ for row in results:
+ file.write("%s\t" % (row[0]))
+ file.write("%s\t" % (utilities.clearspaces(row[2], default='')))
+ file.write("%s\t" % (utilities.clearspaces(row[3], default='')))
+ file.write("%s\t" % (utilities.clearspaces(row[4], default='')))
+ file.write("%s\t" % (utilities.clearspaces(row[5], default='')))
+ file.write("%s\t" % (utilities.clearspaces(row[6], default='')))
+ file.write("%s\t" % (utilities.clearspaces(row[7], default='')))
+ file.write("%s\t" % (row[8]))
+ file.write("%s\t" % (row[9]))
+ file.write("%s\t" % (row[10]))
+ file.write("%s\t" % (utilities.clearspaces(row[11], default='')))
+ file.write("%s\t" % (row[12]))
+ file.write('\n')
+ file.flush()
+ file.close()
+
+"""
For: Ash
Date: 2014-02-05
Function:
@@ -50,16 +96,14 @@ def bxd_correlations():
probesetid = probesetxref[0]
probesetdataid = probesetxref[1]
probeset = probesets.get_probeset(probesetid)
- ProbeSetId = probeset[0]
- ProbeSetName = probeset[1]
- # Geno Name Overlap Number Pearson r Pearson p Spearman r Spearman p
+ probesetname = probeset[1]
probesetdata = probesets.get_probesetdata(probesetdataid)
#
for geno in genos:
genoname = geno['locus']
- outputfile.write("%s\t" % probeSetid)
- outputfile.write("%s\t" % ProbeSetName)
- outputfile.write("%s\t" % GenoName)
+ outputfile.write("%s\t" % probesetid)
+ outputfile.write("%s\t" % probesetname)
+ outputfile.write("%s\t" % genoname)
outputfile.write("%s\t" % "Overlap Number")
outputfile.write("%s\t" % "Pearson r")
outputfile.write("%s\t" % "Pearson p")