diff options
author | Lei Yan | 2014-02-05 13:14:22 -0600 |
---|---|---|
committer | Lei Yan | 2014-02-05 13:14:22 -0600 |
commit | f560cd7837d311525741ba540623a9fa97342b95 (patch) | |
tree | a29148e7902fba683a5d0e960d8f40da21cf5bb4 /wqflask/maintenance/dataset/specials.py | |
parent | 198fccc16d3491e331a879137a1eeb63501b65a2 (diff) | |
download | genenetwork2-f560cd7837d311525741ba540623a9fa97342b95.tar.gz |
On branch master
Diffstat (limited to 'wqflask/maintenance/dataset/specials.py')
-rw-r--r-- | wqflask/maintenance/dataset/specials.py | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/wqflask/maintenance/dataset/specials.py b/wqflask/maintenance/dataset/specials.py index e69de29b..9caba879 100644 --- a/wqflask/maintenance/dataset/specials.py +++ b/wqflask/maintenance/dataset/specials.py @@ -0,0 +1,56 @@ +import datastructure +import genotypes +import probesets + +""" +For: Ash +Date: 2014-02-05 +Function: + For BXD group, calculate correlations with genotypes and probesets. +Running History: + 2014-02-05 /home/leiyan/gn2/wqflask/maintenance/dataset/datadir/20140205_Ash_correlations/output +""" +def bxd_correlations(): + # + inbredsetid = 1 + genofile = "/home/leiyan/gn/web/genotypes/BXD.geno" + outputdir = "/home/leiyan/gn2/wqflask/maintenance/dataset/datadir/20140205_Ash_correlations/output" + # + t = genotypes.load_genos(genofile) + genostrains = t[0] + genos = t[1] + # + probesetfreezes = datastructure.get_probesetfreezes(inbredsetid) + print "Get %d probesetfreezes" % (len(probesetfreezes)) + # + for probesetfreeze in probesetfreezes: + # + print probesetfreeze + probesetfreezeid = probesetfreeze[0] + probesetfreezename = probesetfreeze[1] + probesetfreezefullname = probesetfreeze[2] + # + outputfile = open("%s/%d_%s.txt" % (outputdir, probesetfreezeid, probesetfreezename), "w+") + outputfile.write("%s\t" % "ProbeSet Id") + outputfile.write("%s\t" % "ProbeSet Name") + outputfile.write("%s\t" % "Geno Name") + outputfile.write("%s\t" % "Overlap Number") + outputfile.write("%s\t" % "Pearson r") + outputfile.write("%s\t" % "Pearson p") + outputfile.write("%s\t" % "Spearman r") + outputfile.write("%s\t" % "Spearman p") + outputfile.write("\n") + outputfile.flush() + # + probesetxrefs = probesets.get_probesetxref(probesetfreezeid) + print "Get %d probesetxrefs" % (len(probesetxrefs)) + # + for probesetxref in probesetxrefs: + probesetid = probesetxref[0] + probesetdataid = probesetxref[1] + probeset = probesets.get_probeset(probesetid) + probesetdata = probesets.get_probesetdata(probesetdataid) + # + outputfile.close() + +bxd_correlations() |