060ada2535fca719656219c1214a3e1c16490693
tdreszer
  Wed Nov 9 16:06:41 2011 -0800
Moved as code in hgTables down to lib and access it from hgc and hgTrackUi.  This is to remove 'extraFields' support as per Jim's request in redmine 5883 and 5582
diff --git src/hg/lib/pgSnp.c src/hg/lib/pgSnp.c
index 4b10959..f54fadf 100644
--- src/hg/lib/pgSnp.c
+++ src/hg/lib/pgSnp.c
@@ -607,45 +607,51 @@
 
     sr = sqlGetResult(conn, query);
     while ((row = sqlNextRow(sr)) != NULL)
         {
         if (first == 1)
              {
              printf("<br><b>Links to phenotype databases</b><br>\n");
              first = 0;
              }
         el = pgPhenoAssocLoad(row);
         printf("<a href=\"%s\">%s</a></br>\n", el->srcUrl, el->name);
         }
     }
 }
 
-char *pgSnpAutoSqlString =
+static char *pgSnpAutoSqlString =
 "table pgSnp"
 "\"personal genome SNP\""
 "   ("
 "   ushort  bin;            \"A field to speed indexing\""
 "   string  chrom;          \"Chromosome\""
 "   uint    chromStart;     \"Start position in chrom\""
 "   uint    chromEnd;       \"End position in chrom\""
 "   string  name;           \"alleles ACTG[/ACTG]\""
 "   int     alleleCount;    \"number of alleles\""
 "   string  alleleFreq;     \"comma separated list of frequency of each allele\""
 "   string  alleleScores;   \"comma separated list of quality scores\""
 "   )"
 ;
 
+struct asObject *pgSnpAsObj()
+// Return asObject describing fields of pgSnp
+{
+return asParseText(pgSnpAutoSqlString);
+}
+
 struct pgSnp *pgSnpLoadNoBin(char **row)
 /* load pgSnp struct from row without bin */
 {
 struct pgSnp *ret;
 
 AllocVar(ret);
 ret->bin = 0;
 ret->chrom = cloneString(row[0]);
 ret->chromStart = sqlUnsigned(row[1]);
 ret->chromEnd = sqlUnsigned(row[2]);
 ret->name = cloneString(row[3]);
 ret->alleleCount = sqlSigned(row[4]);
 ret->alleleFreq = cloneString(row[5]);
 ret->alleleScores = cloneString(row[6]);
 return ret;