src/hg/instinct/bioInt2/bioGeneLevel.c 1.2
1.2 2009/03/22 01:07:28 jsanborn
updated
Index: src/hg/instinct/bioInt2/bioGeneLevel.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/instinct/bioInt2/bioGeneLevel.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -b -B -U 1000000 -r1.1 -r1.2
--- src/hg/instinct/bioInt2/bioGeneLevel.c 20 Mar 2009 06:06:31 -0000 1.1
+++ src/hg/instinct/bioInt2/bioGeneLevel.c 22 Mar 2009 01:07:28 -0000 1.2
@@ -1,77 +1,44 @@
/* mapProbesToGenes - Will maps probes in BED format to overlapping gene(s). */
#include "common.h"
#include "linefile.h"
#include "hash.h"
#include "options.h"
#include "jksql.h"
#include "hPrint.h"
#include "hdb.h"
#include "dystring.h"
#include "bioIntDb.h"
#include "bioIntDriver.h"
#include "cprob.h"
#include "hgStatsLib.h"
#include "bioController.h"
struct analysisResult *metaGene(struct biAnalysis *ba, struct slPair *spList,
char *sample, char *gene)
{
struct slPair *sp;
struct slDouble *sd, *sdList = NULL;
for (sp = spList; sp; sp = sp->next)
{
struct slDouble *vals = sp->val;
if (!vals)
continue;
double val = slDoubleMedian(vals);
sd = slDoubleNew(val);
slAddHead(&sdList, sd);
}
float chi2, metaP;
if (!fishersMetaSigned(sdList, &chi2, &metaP))
return NULL;
slFreeList(&sdList);
struct analysisResult *ar;
AllocVar(ar);
ar->sample = cloneString(sample);
ar->feature = cloneString(gene);
ar->val = metaP;
ar->conf = chi2;
return ar;
}
-
-
-struct biAnalysis *registerGeneLevelAnalyses(char *db, struct slName *datasets)
-{
-struct biAnalysis *ba, *baList = NULL;
-
-struct slName *sl;
-struct dyString *dy = newDyString(10);
-for (sl = datasets; sl; sl = sl->next)
- {
- dyStringPrintf(dy, "%s", sl->name);
- if (sl->next)
- dyStringPrintf(dy, "_");
- }
-char *prefix = dyStringCannibalize(&dy);
-
-/* Set up Meta-Gene analysis */
-AllocVar(ba);
-ba->db = cloneString(db);
-char tableName[256];
-safef(tableName, sizeof(tableName), "%s_meta", prefix);
-
-ba->tableName = cloneString(tableName);
-ba->parameters = hashNew(0);
-ba->analyze = metaGene;
-
-slAddHead(&baList, ba);
-
-/* Setup future analysis here... */
-
-return baList;
-}
-