8b082486b066550bbfa17055e7e557f00585df2f chmalee Fri Aug 23 15:58:41 2019 -0700 hubCheck complains about multiWigs with only one subtrack, refs #13428 diff --git src/hg/utils/hubCheck/hubCheck.c src/hg/utils/hubCheck/hubCheck.c index eaefeb2..875e2a8 100644 --- src/hg/utils/hubCheck/hubCheck.c +++ src/hg/utils/hubCheck/hubCheck.c @@ -636,38 +636,48 @@ { retVal = 1; trackDbErr(errors, errCatch->message->string, genome, tdb, options->htmlOut); } errCatchFree(&errCatch); return retVal; } int hubCheckCompositeSettings(struct trackHubGenome *genome, struct trackDb *tdb, struct dyString *errors, struct trackHubCheckOptions *options) /* Check composite level settings like subgroups, dimensions, sortOrder, etc. * Note that this function returns an int because we want to warn about all errors in a single * composite stanza rather than errAbort on the first error */ { int retVal = 0; -if (!tdbIsComposite(tdb)) + +// for now all the combination style stanzas can get checked here, but +// in the future they might need their own routines +if (! (tdbIsComposite(tdb) || tdbIsCompositeView(tdb) || tdbIsContainer(tdb)) ) return retVal; -// check that subgroup lines are syntactically correct: "subGroup name Title tag1=value1 ..." struct errCatch *errCatch = errCatchNew(); if (errCatchStart(errCatch)) { + // check that subgroup lines are syntactically correct: + // "subGroup name Title tag1=value1 ..." (void)membersForAllSubGroupsGet(tdb, NULL); + + // check that multiWigs have > 1 track + if (tdbIsContainer(tdb) && slCount(tdb->subtracks) < 2) + { + errAbort("container multiWig %s has only one subtrack. multiWigs must have more than subtrack", tdb->track); + } } errCatchEnd(errCatch); if (errCatch->gotError || errCatch->gotWarning) { // don't add a new line because one will already be inserted by the errCatch->message trackDbErr(errors, errCatch->message->string, genome, tdb, options->htmlOut); retVal = 1; } return retVal; } void hubCheckParentsAndChildren(struct trackDb *tdb) /* Check that a single trackDb stanza has the correct parent and subtrack pointers */