src/hg/instinct/bioInt2/bioGeneLevel.c 1.4

1.4 2009/04/04 00:39:22 jsanborn
added cohorts api
Index: src/hg/instinct/bioInt2/bioGeneLevel.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/instinct/bioInt2/bioGeneLevel.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -b -B -U 4 -r1.3 -r1.4
--- src/hg/instinct/bioInt2/bioGeneLevel.c	23 Mar 2009 18:19:29 -0000	1.3
+++ src/hg/instinct/bioInt2/bioGeneLevel.c	4 Apr 2009 00:39:22 -0000	1.4
@@ -127,13 +127,14 @@
 
 return spList;
 }   
 
-struct analysisResult *geneLevelAnalysis(struct biAnalysis *ba, struct biResults *br,
+void geneLevelAnalysis(struct sqlConnection *biConn, 
+		       struct biAnalysis *ba, struct biResults *br,
 					 struct slName *genes)
 {
 if (!ba->analyze)
-    return NULL;
+    return;
 
 fprintf(stdout, "starting gene level analysis\n");
 
 struct slName *gene, *sample, *samples = br->allSamplesInCommon(br);
@@ -152,16 +153,20 @@
 	if (!ar)
 	    continue;
 	slAddHead(&arList, ar);
 	}
+    slReverse(&arList);
+
+    storeAnalysisResultsInDb(biConn, ba, arList);
+    analysisResultFreeList(&arList);
+    arList = NULL;
+
     fprintf(stdout, ".");
     fflush(stdout);
+
     biDataFree(&bdList);
     }
-slReverse(&arList);
 fprintf(stdout, "\n");
-
-return arList;
 }    
 
 struct biResults *retrieveRawData(char *db, struct slName *datasets, boolean toLogP)
 {
@@ -194,14 +199,14 @@
     return;
 
 struct slName *genes = getAvailableGenes(ba->db, br);
 
-struct analysisResult *arList = geneLevelAnalysis(ba, br, genes);
-
 struct sqlConnection *biConn = hAllocConnProfile("localDb", ba->db);
-storeAnalysisResultsInDb(biConn, ba, arList);
+geneLevelAnalysis(biConn, ba, br, genes);
+
+//storeAnalysisResultsInDb(biConn, ba, arList);
 hFreeConn(&biConn);
 
-analysisResultFreeList(&arList);
+//analysisResultFreeList(&arList);
 biResultsFree(&br);
 slNameFreeList(&genes);
 }