aboutsummaryrefslogtreecommitdiff
path: root/wqflask/maintenance/dataset/specials1.py
diff options
context:
space:
mode:
authorZachary Sloan2014-07-21 16:07:42 +0000
committerZachary Sloan2014-07-21 16:07:42 +0000
commitd952a23662eb4c46041be3945b5c3ccacf5506b6 (patch)
tree00750c5c88fb7dc6f300a148ea40f95a7b46be3a /wqflask/maintenance/dataset/specials1.py
parent818de422631392c246646b52a5b227d23153e667 (diff)
parentc424db452c243c6f0f64ee58d2d7baeb147dd3c8 (diff)
downloadgenenetwork2-d952a23662eb4c46041be3945b5c3ccacf5506b6.tar.gz
Merge /home/lei/gene
Diffstat (limited to 'wqflask/maintenance/dataset/specials1.py')
-rw-r--r--wqflask/maintenance/dataset/specials1.py53
1 files changed, 53 insertions, 0 deletions
diff --git a/wqflask/maintenance/dataset/specials1.py b/wqflask/maintenance/dataset/specials1.py
new file mode 100644
index 00000000..9159fd7f
--- /dev/null
+++ b/wqflask/maintenance/dataset/specials1.py
@@ -0,0 +1,53 @@
+import utilities
+import datastructure
+import genotypes
+import probesets
+import calculate
+
+"""
+For: Rob, GeneNetwork
+Date: 2014-02-04
+Function:
+ For BXD group, fetch probesets with given locus (mapping info).
+
+locus="rs3663871"
+"""
+def bxd_probesets_locus(locus, inbredsetid):
+ #
+ 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 = probesets.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()
+
+locus='rs3663871'
+inbredsetid=1
+bxd_probesets_locus(locus=locus, inbredsetid=inbredsetid)