049e50b2293ce5e9102eef9177a7cb88b49d7a10 chmalee Wed Mar 4 14:14:03 2026 -0800 Move chromosome:start-end parsing into it's own function in hgFind so we can call just that code from elsewhere. Add a defaultPosition check for assembly hub into hubCheck that verifies the requested chromosome exists for that assembly. Do not warn if the range is too large since we actually silently accept that anyways and clamp to the chromosome ends. refs #37126 diff --git src/hg/inc/hgFind.h src/hg/inc/hgFind.h index e25cab9a6e2..74817ab4a2f 100644 --- src/hg/inc/hgFind.h +++ src/hg/inc/hgFind.h @@ -89,30 +89,36 @@ char *grp; }; boolean matchesHgvs(struct cart *cart, char *db, char *term, struct hgPositions *hgp, boolean measureTiming); /* Return TRUE if the search term looks like a variant encoded using the HGVS nomenclature * See http://varnomen.hgvs.org/ * If search term is a pseudo hgvs term like GeneName AminoAcidPosition (RUNX2 Arg155) and * matches more than one transcript, fill out the hgp with the potential matches so the user * can choose where to go, otherwise return a singlePos */ void fixSinglePos(struct hgPositions *hgp); /* Fill in posCount and if proper singlePos fields of hgp * by going through tables... */ +boolean parseAndResolvePosition(char **inpPos, char *db, struct hgPositions *inpHgPos, + int *relStart, int *relEnd, boolean *relativeFlag, boolean *singleBaseSpec); +/* If inpPos is a valid chromosome position string for db, fill out the associated + * hgPos, relative start and stop, and return TRUE. Otherwise return FALSE so our regular + * search code can deal with item name */ + struct hgPositions *hgPositionsFind(char *db, char *query, char *extraCgi, char *hgAppName, struct cart *cart, boolean multiTerm, boolean measureTiming, struct searchCategory *categories); /* Return container of tracks and positions (if any) that match term. */ struct hgPositions *hgFindSearch(struct cart *cart, char **pPosition, char **retChrom, int *retStart, int *retEnd, char *hgAppName, struct dyString *dyWarn, struct searchCategory *categories); /* If *pPosition is a search term, then try to resolve it to genomic position(s). * If unable to find a unique position then revert pPosition to lastPosition (or default position). * Return a container of matching tables and positions. Warnings/errors are appended to dyWarn. */ void hgPositionsHtml(char *db, struct hgPositions *hgp, char *hgAppName, struct cart *cart); /* Write multiple search results as HTML. */ void hgPosFree(struct hgPos **pEl);