5f7b28612df1ff4e29c31020b33f8fee9c097b11 chmalee Tue Oct 10 12:35:00 2023 -0700 Check for refseq historical old table existence before querying them for hgvs terms, refs #26016 diff --git src/hg/lib/hdb.c src/hg/lib/hdb.c index af609ea..baaa899 100644 --- src/hg/lib/hdb.c +++ src/hg/lib/hdb.c @@ -5832,30 +5832,41 @@ slNameFreeList(&gencodeTables); return tableName; } boolean hDbHasNcbiRefSeq(char *db) /* Return TRUE if db has NCBI's RefSeq alignments and annotations. */ { // hTableExists() caches results so this shouldn't make for loads of new SQL queries if called // more than once. return (hTableExists(db, "ncbiRefSeq") && hTableExists(db, "ncbiRefSeqPsl") && hTableExists(db, "ncbiRefSeqCds") && hTableExists(db, "ncbiRefSeqLink") && hTableExists(db, "ncbiRefSeqPepTable") && hTableExists(db, "seqNcbiRefSeq") && hTableExists(db, "extNcbiRefSeq")); } +boolean hDbHasNcbiRefSeqOld(char *db) +/* Return TRUE if db has NCBI's Historical RefSeq alignments and annotations. */ +{ +// hTableExists() caches results so this shouldn't make for loads of new SQL queries if called +// more than once. +return (hTableExists(db, "ncbiRefSeqPslOld") && + hTableExists(db, "ncbiRefSeqCdsOld") && hTableExists(db, "ncbiRefSeqLinkOld") && + hTableExists(db, "ncbiRefSeqPepTableOld") && + hTableExists(db, "seqNcbiRefSeqOld") && hTableExists(db, "extNcbiRefSeqOld")); +} + char *hRefSeqAccForChrom(char *db, char *chrom) /* Return the RefSeq NC_000... accession for chrom if we can find it, else just chrom. * db must never change. */ { static char *firstDb = NULL; static struct hash *accHash = NULL; static boolean checkExistence = TRUE; if (firstDb && !sameString(firstDb, db)) errAbort("hRefSeqAccForChrom: only works for one db. %s was passed in earlier, now %s.", firstDb, db); char *seqAcc = NULL; if (checkExistence && !trackHubDatabase(db) && hTableExists(db, "chromAlias")) // Will there be a chromAlias for hubs someday?? { firstDb = db;