d6a1bdcf39d68664da29cf6eeb9cd3c66a1b4eed angie Thu Apr 16 14:25:57 2020 -0700 Ana pointed out that the normalized score applies to the whole chain, so the 'Fields above refer to entire chain' note should go below it. Also, it's aligned bases (including mismatches) that count towards normScore, not just matching bases. refs #24695 diff --git src/hg/hgc/hgc.c src/hg/hgc/hgc.c index 725bebd..2135d17 100644 --- src/hg/hgc/hgc.c +++ src/hg/hgc/hgc.c @@ -3350,51 +3350,55 @@ printf("%s:%d-%d", chain->qName, qs, qe); if (hDbIsActive(otherDb)) printf(""); printf(" size: %d
\n", chain->qEnd - chain->qStart); } printf("Chain ID: %s
\n", item); printf("Score: %1.0f\n", chain->score); if (nullSubset) printf("Score within browser window: N/A (no aligned bases)
\n"); else if (hDbIsActive(otherDb) && subChain != chain) printf("  Approximate Score within browser window: %1.0f
\n", subSetScore); else printf("
\n"); -printf("
Fields above refer to entire chain or gap, not just the part inside the window.
\n"); boolean normScoreAvailable = chainDbNormScoreAvailable(tdb); if (normScoreAvailable) { char tableName[HDB_MAX_TABLE_STRING]; if (!hFindSplitTable(database, chain->tName, tdb->table, tableName, sizeof tableName, NULL)) errAbort("genericChainClick track %s not found", tdb->table); char query[256]; struct sqlResult *sr; char **row; sqlSafef(query, ArraySize(query), "select normScore from %s where id = '%s'", tableName, item); sr = sqlGetResult(conn, query); if ((row = sqlNextRow(sr)) != NULL) - printf("Normalized Score: %1.0f (bases matched: %d)
\n", - atof(row[0]), (int) (chain->score/atof(row[0]))); + { + double normScore = atof(row[0]); + int basesAligned = chain->score / normScore; + printf("Normalized Score: %1.0f (aligned bases: %d)", normScore, basesAligned); + } sqlFreeResult(&sr); + printf("
\n"); } +printf("
Fields above refer to entire chain or gap, not just the part inside the window.
\n"); printf("
\n"); chainWinSize = min(winEnd-winStart, chain->tEnd - chain->tStart); /* Show alignment if the database exists and */ /* if there is a chromInfo table for that database and the sequence */ /* file exists. This means that alignments can be shown on the archive */ /* server (or in other cases) if there is a database with a chromInfo table, */ /* the sequences are available and there is an entry added to dbDb for */ /* the otherDb. */ if (!startsWith("big", tdb->type) && sqlDatabaseExists(otherDb) && chromSeqFileExists(otherDb, chain->qName)) { if (chainWinSize < 1000000) { printf("View "); hgcAnchorSomewhere("htcChainAli", item, tdb->track, chain->tName);