7ac9dba0abbb050561bb41ea08d98fa76a27d4cb max Thu Feb 13 03:03:31 2025 -0800 improvements to data schema page to make it easier for users to convert and download big data, refs #35223 diff --git src/hg/hgTables/schema.c src/hg/hgTables/schema.c index eee29ba6393..f7a8c031077 100644 --- src/hg/hgTables/schema.c +++ src/hg/hgTables/schema.c @@ -178,41 +178,48 @@ if (sameString("bin", row[0])) hPrintf("Indexing field to speed chromosome range queries."); else hPrintf(" "); } hPrintf("</TD>"); } puts("</TR>"); if (example != NULL) example = example->next; } hTableEnd(); sqlFreeResult(&sr); } -static void explainCoordSystem() +void explainCoordSystem() /* Our coord system is counter-intuitive to users. Warn them in advance to * reduce the frequency with which they find this "bug" on their own and * we have to explain it on the genome list. */ { printf("<BR><I>Note: all start coordinates in our database are 0-based, not \n" "1-based. See explanation \n" "<A HREF=\"http%s://genome.ucsc.edu/FAQ/FAQtracks#tracks1\">" "here</A>.</I>", cgiAppendSForHttps()); } +void printTableBrowserLink(struct trackDb *tdb, char* table) +/* print link to table browser that opens this table */ +{ +printf("To download this table in various text formats, and intersect or correlate with other tables, use our " + "<a href='hgTables?db=%s&hgta_group=%s&hgta_track=%s&hgta_table=%s'>Table Browser</a>.<br>", + database, tdb->grp, tdb->track, table); +} static void printSampleRows(int sampleCount, struct sqlConnection *conn, char *table) /* Put up sample values. */ { char query[256]; struct sqlResult *sr; char **row; int i, columnCount = 0; int itemRgbCol = -1; boolean showItemRgb = FALSE; showItemRgb=bedItemRgb(findTdbForTable(database, curTrack, table, ctLookupName)); // should we expect itemRgb instead of "reserved" /* Make table with header row containing name of fields. */ @@ -412,30 +419,31 @@ hPrintf("<A HREF='https://hgdownload.soe.ucsc.edu/goldenPath/%s/database/'>MariaDB table dump directory</A><BR>", db); char *bigDataUrl = trackDbSetting(tdb, "bigDataUrl"); if (sameString(table, "knownGene") && bigDataUrl!=NULL) { hPrintf("This track is available both in ASCII MariaDB table dump format and bigGenePred (bigBed) format.<br>"); printDownloadLink("bigBed", tdb, bigDataUrl); } } describeFields(db, splitTable, asObj, conn); if (tdbForConn && sameString(tdbForConn->track, table)) { struct trackDb *childTdb = tdbForTrack(db, table, NULL); addNotesForBbiTables(childTdb, conn); + printTableBrowserLink(tdbForConn, table); } jpList = joinerRelate(joiner, db, table, NULL); /* sort and unique list */ slUniqify(&jpList, joinerPairCmpOnAandB, joinerPairFree); if (jpList != NULL) { webNewSection("Connected Tables and Joining Fields"); for (jp = jpList; jp != NULL; jp = jp->next) { if (cartTrackDbIsAccessDenied(jp->b->database, jp->b->table)) continue; struct joinerSet *js = jp->identifier;