9ca89f9ff4facb407acfd0a8e970472a45be29a0
hiram
Tue Sep 22 11:48:06 2020 -0700
adding chrom.sizes as download file for hgTracks sequences in assembly hubs refs #24396
diff --git src/hg/hgTracks/hgTracks.c src/hg/hgTracks/hgTracks.c
index 62ca1c4..cb31886 100644
--- src/hg/hgTracks/hgTracks.c
+++ src/hg/hgTracks/hgTracks.c
@@ -9910,32 +9910,33 @@
boolean gotExtTools = extToolsEnabled();
setupHotkeys(gotExtTools);
if (gotExtTools)
printExtMenuData(chromName);
if (recTrackSetsEnabled())
printRecTrackSets();
}
static void chromInfoTotalRow(int count, long long total, boolean hasAlias)
/* Make table row with total number of sequences and size from chromInfo. */
{
cgiSimpleTableRowStart();
cgiSimpleTableFieldStart();
printf("Total: %d", count);
cgiTableFieldEnd();
-cgiSimpleTableFieldStart();
+cgiTableFieldStartAlignRight();
printLongWithCommas(stdout, total);
+puts(" ");
cgiTableFieldEnd();
if (hasAlias)
{
cgiSimpleTableFieldStart();
puts(" ");
cgiTableFieldEnd();
}
cgiTableRowEnd();
}
static char *chrAliases(struct hash *aliasHash, char *sequenceName)
/* lookup the sequenceName in the aliasHash and return csv string
* of alias names
*/
{
@@ -10203,77 +10204,85 @@
cgiTableRowEnd();
cgiSimpleTableRowStart();
cgiSimpleTableFieldStart();
printLongWithCommas(stdout, scafCount);
cgiTableFieldEnd();
cgiSimpleTableFieldStart();
printLongWithCommas(stdout, totalSize);
cgiTableFieldEnd();
}
cgiTableRowEnd();
}
sqlFreeResult(&sr);
hFreeConn(&conn);
}
-static void chromSizesDownloadRow(boolean hasAlias, char *hubAliasFile)
+static void chromSizesDownloadRow(boolean hasAlias, char *hubAliasFile, char *chromSizesFile)
/* Show link to chrom.sizes file at end of chromInfo table (unless this is a hub) */
{
if (! trackHubDatabase(database))
{
cgiSimpleTableRowStart();
cgiSimpleTableFieldStart();
- puts("Download as file");
+ puts("Download as file:");
cgiTableFieldEnd();
cgiSimpleTableFieldStart();
printf("%s.chrom.sizes",
hDownloadsServer(), database, database, database);
cgiTableFieldEnd();
if (hasAlias)
{
cgiSimpleTableFieldStart();
puts(" ");
cgiTableFieldEnd();
}
cgiTableRowEnd();
}
else if (hubAliasFile)
{
cgiSimpleTableRowStart();
cgiSimpleTableFieldStart();
- puts("Download as file");
+ puts("Download as file:");
cgiTableFieldEnd();
cgiSimpleTableFieldStart();
+ if (chromSizesFile)
+ {
+ printf("%s.chrom.sizes.txt", chromSizesFile, trackHubSkipHubName(database));
+ puts(" ");
+ }
+ else
puts(" ");
cgiTableFieldEnd();
cgiSimpleTableFieldStart();
- printf("assembly hub alias file", hubAliasFile);
+ printf("%s.chromAlias.txt", hubAliasFile, trackHubSkipHubName(database));
cgiTableFieldEnd();
cgiTableRowEnd();
}
}
void chromInfoPage()
/* Show list of chromosomes (or scaffolds, etc) on which this db is based. */
{
boolean hasAlias = FALSE;
+char *chromSizesFile = NULL;
char *aliasFile = NULL;
if (trackHubDatabase(database))
{
aliasFile = trackHubAliasFile(database);
if (aliasFile)
hasAlias = TRUE;
+ chromSizesFile = trackHubChromSizes(database);
}
else
hasAlias = hTableExists(database, "chromAlias");
char *position = cartUsualString(cart, "position", hDefaultPos(database));
char *defaultChrom = hDefaultChrom(database);
char *freeze = hFreezeFromDb(database);
struct dyString *title = dyStringNew(512);
if (freeze == NULL)
dyStringPrintf(title, "%s Browser Sequences",
hOrganism(database));
else if (stringIn(database, freeze))
dyStringPrintf(title, "%s %s Browser Sequences",
hOrganism(database), freeze);
else
@@ -10307,31 +10316,31 @@
else if (hasAlias)
{
cgiSimpleTableFieldStart();
puts("alias sequence names ");
cgiTableFieldEnd();
}
cgiTableRowEnd();
if (sameString(database,"hg38"))
chromInfoRowsChromExt("withAltRandom");
else if ((startsWith("chr", defaultChrom) || startsWith("Group", defaultChrom)) &&
hChromCount(database) < 100)
chromInfoRowsChrom();
else
chromInfoRowsNonChrom(1000);
-chromSizesDownloadRow(hasAlias, aliasFile);
+chromSizesDownloadRow(hasAlias, aliasFile, chromSizesFile);
hTableEnd();
cgiDown(0.9);
hgPositionsHelpHtml(organism, database);
puts("");
dyStringFree(&title);
webEndSectionTables();
} /* void chromInfoPage() */
void resetVars()
/* Reset vars except for position and database. */
{
static char *except[] = {"db", "position", NULL};
char *cookieName = hUserCookie();