f03ed98b4b88609222f264bd1bed65f3b3bab9c9 angie Tue Jan 26 16:57:47 2021 -0800 Don't crash if usher omits internal node labels in subtree Newick file. Case found by Russ (subtree size = 500). diff --git src/hg/hgPhyloPlace/runUsher.c src/hg/hgPhyloPlace/runUsher.c index 946ac87..6a5c593 100644 --- src/hg/hgPhyloPlace/runUsher.c +++ src/hg/hgPhyloPlace/runUsher.c @@ -570,31 +570,31 @@ for (id = idList; id != NULL; id = id->next) { char *subst = hashFindVal(nameSubstitutions, id->name); slNameAddHead(&newList, subst ? subst : id->name); } slReverse(&newList); return newList; } static void addMutationsToTree(struct phyloTree *node, struct variantPathNode **pNodeMutList) /* Store the list of mutations associated with each node in node->priv. */ { struct variantPathNode *nodeMuts = slPopHead(pNodeMutList); if (! nodeMuts) errAbort("addMutationsToTree: subtree mutation list has fewer nodes than subtree"); -if (! sameString(nodeMuts->nodeName, node->ident->name)) +if (node->ident->name && ! sameString(nodeMuts->nodeName, node->ident->name)) errAbort("addMutationsToTree: subtree node name is '%s' but subtree mutation list item is '%s'", node->ident->name, nodeMuts->nodeName); if (node->priv != NULL) errAbort("addMutationsToTree: node already has mutations assigned"); node->priv = nodeMuts->sncList; int i; for (i = 0; i < node->numEdges; i++) addMutationsToTree(node->edges[i], pNodeMutList); } static struct subtreeInfo *parseSubtrees(int subtreeCount, struct tempName *subtreeTns[], struct variantPathNode *subtreeMuts[], struct slName *userSampleIds, struct hash *condensedNodes) /* Parse usher's subtree output, figure out which user samples are in each subtree, expand names * of condensed nodes, and write auspice json. */