4fa28cb0f577addf1cf9dcee723737e009afc1fd braney Fri Sep 7 14:23:11 2018 -0700 add support for bigGenePred version of v29 Gencode #21644 diff --git src/hg/hgTracks/simpleTracks.c src/hg/hgTracks/simpleTracks.c index c55380c..73de7e0 100644 --- src/hg/hgTracks/simpleTracks.c +++ src/hg/hgTracks/simpleTracks.c @@ -6228,30 +6228,48 @@ /* Remove linked features with no tall component from list. */ { struct linkedFeatures *newList = NULL, *el, *next; for (el = list; el != NULL; el = next) { next = el->next; if (el->tallStart < el->tallEnd) slAddHead(&newList, el); } slReverse(&newList); return newList; } #define BIT_BASIC (1 << 0) // transcript is in basic set #define BIT_CANON (1 << 1) // transcript is in canonical set +#define BIT_PSEUDO (1 << 2) // transcript is a pseudogene + +struct linkedFeatures *stripLinkedFeaturesWithBitInScore (struct linkedFeatures *list, unsigned bit) +/* Remove features that don't have this bit set in the score. */ +{ +struct linkedFeatures *newList = NULL, *el, *next; +for (el = list; el != NULL; el = next) + { + next = el->next; + el->next = NULL; + if (!((unsigned)el->score & bit)) + { + slAddHead(&newList, el); + } + } +slReverse(&newList); +return newList; +} struct linkedFeatures *stripLinkedFeaturesWithoutBitInScore (struct linkedFeatures *list, unsigned bit) /* Remove features that don't have this bit set in the score. */ { struct linkedFeatures *newList = NULL, *el, *next; for (el = list; el != NULL; el = next) { next = el->next; el->next = NULL; if ((unsigned)el->score & bit) { slAddHead(&newList, el); } } slReverse(&newList); @@ -6282,30 +6300,34 @@ bigBedAddLinkedFeaturesFromExt(tg, chromName, winStart, winEnd, scoreMin, scoreMax, TRUE, 12, &lfList, BIGBEDMAXIMUMITEMS); slReverse(&lfList); struct linkedFeatures *lf = lfList; for(;lf;lf = lf->next) lf->isBigGenePred = TRUE; struct linkedFeatures *newList = lfList; if (isGencode) { char varName[SMALLBUF]; safef(varName, sizeof(varName), "%s.show.comprehensive", tg->tdb->track); boolean showComprehensive = cartUsualBoolean(cart, varName, FALSE); if (!showComprehensive) newList = stripLinkedFeaturesWithoutBitInScore(lfList, BIT_BASIC); + safef(varName, sizeof(varName), "%s.show.pseudo", tg->tdb->track); + boolean showPseudo = cartUsualBoolean(cart, varName, FALSE); + if (!showPseudo) + newList = stripLinkedFeaturesWithBitInScore(lfList, BIT_PSEUDO); } slSort(&newList, linkedFeaturesCmp); tg->items = newList; tg->itemColor = bigGenePredColor; tg->itemNameColor = bigGenePredColor; } void loadKnownGene(struct track *tg) /* Load up known genes. */ { struct trackDb *tdb = tg->tdb; boolean isGencode = trackDbSettingOn(tdb, "isGencode") || trackDbSettingOn(tdb, "isGencode2"); char *bigGenePred = trackDbSetting(tdb, "bigGeneDataUrl"); struct udcFile *file;