7e514a3e21033e87921d8c98bb4ac2e79caed9d1
tdreszer
  Thu May 9 12:50:15 2013 -0700
Initial check in of new hgGene section: Gene Alleles.  The ra file is not being checked in yet.
diff --git src/hg/hgGene/hgGene.c src/hg/hgGene/hgGene.c
index 0513328..eaee604 100644
--- src/hg/hgGene/hgGene.c
+++ src/hg/hgGene/hgGene.c
@@ -360,30 +360,43 @@
 {
 //printf("<br>adding %s section \n", section->name);fflush(stdout); 
 if (section != NULL && hashLookup(section->settings, "hide") == NULL
    && section->exists(section, conn, curGeneId))
      slAddHead(pList, section);
 }
 
 struct section *loadSectionList(struct sqlConnection *conn)
 /* Load up section list - first load up sections.ra, and then
  * call each section loader. */
 {
 struct hash *sectionRa = NULL;
 struct section *sectionList = NULL;
 
 readRa("section.ra", &sectionRa);
+
+// Could be an ajax request for a single section!
+char *ajaxSection = cartOptionalString(cart, hggAjaxSection);
+if (ajaxSection != NULL)
+    {
+    // Currently only one section supports ajax update.
+    if (sameString(ajaxSection,HGG_GENE_ALLELES))
+        {
+        addGoodSection(allelesSection(conn, sectionRa), conn, &sectionList);
+        return sectionList;
+        }
+    }
+
 addGoodSection(linksSection(conn, sectionRa), conn, &sectionList);
 /* disable ortherOrg section for CGB servers for the time being */
 if (!hIsCgbServer()) addGoodSection(otherOrgsSection(conn, sectionRa), conn, &sectionList);
 addGoodSection(gadSection(conn, sectionRa), conn, &sectionList);
     addGoodSection(ctdSection(conn, sectionRa), conn, &sectionList);
 /*if (isRgdGene(conn))
     {
     addGoodSection(ctdRgdGene2Section(conn, sectionRa), conn, &sectionList);
     }
 else
     {
     addGoodSection(ctdSection(conn, sectionRa), conn, &sectionList);
     }
 */
 addGoodSection(rgdGeneRawSection(conn, sectionRa), conn, &sectionList);
@@ -401,30 +414,31 @@
 addGoodSection(swissProtCommentsSection(conn, sectionRa), conn, &sectionList);
 addGoodSection(flyBaseRolesSection(conn, sectionRa), conn, &sectionList);
 addGoodSection(flyBasePhenotypesSection(conn, sectionRa), conn, &sectionList);
 addGoodSection(flyBaseSynonymsSection(conn, sectionRa), conn, &sectionList);
 addGoodSection(bdgpExprInSituSection(conn, sectionRa), conn, &sectionList);
 addGoodSection(goSection(conn, sectionRa), conn, &sectionList);
 addGoodSection(infoSection(conn, sectionRa), conn, &sectionList);
 addGoodSection(methodSection(conn, sectionRa), conn, &sectionList);
 addGoodSection(localizationSection(conn, sectionRa), conn, &sectionList);
 addGoodSection(transRegCodeMotifSection(conn, sectionRa), conn, &sectionList);
 addGoodSection(pathwaysSection(conn, sectionRa), conn, &sectionList);
 addGoodSection(mrnaDescriptionsSection(conn, sectionRa), conn, &sectionList);
 //addGoodSection(pseudoGeneSection(conn, sectionRa), conn, &sectionList);
 addGoodSection(synonymSection(conn, sectionRa), conn, &sectionList);
 addGoodSection(geneReviewsSection(conn, sectionRa), conn, &sectionList);
+addGoodSection(allelesSection(conn, sectionRa), conn, &sectionList);
 
 // addGoodSection(xyzSection(conn, sectionRa), conn, &sectionList);
 
 slSort(&sectionList, sectionCmpPriority);
 return sectionList;
 }
 
 
 void printIndex(struct section *sectionList)
 /* Print index to section. */
 {
 int maxPerRow = 6, itemPos = 0;
 int rowIx = 0;
 struct section *section;
 
@@ -666,30 +680,30 @@
 	cartWebStart(cart, database, "%s Gene %s (%s) Description and Page Index",
 	    genome, curGeneName, curGeneId);
 	webMain(conn);
 	cartWebEnd();
 	}
     hFreeConn(&spConn);
     hFreeConn(&conn);
     }
 /* load the cart with the position info we got from the gene name */
 char buffer[1024];
 safef(buffer, sizeof buffer,  "%s:%d-%d", curGeneChrom, curGeneStart+1, curGeneEnd);
 cartSetString(cart, "position", cloneString(buffer));
 cartRemovePrefix(cart, hggDoPrefix);
 }
 
-char *excludeVars[] = {"Submit", "submit", NULL};
+char *excludeVars[] = {"Submit", "submit", "ajax", hggAjaxSection, NULL};
 
 int main(int argc, char *argv[])
 /* Process command line. */
 {
 long enteredMainTime = clock1000();
 cgiSpoof(&argc, argv);
 htmlSetStyle(htmlStyleUndecoratedLink);
 if (argc != 1)
     usage();
 oldVars = hashNew(10);
 cartEmptyShell(cartMain, hUserCookie(), excludeVars, oldVars);
 cgiExitTime("hgGene", enteredMainTime);
 return 0;
 }