about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDannyArends2017-02-16 19:01:05 +0100
committerDannyArends2017-02-16 19:01:05 +0100
commit08837f2688602fb1bae231d3794eac3d87184e86 (patch)
treeed1e34fc0741c5f31b029fd93946538f996e3448
parent5da1eab7ccbc1f6913032cf510ca93e4ecfce5b1 (diff)
downloadgenenetwork2-08837f2688602fb1bae231d3794eac3d87184e86.tar.gz
Phewas output table code in python
-rw-r--r--wqflask/wqflask/auwerx/phewas_analysis.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/wqflask/wqflask/auwerx/phewas_analysis.py b/wqflask/wqflask/auwerx/phewas_analysis.py
index db12ad98..a745b12d 100644
--- a/wqflask/wqflask/auwerx/phewas_analysis.py
+++ b/wqflask/wqflask/auwerx/phewas_analysis.py
@@ -59,14 +59,11 @@ class PheWAS(object):
         rnames = r_seq(1, len(parser.markers))
         # Create the snp aligner object out of the BXD genotypes
         snpaligner = ro.r.matrix(snpinfo, nrow=len(parser.markers), dimnames = r_list(rnames, r_c("SNP", "Chr", "Pos")), ncol = 3, byrow=True)
-        r_write_table(snpaligner, "~/snpaligner_GN2.txt", row_names=False)
+        #r_write_table(snpaligner, "~/snpaligner_GN2.txt", row_names=False)
 
         # Create the phenotype aligner object using R
         phenoaligner = self.r_create_Pheno_aligner()
 
-        #r_load(precompfilelocation)                 # Load the pre-computed EMMA results into R
-        #allpvalues = ro.r['pval_small']               # Get a pointer to the pre-computed results
-
         self.results = {}
         self.results['imgurl1'] = webqtlUtil.genRandStr("phewas_") + ".png"
         self.results['imgloc1'] = GENERATED_IMAGE_DIR + self.results['imgurl1']
@@ -74,7 +71,11 @@ class PheWAS(object):
         print("IMAGE AT:", self.results['imgloc1'] )
         # Create the PheWAS plot (The gene/probe name, chromosome and gene/probe positions should come from the user input)
         # TODO: generate the PDF in the temp folder, with a unique name
-        self.r_PheWASManhattan("Test", precompfilelocation, phenoaligner, snpaligner, "None", 1, 25, 25, self.results['imgloc1'] )
+        phewasres = self.r_PheWASManhattan("Test", precompfilelocation, phenoaligner, snpaligner, "None", 1, 25, 25, self.results['imgloc1'] )
+        self.results['phewas1'] = phewasres[0]
+        self.results['phewas2'] = phewasres[1]
+        self.results['phewas3'] = phewasres[2]
+
         #self.r_PheWASManhattan(allpvalues)
         #self.r_Stop()