24cf4a1294b7e146f488b877eb87b9f2e83eaa9c hiram Wed Feb 28 17:39:28 2024 -0800 moving static loadSizes() function from hg/utils/pslCheck.c to lib/common.c no redmine diff --git src/hg/pslCheck/pslCheck.c src/hg/pslCheck/pslCheck.c index a5f58fa..a8f08bf 100644 --- src/hg/pslCheck/pslCheck.c +++ src/hg/pslCheck/pslCheck.c @@ -60,43 +60,30 @@ " -pass=pslFile - write PSLs without errors to this file\n" " -fail=pslFile - write PSLs with errors to this file\n" " -filter - use program as a filter, with -pass and/or -fail, don't error exit\n" " on problems, but do report them.\n" " -targetSizes=sizesFile - tab file with columns of target and size.\n" " If specified, psl is check to have a valid target and target\n" " coordinates.\n" " -skipInsertCounts - Don't validate insert counts. Useful for BLAT protein\n" " PSLs where these are not computed consistently.\n" " -querySizes=sizesFile - file with query sizes.\n" " -ignoreQUniq - ignore everything after the last `-' in the qName field, that\n" " is sometimes used to generate a unique identifier\n" " -quiet - no write error message, just filter\n"); } -static struct hash *loadSizes(char *sizesFile) -/* load a sizes file */ -{ -struct hash *sizes = hashNew(20); -struct lineFile *lf = lineFileOpen(sizesFile, TRUE); -char *cols[2]; - -while (lineFileNextRowTab(lf, cols, ArraySize(cols))) - hashAddInt(sizes, cols[0], sqlUnsigned(cols[1])); -lineFileClose(&lf); -return sizes; -} - static struct hash *loadChromInfoSizes(struct sqlConnection *conn) /* chromInfo sizes */ { struct hash *sizes = hashNew(20); char **row; char query[1024]; sqlSafef(query, sizeof query, "select * from chromInfo"); struct sqlResult *sr = sqlGetResult(conn, query); while ((row = sqlNextRow(sr)) != NULL) { struct chromInfo *ci = chromInfoLoad(row); hashAddInt(sizes, ci->chrom, ci->size); chromInfoFree(&ci); } sqlFreeResult(&sr);