src/hg/instinct/bioInt2/populateDb.c 1.13

1.13 2010/05/16 00:01:47 sbenz
Removed sexCorrect and skipped X/Y on CNV only
Index: src/hg/instinct/bioInt2/populateDb.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/instinct/bioInt2/populateDb.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -b -B -U 4 -r1.12 -r1.13
--- src/hg/instinct/bioInt2/populateDb.c	18 Dec 2009 21:42:22 -0000	1.12
+++ src/hg/instinct/bioInt2/populateDb.c	16 May 2010 00:01:47 -0000	1.13
@@ -1020,19 +1020,27 @@
 
 if (!inputProbeVals)
     return;
 
-float *correctionX, *correctionY;
-boolean doX = calcSexCorrection(hgConn, dataTable, "chrX", &correctionX);
-boolean doY = calcSexCorrection(hgConn, dataTable, "chrY", &correctionY);
+//float *correctionX, *correctionY;
+//boolean doX = calcSexCorrection(hgConn, dataTable, "chrX", &correctionX);
+//boolean doY = calcSexCorrection(hgConn, dataTable, "chrY", &correctionY);
  
 struct hash *settings = getSettings(dataTable);
 struct hashEl *el = hashLookup(settings, "aliasTable");
 if (!el)
     errAbort("No aliasTable.\n");
 char *aliasTable = cloneString(el->val);
 struct hash *gaHash = getAliases(hgConn, aliasTable);
 
+struct hashEl *platEl = hashLookup(settings, "platform");
+boolean isCNV = FALSE;
+if (platEl && sameString(platEl->val,"CNV"))
+{
+   fprintf(stderr, "\tCNV detecting, skipping sex chroms...\n");
+   isCNV = TRUE;
+}
+
 char query[256];
 safef(query, sizeof(query), "select * from %s;", dataTable);
 
 /* Get bed15 data from hg18 database */
@@ -1044,18 +1052,18 @@
 while ((row = sqlNextRow(sr)) != NULL)
     {
     struct bed *nb = bedLoadN(row+1, 15);
   
-    if (sameString(nb->chrom, "chrX") || sameString(nb->chrom, "chrY"))
-	{ // skip sex chroms
+    if (isCNV && (sameString(nb->chrom, "chrX") || sameString(nb->chrom, "chrY")))
+	{ // skip sex chroms (in CNV only)
 	bedFree(&nb);
 	continue;
 	}
 
-    if (sameString(nb->chrom, "chrX") && doX)
+    /*if (sameString(nb->chrom, "chrX") && doX)
 	sexCorrect(nb, correctionX);
     else if (sameString(nb->chrom, "chrY") && doY)
-	sexCorrect(nb, correctionY);
+	sexCorrect(nb, correctionY);*/
 
     struct hashEl *el = hashLookup(gaHash, nb->name);
     if (el)
 	{