6f5408b67c1b4534efa4d795bc3776c6c667d586 braney Fri Dec 22 18:29:07 2017 -0800 implement missing data handling in mathWigs diff --git src/hg/hgCollection/hgCollection.c src/hg/hgCollection/hgCollection.c index bda1af9..924526c 100644 --- src/hg/hgCollection/hgCollection.c +++ src/hg/hgCollection/hgCollection.c @@ -85,30 +85,31 @@ char *prefix = ""; char *viewFunc = NULL; char *missingMethod = NULL; if (user) { if (tdb->parent && tdb->subtracks) { viewFunc = trackDbSetting(tdb, "viewFunc"); missingMethod = trackDbSetting(tdb, "missingMethod"); userString = "data-jstree='{\\\"icon\\\":\\\"../images/folderC.png\\\"}' viewType='view' class='folder'"; } else if (tdb->subtracks) { viewFunc = trackDbSetting(tdb, "viewFunc"); + missingMethod = trackDbSetting(tdb, "missingMethod"); userString = "data-jstree='{\\\"icon\\\":\\\"../images/folderC.png\\\"}' viewType='collection' class='folder'"; } else userString = "data-jstree='{\\\"icon\\\":\\\"fa fa-minus-square\\\"}' viewType='track'"; } else { if (tdb->parent && tdb->subtracks) userString = "data-jstree='{\\\"icon\\\":\\\"../images/folderC.png\\\"}' class='nodrop' viewType='view'"; else if (tdb->subtracks) userString = "data-jstree='{\\\"icon\\\":\\\"../images/folderC.png\\\"}' class='collection' viewType='track'"; else userString = "data-jstree='{\\\"icon\\\":\\\"fa fa-plus\\\"}' class='nodrop' viewType='track'"; } @@ -473,34 +474,35 @@ // output a composite header for user composite { char *parent = collection->name; char *shortLabel = collection->shortLabel; char *longLabel = collection->longLabel; fprintf(f,"track %s\n\ shortLabel %s\n\ compositeTrack on\n\ autoScale on\n\ maxHeightPixels 100:30:11 \n\ aggregate none\n\ longLabel %s\n\ %s on\n\ color %ld,%ld,%ld \n\ viewFunc %s\n\ +missingMethod %s\n\ type mathWig\n\ -\tpriority %d\n\ +priority %d\n\ visibility full\n\n", parent, shortLabel, longLabel, CUSTOM_COMPOSITE_SETTING, - 0xff& (collection->color >> 16),0xff& (collection->color >> 8),0xff& (collection->color), collection->viewFunc, priority); + 0xff& (collection->color >> 16),0xff& (collection->color >> 8),0xff& (collection->color), collection->viewFunc, collection->missingMethod, priority); } static void modifyName(struct trackDb *tdb, char *hubName, struct hash *collectionNameHash) /* If this is a new track in the collection we want to make sure * it gets a different name than the track in trackDb. * If it's a native track, we want to squirrel away the original track name. */ { if ((tdb->grp == NULL) || (hubName == NULL) || differentString(tdb->grp, hubName)) { if (collectionNameHash) hashStore(collectionNameHash, tdb->track); char *bigDataUrl = trackDbSetting(tdb, "bigDataUrl"); if (bigDataUrl == NULL) @@ -626,31 +628,31 @@ struct jsonElement *strEle = (struct jsonElement *)hashMustFindVal(attrHash, "name"); track->name = jsonStringEscape(strEle->val.jeString); hashAdd(trackHash, parentId, track); strEle = (struct jsonElement *)hashMustFindVal(attrHash, "shortlabel"); track->shortLabel = jsonStringEscape(strEle->val.jeString); strEle = (struct jsonElement *)hashMustFindVal(attrHash, "longlabel"); track->longLabel = jsonStringEscape(strEle->val.jeString); strEle = (struct jsonElement *)hashMustFindVal(attrHash, "visibility"); track->visibility = jsonStringEscape(strEle->val.jeString); strEle = (struct jsonElement *)hashMustFindVal(attrHash, "color"); track->color = hexStringToLong(jsonStringEscape(strEle->val.jeString)); strEle = (struct jsonElement *)hashFindVal(attrHash, "viewfunc"); if (strEle) track->viewFunc = jsonStringEscape(strEle->val.jeString); - strEle = (struct jsonElement *)hashFindVal(attrHash, "missingMethod"); + strEle = (struct jsonElement *)hashFindVal(attrHash, "missingmethod"); if (strEle) track->missingMethod = jsonStringEscape(strEle->val.jeString); } } } static struct track *parseJsonElements( struct jsonElement *collectionElements) // parse the JSON returned from the ap { struct track *collectionList = NULL; struct hash *trackHash = hashNew(5); struct jsonParseData jpd = {&collectionList, trackHash}; jsonElementRecurse(collectionElements, NULL, FALSE, jsonObjStart, NULL, &jpd); slReverse(&collectionList);