Index: src/hg/lib/makeItemsItem.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/lib/makeItemsItem.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -b -B -U 4 -r1.2 -r1.3
--- src/hg/lib/makeItemsItem.c	9 Apr 2010 17:45:57 -0000	1.2
+++ src/hg/lib/makeItemsItem.c	10 Apr 2010 01:13:58 -0000	1.3
@@ -19,12 +19,14 @@
 ret->chrom = row[1];
 ret->chromStart = sqlUnsigned(row[2]);
 ret->chromEnd = sqlUnsigned(row[3]);
 ret->name = row[4];
-safecpy(ret->strand, sizeof(ret->strand), row[5]);
-ret->score = sqlUnsigned(row[6]);
-ret->color = row[7];
-ret->description = row[8];
+ret->score = sqlUnsigned(row[5]);
+safecpy(ret->strand, sizeof(ret->strand), row[6]);
+ret->thickStart = sqlUnsigned(row[7]);
+ret->thickEnd = sqlUnsigned(row[8]);
+ret->itemRgb = sqlUnsigned(row[9]);
+ret->description = row[10];
 }
 
 struct makeItemsItem *makeItemsItemLoadByQuery(struct sqlConnection *conn, char *query)
 /* Load all makeItemsItem from table that satisfy the query given.  
@@ -57,10 +59,10 @@
  * For example "autosql's features include" --> "autosql\'s features include" 
  * If worried about this use makeItemsItemSaveToDbEscaped() */
 {
 struct dyString *update = newDyString(updateSize);
-dyStringPrintf(update, "insert into %s values ( %u,'%s',%u,%u,'%s','%s',%u,'%s',%s)", 
-	tableName,  el->bin,  el->chrom,  el->chromStart,  el->chromEnd,  el->name,  el->strand,  el->score,  el->color,  el->description);
+dyStringPrintf(update, "insert into %s values ( %u,'%s',%u,%u,'%s',%u,'%s',%u,%u,%u,%s)", 
+	tableName,  el->bin,  el->chrom,  el->chromStart,  el->chromEnd,  el->name,  el->score,  el->strand,  el->thickStart,  el->thickEnd,  el->itemRgb,  el->description);
 sqlUpdate(conn, update->string);
 freeDyString(&update);
 }
 
@@ -73,23 +75,21 @@
  * "autosql's features include" --> "autosql\'s features include" 
  * before inserting into database. */ 
 {
 struct dyString *update = newDyString(updateSize);
-char  *chrom, *name, *strand, *color, *description;
+char  *chrom, *name, *strand, *description;
 chrom = sqlEscapeString(el->chrom);
 name = sqlEscapeString(el->name);
 strand = sqlEscapeString(el->strand);
-color = sqlEscapeString(el->color);
 description = sqlEscapeString(el->description);
 
-dyStringPrintf(update, "insert into %s values ( %u,'%s',%u,%u,'%s','%s',%u,'%s','%s')", 
-	tableName,  el->bin,  chrom,  el->chromStart,  el->chromEnd,  name,  strand,  el->score,  color,  description);
+dyStringPrintf(update, "insert into %s values ( %u,'%s',%u,%u,'%s',%u,'%s',%u,%u,%u,'%s')", 
+	tableName,  el->bin,  chrom,  el->chromStart,  el->chromEnd,  name,  el->score,  strand,  el->thickStart,  el->thickEnd,  el->itemRgb,  description);
 sqlUpdate(conn, update->string);
 freeDyString(&update);
 freez(&chrom);
 freez(&name);
 freez(&strand);
-freez(&color);
 freez(&description);
 }
 
 struct makeItemsItem *makeItemsItemLoad(char **row)
@@ -103,12 +103,14 @@
 ret->chrom = cloneString(row[1]);
 ret->chromStart = sqlUnsigned(row[2]);
 ret->chromEnd = sqlUnsigned(row[3]);
 ret->name = cloneString(row[4]);
-safecpy(ret->strand, sizeof(ret->strand), row[5]);
-ret->score = sqlUnsigned(row[6]);
-ret->color = cloneString(row[7]);
-ret->description = cloneString(row[8]);
+ret->score = sqlUnsigned(row[5]);
+safecpy(ret->strand, sizeof(ret->strand), row[6]);
+ret->thickStart = sqlUnsigned(row[7]);
+ret->thickEnd = sqlUnsigned(row[8]);
+ret->itemRgb = sqlUnsigned(row[9]);
+ret->description = cloneString(row[10]);
 return ret;
 }
 
 struct makeItemsItem *makeItemsItemLoadAll(char *fileName) 
@@ -116,9 +118,9 @@
  * Dispose of this with makeItemsItemFreeList(). */
 {
 struct makeItemsItem *list = NULL, *el;
 struct lineFile *lf = lineFileOpen(fileName, TRUE);
-char *row[9];
+char *row[11];
 
 while (lineFileRow(lf, row))
     {
     el = makeItemsItemLoad(row);
@@ -134,9 +136,9 @@
  * Dispose of this with makeItemsItemFreeList(). */
 {
 struct makeItemsItem *list = NULL, *el;
 struct lineFile *lf = lineFileOpen(fileName, TRUE);
-char *row[9];
+char *row[11];
 
 while (lineFileNextCharRow(lf, chopper, row, ArraySize(row)))
     {
     el = makeItemsItemLoad(row);
@@ -160,11 +162,13 @@
 ret->chrom = sqlStringComma(&s);
 ret->chromStart = sqlUnsignedComma(&s);
 ret->chromEnd = sqlUnsignedComma(&s);
 ret->name = sqlStringComma(&s);
-sqlFixedStringComma(&s, ret->strand, sizeof(ret->strand));
 ret->score = sqlUnsignedComma(&s);
-ret->color = sqlStringComma(&s);
+sqlFixedStringComma(&s, ret->strand, sizeof(ret->strand));
+ret->thickStart = sqlUnsignedComma(&s);
+ret->thickEnd = sqlUnsignedComma(&s);
+ret->itemRgb = sqlUnsignedComma(&s);
 ret->description = sqlStringComma(&s);
 *pS = s;
 return ret;
 }
@@ -177,9 +181,8 @@
 
 if ((el = *pEl) == NULL) return;
 freeMem(el->chrom);
 freeMem(el->name);
-freeMem(el->color);
 freeMem(el->description);
 freez(pEl);
 }
 
@@ -212,17 +215,19 @@
 if (sep == ',') fputc('"',f);
 fprintf(f, "%s", el->name);
 if (sep == ',') fputc('"',f);
 fputc(sep,f);
+fprintf(f, "%u", el->score);
+fputc(sep,f);
 if (sep == ',') fputc('"',f);
 fprintf(f, "%s", el->strand);
 if (sep == ',') fputc('"',f);
 fputc(sep,f);
-fprintf(f, "%u", el->score);
+fprintf(f, "%u", el->thickStart);
 fputc(sep,f);
-if (sep == ',') fputc('"',f);
-fprintf(f, "%s", el->color);
-if (sep == ',') fputc('"',f);
+fprintf(f, "%u", el->thickEnd);
+fputc(sep,f);
+fprintf(f, "%u", el->itemRgb);
 fputc(sep,f);
 if (sep == ',') fputc('"',f);
 fprintf(f, "%s", el->description);
 if (sep == ',') fputc('"',f);

