about summary refs log tree commit diff
path: root/wqflask
diff options
context:
space:
mode:
Diffstat (limited to 'wqflask')
-rwxr-xr-xwqflask/base/data_set.py2
-rwxr-xr-xwqflask/wqflask/do_search.py17
-rwxr-xr-xwqflask/wqflask/my_pylmm/data/genofile_parser.py31
-rwxr-xr-xwqflask/wqflask/templates/index_page.html4
4 files changed, 27 insertions, 27 deletions
diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py
index 414cc71a..a572a607 100755
--- a/wqflask/base/data_set.py
+++ b/wqflask/base/data_set.py
@@ -163,8 +163,6 @@ class Markers(object):
         for marker in markers:
             if (marker['chr'] != "X") and (marker['chr'] != "Y"):
                 marker['chr'] = int(marker['chr'])
-            #else:
-            #    marker['chr'] = 20
             print("Mb:", marker['Mb'])
             marker['Mb'] = float(marker['Mb'])
             
diff --git a/wqflask/wqflask/do_search.py b/wqflask/wqflask/do_search.py
index 02e73bb0..617d7942 100755
--- a/wqflask/wqflask/do_search.py
+++ b/wqflask/wqflask/do_search.py
@@ -499,7 +499,14 @@ class GoSearch(MrnaAssaySearch):
 
     DoSearch.search_types['ProbeSet_GO'] =  "GoSearch"
 
-    def run(self):
+    def get_from_clause(self):
+        from_clause = """, db_GeneOntology.term as GOterm,
+            db_GeneOntology.association as GOassociation,
+            db_GeneOntology.gene_product as GOgene_product """
+
+        return from_clause
+
+    def get_where_clause(self):
         field = 'GOterm.acc'
         go_id = 'GO:' + ('0000000'+self.search_term[0])[-7:]
 
@@ -510,9 +517,11 @@ class GoSearch(MrnaAssaySearch):
 
         where_clause = " %s = '%s' and %s " % (field, go_id, statements)
 
-        from_clause = """ , db_GeneOntology.term as GOterm,
-            db_GeneOntology.association as GOassociation,
-            db_GeneOntology.gene_product as GOgene_product """
+        return where_clause
+
+    def run(self):
+        from_clause = self.get_from_clause()
+        where_clause = self.get_where_clause()
 
         query = self.compile_final_query(from_clause, where_clause)
 
diff --git a/wqflask/wqflask/my_pylmm/data/genofile_parser.py b/wqflask/wqflask/my_pylmm/data/genofile_parser.py
index 1f4760a9..9191f345 100755
--- a/wqflask/wqflask/my_pylmm/data/genofile_parser.py
+++ b/wqflask/wqflask/my_pylmm/data/genofile_parser.py
@@ -78,26 +78,19 @@ class ConvertGenoFile(object):
             #    self.process_snps_file()
 
 
-    #def process_row(self, row):
-    #    counter = 0
-    #    for char in row:
-    #        if char 
-    #        counter += 1
-
-
     def process_csv(self):
         for row_count, row in enumerate(self.process_rows()):
-            #self.latest_row_pos = row_count
-
-            row_items = row.split()
+            row_items = row.split("\t")
 
             this_marker = Marker()
             this_marker.name = row_items[1]
             this_marker.chr = row_items[0]
-            #this_marker.cM = row_items[2]
             if self.cm_exists and self.mb_exists:
-                #print("cm and mb exists")
-                this_marker.Mb = row_items[2]
+                this_marker.cM = row_items[2]
+                this_marker.Mb = row_items[3]
+                genotypes = row_items[4:]
+            elif self.cm_exists:
+                this_marker.cM = row_items[2]
                 genotypes = row_items[3:]
             elif self.mb_exists:
                 this_marker.Mb = row_items[2]
@@ -190,13 +183,13 @@ class ConvertGenoFile(object):
 
 
 if __name__=="__main__":
-    Old_Geno_Directory = """/home/zas1024/gene/web/genotypes/"""
-    New_Geno_Directory = """/home/zas1024/gene/web/new_genotypes/"""
-    #Input_File = """/home/zas1024/gene/web/genotypes/BXD.geno"""
+    Old_Geno_Directory = """/home/zas1024/gene/genotype_files/genotypes/"""
+    New_Geno_Directory = """/home/zas1024/gene/genotype_files/new_genotypes/"""
+    #Input_File = """/home/zas1024/gene/genotype_files/genotypes/BXD.geno"""
     #Output_File = """/home/zas1024/gene/wqflask/wqflask/pylmm/data/bxd.snps"""
-    convertob = ConvertGenoFile("/home/zas1024/gene/web/genotypes/HSNIH.geno", "/home/zas1024/gene/web/new_genotypes/HSNIH.json")
-    convertob.convert()
-    #ConvertGenoFile.process_all(Old_Geno_Directory, New_Geno_Directory)
+    #convertob = ConvertGenoFile("/home/zas1024/gene/genotype_files/genotypes/SRxSHRSPF2.geno", "/home/zas1024/gene/genotype_files/new_genotypes/SRxSHRSPF2.json")
+    #convertob.convert()
+    ConvertGenoFile.process_all(Old_Geno_Directory, New_Geno_Directory)
     #ConvertGenoFiles(Geno_Directory)
     
     #process_csv(Input_File, Output_File)
\ No newline at end of file
diff --git a/wqflask/wqflask/templates/index_page.html b/wqflask/wqflask/templates/index_page.html
index 3d5ddde4..49067e37 100755
--- a/wqflask/wqflask/templates/index_page.html
+++ b/wqflask/wqflask/templates/index_page.html
@@ -147,14 +147,14 @@
                         GeneWiki</a> for genes that you or other users have annotated
                         with the word <i>nicotine</i>.</li>
 
-                        <!--<li><b>GO:0045202</b> searches for synapse-associated genes listed in the
+                        <li><b>GO:0045202</b> searches for synapse-associated genes listed in the
                         <a href="http://www.godatabase.org/cgi-bin/amigo/go.cgi" target="_blank">
                             Gene Ontology</a>.</li>
 
                         <li><b>GO:0045202 LRS=(9 99 Chr4 122 155) cisLRS=(9 999 10)</b>
                         finds synapse-associated genes with <a href="http://www.genenetwork.org/glossary.html#E" target="_blank">
                         cis eQTL</a> on Chr 4 from 122 and 155 Mb with LRS scores
-                        between 9 and 999.</li>-->
+                        between 9 and 999.</li>
 
                         <li><b>RIF=diabetes LRS=(9 999 Chr2 100 105) transLRS=(9 999 10)</b>
                         finds diabetes-associated transcripts with peak <a href="http://www.genenetwork.org/glossary.html#E" target="_blank">