3ef4fc617ec6b1208e5d9c6608a755facb642e5e
angie
  Fri Dec 11 10:50:36 2015 -0800
Add 'add track hub' button next to 'add pgSnp or VCF custom track' button as
suggested by Matt.  Update dbNSFP v3 reference per Matt.  Thanks!
refs #16503, #16504

diff --git src/hg/hgVai/hgVai.c src/hg/hgVai/hgVai.c
index 2440836..115cb9f 100644
--- src/hg/hgVai/hgVai.c
+++ src/hg/hgVai/hgVai.c
@@ -180,31 +180,31 @@
 return dyStringCannibalize(&dy);
 }
 
 void printCtAndHubButtons()
 /* Print a div with buttons for hgCustom and hgHubConnect */
 {
 boolean hasCustomTracks = customTracksExist(cart, NULL);
 puts("<div style='padding-top: 5px; padding-bottom: 5px'>");
 hOnClickButton("document.customTrackForm.submit(); return false;",
 	       hasCustomTracks ? CT_MANAGE_BUTTON_LABEL : CT_ADD_BUTTON_LABEL);
 printf(" ");
 if (hubConnectTableExists())
     hOnClickButton("document.trackHubForm.submit(); return false;", "track hubs");
 nbSpaces(3);
 printf("To reset <B>all</B> user cart settings (including custom tracks), \n"
-	"<A HREF=\"/cgi-bin/cartReset?destination=%s\">click here</A>.\n",
+       "<A HREF=\"cartReset?destination=%s\">click here</A>.\n",
        cgiScriptName());
 puts("</div>");
 }
 
 void hgGatewayCladeGenomeDb()
 /* Make a row of labels and row of buttons like hgGateway, but not using tables. */
 {
 boolean gotClade = hGotClade();
 if (gotClade)
     {
     topLabelSpansStart("clade");
     printCladeListHtml(genome, onChangeClade());
     topLabelSpansEnd();
     }
 topLabelSpansStart("genome");
@@ -446,30 +446,35 @@
 {
 #define PGSNP_OR_VCF "<A HREF='../FAQ/FAQformat.html#format10' TARGET=_BLANK>pgSnp</A> or " \
        "<A HREF='../goldenPath/help/vcf.html' TARGET=_BLANK>VCF</A>"
 
 printf("<div class='sectionLiteHeader'>Select Variants</div>\n");
 /* Check for variant custom tracks.  If there are none, tell the user that they should add one. */
 struct slRef *varTrackList = NULL, *varGroupList = NULL;
 tdbFilterGroupTrack(fullTrackList, fullGroupList, isVariantCustomTrack, NULL,
 		    &varGroupList, &varTrackList);
 if (varTrackList == NULL)
     {
     printf("Your session doesn't have any custom tracks or hub tracks in " PGSNP_OR_VCF
            " format.\n");
     hOnClickButton("return hgva.goToAddCustomTrack();",
                    "add pgSnp or VCF custom track");
+    if (hubConnectTableExists())
+        {
+        nbSpaces(2);
+        hOnClickButton("document.trackHubForm.submit(); return false;", "add track hub");
+        }
     puts("<BR>");
     }
 else if (slCount(varTrackList) > 1)
     {
     printf("If you have more than one custom track or hub track in "
            PGSNP_OR_VCF " format, please select the one you wish to annotate:<BR>\n");
     }
 printf("<B>variants: </B>");
 printf("<SELECT ID='hgva_variantTrack' NAME='hgva_variantTrack' "
        "onchange=\"hgva.changeVariantSource();\">\n");
 char *selected = cartUsualString(cart, "hgva_variantTrack", "");
 struct slRef *ref;
 for (ref = varTrackList;  ref != NULL;  ref = ref->next)
     {
     struct trackDb *tdb = ref->val;
@@ -640,43 +645,53 @@
     boolean defaultChecked = (sameString("dbNsfpSift", table) ||
 			      sameString("dbNsfpPolyPhen2", table));
     cartMakeCheckBox(cart, cartVar, defaultChecked);
     printf("%s<BR>\n", description);
     }
 }
 
 void selectDbNsfp(struct slName *dbNsfpTables)
 /* Let user select scores/predicitions from various tools collected by dbNSFP. */
 {
 if (dbNsfpTables == NULL)
     return;
 startCollapsibleSection("dbNsfp", "Database of Non-synonymous Functional Predictions (dbNSFP)",
 			TRUE);
 //#*** hardcoded version info... we need metadata (#11462)
-char *dbNsfpVersion = sameString(database, "hg19") ? "2.0" : "3.1a";
-char *txVersion = sameString(dbNsfpVersion, "2.0") ? "Gencode release 9 (Ensembl 64, Dec. 2011)" :
-                                                     "Gencode release 22 (Ensembl 79, Mar. 2015)";
+char *dbNsfpVersion = "3.1a";
+char *txVersion = "Gencode release 22 (Ensembl 79, Mar. 2015)";
+char *refYear = "2015";
+char *refUrl = "http://onlinelibrary.wiley.com/doi/10.1002/humu.22932/abstract";
+// For the time being hg19 is still on version 2.0:
+if (sameString(database, "hg19"))
+    {
+    dbNsfpVersion = "2.0";
+    txVersion = "Gencode release 9 (Ensembl 64, Dec. 2011)";
+    refYear = "2013";
+    refUrl = "http://onlinelibrary.wiley.com/doi/10.1002/humu.22376/abstract";
+    }
+
 printf("<A HREF='https://sites.google.com/site/jpopgen/dbNSFP' TARGET=_BLANK>dbNSFP</A> "
-       "(<A HREF='http://onlinelibrary.wiley.com/doi/10.1002/humu.22376/abstract' "
-       "TARGET=_BLANK>Liu <em>et al.</em> 2013</A>) "
+       "(<A HREF='%s' "
+       "TARGET=_BLANK>Liu <em>et al.</em> %s</A>) "
        "release %s "
        "provides pre-computed scores and predictions of functional significance "
        "from a variety of tools.  Every possible coding change to transcripts in "
        "%s gene predictions "
        "has been evaluated.  "
        "<em>Note: This may not encompass all transcripts in your "
-       "selected gene set.</em><BR>\n", dbNsfpVersion, txVersion);
+       "selected gene set.</em><BR>\n", refUrl, refYear, dbNsfpVersion, txVersion);
 //#*** Another cheap hack: reverse alph order happens to be what we want (until VEST??),
 //#*** but priorities would be cleaner:
 slReverse(&dbNsfpTables);
 jsMakeSetClearContainer();
 struct slName *table;
 for (table = dbNsfpTables;  table != NULL;  table = table->next)
     {
     if (sameString(table->name, "dbNsfpPolyPhen2"))
 	{
 	printDbNsfpSource(table->name, HDIV);
 	printDbNsfpSource(table->name, HVAR);
 	}
     else
 	printDbNsfpSource(table->name, 0);
     }