4061b6e207c4cbf9d7162c4b8aa2d8d1329c7e92
chmalee
  Thu Jun 3 11:00:39 2021 -0700
hubCheck now complains about multiWigs that are children of composites, refs #15650

diff --git src/hg/utils/hubCheck/hubCheck.c src/hg/utils/hubCheck/hubCheck.c
index e0ccc89..6b40d42 100644
--- src/hg/utils/hubCheck/hubCheck.c
+++ src/hg/utils/hubCheck/hubCheck.c
@@ -727,30 +727,40 @@
 {
 if (tdbIsSuper(tdb) || tdbIsComposite(tdb) || tdbIsCompositeView(tdb) || tdbIsContainer(tdb))
     {
     if (tdb->subtracks == NULL)
         {
         errAbort("Track \"%s\" is declared superTrack, compositeTrack, view or "
             "container, but has no subtracks", tdb->track);
         }
 
     // Containers should not have a bigDataUrl setting
     if (trackDbLocalSetting(tdb, "bigDataUrl"))
         {
         errAbort("Track \"%s\" is declared superTrack, compositeTrack, view or "
             "container, and also has a bigDataUrl", tdb->track);
         }
+
+    // multiWigs cannot be the child of a composite
+    if (tdbIsContainer(tdb) &&
+            (tdb->parent != NULL &&
+            (tdbIsComposite(tdb->parent) || tdbIsCompositeView(tdb->parent))))
+        {
+        errAbort("Track \"%s\" is declared container multiWig and has parent \"%s\"."
+            " Container multiWig tracks cannot be children of composites or views",
+            tdb->track, tdb->parent->track);
+        }
     }
 else if (tdb->subtracks != NULL)
     {
     errAbort("Track \"%s\" has children tracks (e.g: \"%s\"), but is not a "
         "compositeTrack, container, view or superTrack", tdb->track, tdb->subtracks->track);
     }
 }
 
 int hubCheckTrack(struct trackHub *hub, struct trackHubGenome *genome, struct trackDb *tdb,
                         struct trackHubCheckOptions *options, struct dyString *errors)
 /* Check track settings and optionally, files */
 {
 int retVal = 0;
 int trackDbErrorCount = 0;