Skip to main content

This is a preprint.

It has not yet been peer reviewed by a journal.

The National Library of Medicine is running a pilot to include preprints that result from research funded by NIH in PMC and PubMed.

bioRxiv logoLink to bioRxiv
[Preprint]. 2026 Feb 27:2026.02.25.708046. [Version 1] doi: 10.64898/2026.02.25.708046

Identifying Robust Subclonal Structures through Tumor Progression Tree Alignment

Jacob Gilbert 1, Chih Hao Wu 2, Marina Knittel 3, Alejandro A Schäffer 2, Salem Malikić 2, S Cenk Sahinalp 2
PMCID: PMC13119310  PMID: 42051318

Abstract

Understanding and comparing tumor evolutionary histories is fundamental to cancer genomics. Clonal trees, used to model tumor progression, are rooted, unordered trees in which each node represents a subclone labeled by a set of distinct mutations.

To compare two clonal trees, we introduce omlta, the optimal multi-label tree alignment, which removes the minimum number of mutation labels from the trees, so that the remaining trees are isomorphic. Computing omlta is NP-hard. Here, we present an algorithm to compute the omlta, with a running time of 𝒪(2k2⋅L3logL) where L≥1 is the total number of mutation labels occurring in the input trees and k is the minimum possible number of mutation labels that need to be removed for the alignment.

Our implementation (https://github.com/algo-cancer/omlta) is the first computational tool for determining the optimal alignment between clonal trees. We applied omlta to 126 cases from the TRACERx study on non-small cell lung cancers and some melanoma single-cell data.

1. Introduction

A sequence - an ordered list of labels (characters/symbols) - is a fundamental data type in computational biology; in fact, aligning two sequences was among the very first computational problems tackled in biology (1; 2; 3). At its core, the sequence alignment problem asks to compute the maximum number of matching labels which appear in the same sequential order in both input sequences. In this form, sequence alignment corresponds to the longest common subsequence of the two input sequences. More generalized forms of alignment may give different weights to different aligned label pairs including mismatched labels.

The dual problem to sequence alignment is the edit distance, which can be defined as the minimum number of label deletions from the input sequences so that the remaining sequences are identical. This definition is equivalent to the more commonly used definition of the edit distance as the minimum number of label insertions and deletions to be applied to a sequence to transform it to another sequence. Another related measure, the Levenshtein edit distance, differs slightly by permitting label substitutions in addition to insertions and deletions (1). It is well known that one can compute the optimal alignment of two sequences in time quadratic with their length (2). Any algorithm that computes the sequence alignment, implicitly computes the edit distance as well.

Trees, another data type commonly used in computational biology, generalize sequences by allowing branching, e.g., to model evolutionary history. One can generalize sequence alignment to alignment of rooted, node-labeled unordered (i.e., sibling nodes in the trees have no left-to-right ordering), trees as follows. Given two such trees, the tree alignment problem seeks the maximum-size subset of labeled nodes that induce a pair of isomorphic trees after all nodes and labels not in the output tree alignment set are deleted from the two input trees.

In this work, we are interested in aligning the evolutionary histories of tumor cells, which are commonly represented by clonal trees of tumor progression. In a clonal tree, each node corresponds to a genetically distinct population of cells, referred to as a (sub)clone. Formally, a clonal tree is a node-labeled tree where (i) the sibling nodes are unordered, (ii) each node can be labeled with 0,1, or more mutations, and (iii) each mutation label appears once in the tree. The labels of a given node represents the set of mutations which were acquired for the first time by its corresponding (sub)clone - without homoplasy. This follows from the observation that independent acquisition of an existing mutation in the tumor by another cell is rare (4). For some algorithms on clonal trees, it is necessary to assume that the root has no mutation labels as it may correspond to a set of normal cells that predated any somatic alterations, but we do not make such an assumption.

Our main contributions.

We introduce omlta, the optimal multi-label tree alignment for a pair of clonal trees (as well as any other tree type where a node can have any number of labels, provided that each label in the tree is unique) as the alignment which deletes the minimum possible number of labels so that the resulting trees are isomorphic (subject to empty node removals and node expansions; see Section 4.1 for the formal definition). Because omlta identifies structural features (e.g., subtrees) shared between input trees, it can be employed for making robust biological inferences through the use of clonal trees inferred via different methods on the same input data, or using different data obtained from the same sample, or using different samples from the same tumor.

We provide the first algorithm to compute the omlta between two clonal trees T1 and T2 and an implementation. The running time of our algorithm is 𝒪(2k2⋅L3logL), where L is the total number of distinct mutation labels in T1 and T2, and k is the value of the optimal multi-label tree edit distance (omltd) between T1 and T2, i.e., the number of mutation labels deleted by omlta. We can assume that L≥1, so that logL is defined, because there would be no reason to construct a clonal tree for a tumor with no mutations. In our primary application, the trees T1 and T2 necessarily have the same mutation and label set, but that will not be the case for all uses of our method. Therefore, we point out that any mutation label occurring in exactly one of the two trees must be deleted as part of the alignment and hence omltdT1,T2 must be at least as large as the symmetric difference of the two sets of mutation labels. This running time is polynomial when k is bounded by a constant and hence we show that the omlta problem is fixed parameter tractable (FPT). Since we also show that computing omlta (and omltd) is NP-hard, an FPT algorithm such as ours is qualitatively the best one can hope for with respect to efficiency. (See Section 4 and the Supplementary Information for the algorithm and some running time analysis.) The exponential term, 2k/2, in the running time of our algorithm is strictly better than the 2.62k term in the running time 𝒪poly(n)⋅2.62k of the state-of-the-art unordered tree edit distance algorithm for general (i.e., including, but not necessarily unique labeled) trees (5) where n is the number of nodes.

We applied omlta to clonal trees inferred from both multi-sample bulk and single cell sequencing data. (a) On a cohort of 126 metastatic non-small cell lung cancer tumors from the TRACERx project (6), our algorithm could compute the omlta of clonal trees inferred by CONIPHER (7) (the method employed by the TRACERx project) and PairTree (8) (another popular method for clonal tree inference) on the same tumor quickly, often within seconds. We used omlta to assess the concordance between the trees inferred by these two methods, which we observed to vary substantially across the two major subtypes of NSCLC, namely LUAD (LUng ADenocarcinoma) and LUSC (LUng Squamous Cell carcinoma). Specifically, omltd values tend to be larger for the LUAD cases than the LUSC cases, implying that the trees inferred for LUAD cases are less reliable for downstream interpretation. Importantly we observed that omltd is negatively associated with the mean cancer cell fraction (CCF) among mutations in a tumor - implying that trees for tumors with lower CCF tend to be less robust to the choice of tree inference method. (b) Our algorithm could also efficiently compute the omlta of the clonal trees for the B2905 preclinical melanoma cell line (9) inferred (i) on data obtained by two distinct single cell sequencing technologies, or (ii) on data from the cell line before and after it was subjected to immunotherapy, or (iii) using different tree inference methods. As can be expected, the trees obtained from single cell data turned out to be more robust than those obtained from bulk data, even when the mutations were identified through transcriptome sequencing (see Section 2).

We also demonstrated the robustness of omlta/omltd compared to alternative similarity measures (see Sections A.6 and A.7). Our implementation is available at https://github.com/algo-cancer/omlta.

1.1. Related Works

Alignment Trees vs Consensus Trees.

While we provide the first clonal tree alignment algorithm, omlta is related to frequently studied consensus trees (10; 11; 12; 13; 14; 15). Given a set of input trees, the consensus tree is the tree that minimizes the sum of distances to each input tree. A key difference between consensus tree algorithms and tree alignments is that typically, in an effort to make runtimes tractable, the considered distance for a consensus tree often counts only parent-child or ancestor-descendant relationships as in (10; 11; 15) whereas alignment trees are derived from the dual problem of omltd (see Section A.7 for a comparison of omltd to other distance measures). A further difference is that consensus trees must include all shared mutations across all input trees. As a consequence, given two input trees, T1 and T2, that are isomorphic except for the placement of a single mutation a - located on node v1 in T1 and on its descendant v2 in T2 - the consensus tree may collapse all nodes between v1 and v2 into a single node, thereby losing the ancestor–descendant relationships among the associated mutations that T1 and T2 otherwise share (14). In contrast, the alignment tree contains precisely those mutations that agree in ancestor-descendant relationship and topological location such that the induced trees are isomorphic; e.g., the omlta of T1 and T2 above excludes a but keeps all remaining mutations and their relative ordering.

Alternative Measures of Clonal Tree Similarity/Distance.

For clonal tree similarity, the closest measure to omltd in the prior literature is multi-label tree dissimilarity (MLTD) proposed in (16). However, MLTD allows only leaf label deletions. One feature of MLTD is an edit operation denoted node expansion, which replaces a chosen node by a linear chain of two or more nodes and distributes its mutation labels among the nodes in the chain. Both MLTD and omltd permit the node expansion operation free of cost since trees of tumor progression inferred through the use of different sequencing technologies and/or methods may have varying levels of granularity/coverage. For example, while trees inferred from bulk sequencing data usually contain fewer numbers of nodes with multiple mutations per node (17; 18), trees inferred from single-cell data can be as detailed as a fully resolved clonal tree, also known as a mutation tree, containing only one mutation label per node (19; 20). By allowing node expansions at no cost, MLTD (and omltd) compute the similarity between clonal trees while reconciling such differences between them without penalty. The algorithms for computing MLTD and omlta can be modified to charge a penalty for this operation; they can also be modified to forbid node expansions, without any increase in asymptotic runtime.

In (16), the general tree edit distance was noted to be NP-hard, and MLTD was offered as a restricted but practical variant, solvable in polynomial time. Later in (20), a different version of the tree edit distance, between a clonal tree (representing an inferred phylogeny) and a mutation tree (where each node is assigned a single unique label) was considered and reduced to the general tree edit distance problem. Our algorithm for omltd is the first efficient solution to the unordered tree edit distance problem for two clonal trees allowing general node deletions and node expansions.

There are other measures of similarity based on the relative placement of labels, especially for species trees, including the well-known Robinson-Foulds distance (21). Because in species trees only the leaves are labeled - each with a single label representing a species, the measures defined to compare species trees are not commonly used to compare clonal trees (22). We include one such distance in our later comparisons, namely the Bourque distance (23), which is a generalization of Robinson-Foulds for clonal trees. Other approaches for comparing clonal trees (22; 24) are not based on a single measure but use a complementary pair of measures (e.g., ancestor-descendant and different-lineage measures). Furthermore, they lack the concreteness of the similarity evidence provided by the tree alignment itself. See Section A.6 for a detailed description of these similarity measures and Section A.7 for their comparison with omltd on simulated data.

Available Algorithms for Tree Edit Distance.

The dual problems of tree alignment and tree edit distance, first proposed by (25), have been studied in many contexts. For rooted, ordered trees, several polynomial-time approaches have been developed (26; 27; 28; 29), and the state-of-the-art is a sub-cubic polynomial time algorithm (30). Computing the alignment and edit distance between unordered trees (such as clonal trees) however is NP-hard (31). Several works in the literature have proposed various workarounds to avoid intractable computation times for unordered tree edit distance (5; 32; 33; 34; 35). On the theoretical side, some families of trees which admit polynomial-time solutions have been identified and several fixed-parameter tractable algorithms have been proposed. Akutsu et al. (5) provided an 𝒪poly(n)⋅2.62k-time dynamic programming solution for unordered tree edit distance where the k is the actual tree edit distance of the input trees and n is the size of the input trees. Additionally, they showed that there is a polynomial-time solution when the maximum degree of the input trees is constant. The runtime and setting of (5) is most similar to our own; we provide an in-depth discussion of it and other theoretical unordered tree edit distance literature in Section A.1.

Alignment Tree vs Maximum Agreement Subtree.

The omltd problem we study is also related to a well-studied problem called the Maximum Agreement Subtree problem (36; 37; 38). To our knowledge, this problem has been rarely studied in the context of cancer (39), but it has several non-cancer biological applications in its own right. We discuss in Section A.2 why the tree alignment and maximum agreement subtree problems are distinct and why algorithms for maximum agreement subtree do not transfer to our setting.

2. Results

We present applications of omlta to multi-sample bulk sequenced (bWES) lung cancer and single-cell sequenced (SCS) melanoma data sets. Additional results on simulated data (Section A.7), runtime (Section A.8), and a comparison of omltd to other measures (Sections A.6 and A.7) are available in Supplementary Materials.

2.1. Application to bWES trees: TRACERx non-small cell lung cancer cohort

Dataset and experimental setup

Al Bakir et. al presented clonal trees inferred for a cohort of n=126 metastatic non-small cell lung cancers (NSCLC) from the TRACERx project (6). The cohort includes both lung adenocarcinoma (LUAD) and lung squamous cell carcinoma (LUSC) cases (Fig. 3a). For each case, multiple spatially distinct samples from both primary and metastatic sites were subjected to bulk whole exome sequencing (bWES). The mutations in each case were clustered using PyClone (40) with some additional pre-processing (e.g., for removing “biologically improbable” clusters) and a clonal tree was inferred on these clusters using CONIPHER (7). Briefly, CONIPHER executes topological search through first performing subgraph pruning, then exhaustive enumeration and scoring of remaining trees towards finding an optimal-scoring solution. Several alternative models, objectives, and inference methods can, however, yield different tree reconstructions. Previous work (7) attempted to explore this variability by comparing the CONIPHER inferred tree for a single case from the NSCLC cohort to those inferred by three alternative methods, namely PairTree (8), CITUP (17), and LICHeE (41), and assessing the level of their similarity. However, since no method for tree alignment was available at that time, the study did not identify where the trees agreed exactly.

Figure 3:

Figure 3:

a. Metastatic tumors from the TRACERx NSCLC cohort, consists of 56 LUAD cases and 36 LUSC cases; the cohort also includes an additional 24 cases of other subtypes and 10 cases with no subtype annotation. b. For each case, omlta between the trees inferred by CONIPHER and PairTree was obtained and their concordance was measured as the proportion of robust mutational placements, i.e., 1 - omltd/number of mutations. The panel depicts all cases with a subtype annotation (only a subset of cases are labeled explicitly due to limited space) sorted based on the concordance values: LUSC cases tend to have higher concordance values and thus are more robust. c-d. A comparison between the distribution of LUAD and LUSC cases with respect to c concordance values, and d mean CCF of the mutations harbored: both distributions reveal a significant difference between the two subtypes. e. Pearson correlation between the mean CCF and tree concordance values among LUAD and LUSC cases: higher mean CCF values among LUSC cases may explain why their inferred trees tend to have higher concordance. f-g. For the two NSCLC subtypes, f LUAD and g LUSC, scatterplots show the number of cases in which a gene is mutated (y-axis) against the number of cases in which a mutation within that gene has discordant placement between CONIPHER and PairTree trees (x-axis). Genes with known “role in cancer” (in orange) are shown separately from genes with no putative role (in gray). The points for outlier genes are labeled to the extent that labels could be added without overlaps.

Here, we use omlta on all 126 metastatic NSCLC cases to align each tree obtained by CONIPHER to those by PairTree - the most recently developed method among the three alternative approaches employed in the original study, which was also reported to differ from CONIPHER the most (7). On simulated data, it was reported that CONIPHER agreed best with CITUP - with LICHeE being a close second (7). These two tools are now more than 10 years old and CONIPHER was developed to address their limitations, especially with respect to scalability: e.g., the number of mutation clusters that could be handled by CITUP is restricted to 10 and many of the cases in the TRACERx cohort have larger number of clusters.

We provide an in-depth exploration of the concordance between these two methods and the robustness of the clonal trees reported by the TRACERx NSCLC study (6). PairTree is methodologically distinct from CONIPHER as it performs sampling to search through the space of trees for maximizing the posterior probability of mutation pairs with ancestor-descendant relationship. For each case in the cohort, the input we provided to PairTree was exactly the same set of mutational clusters used for CONIPHER. Then we used PairTree to obtain the top 10 trees with the highest reported likelihood, and aligned each tree with that obtained by CONIPHER via omlta, to identify the tree with the lowest “discordance”, defined as the omltd normalized by the number of mutations observed in the tumor, for further consideration. Our choice to compare the PairTree tree that had the smallest omltd to the corresponding tree inferred by CONIPHER was to give the most favorable outcome to both tools; even in comparing the most similar trees between these methods, they still differ substantially.

See Fig. 1 for an example tumor with the top 10 trees obtained by PairTree, their pairwise discordances, as well as their discordances with the CONIPHER tree. As shown, the 10 trees inferred by PairTree differ not only from the tree obtained by CONIPHER but also from one another. These 10 trees appear to form two distinct clusters, within which the discordance among trees is lower than that between clusters: {3,4,5,7,8,10} and {1,2,6,9}. The latter cluster also exhibits lower discordance with the CONIPHER tree.

Figure 1:

Figure 1:

For each of the 126 metastatic NSCLC cases in the TRACERx cohort (6), we used PairTree to obtain an alternative tree to that reported by CONIPHER on the same set of mutational clusters employed by CONIPHER in the original study. a. First, for each case, all PairTree produced trees were evaluated and the top 10 trees according to their reported likelihood were identified: the left panel depicts the top 10 trees for case CRUK0412 (out of 1795 trees sampled by PairTree) - on each node, the number of mutations in the cluster assigned to that node is provided. The right panel depicts the discordance between each pair of trees - defined as the omltd normalized by the total number of mutation labels. b. Next, each of the top 10 PairTree trees for each case is aligned with the CONIPHER tree, and the one with the lowest discordance is identified. The panel shows for case CRUK0412, the discordance between each PairTree tree and the CONIPHER tree. Since, with respect to its reported likelihood, tree 2 has the lowest discordance, it is identified as the PairTree alternative for this case.

Inferred topological structures and their biological implications vary among alternative tools

CONIPHER and PairTree inferred trees vastly differ in their overall topology (Section A.4). Using the average node depth of a tree T (more precisely, ST:=1|V|∑vδT(v) - where δT(v) is the depth of a node v) as a measure of “tree imbalance” (42), we found that CONIPHER trees are significantly more imbalanced than the corresponding PairTree trees (Wilcoxon signed-rank test, P=2.2×10−22; Fig. 2b). This is likely due to CONIPHER‘s subgraph pruning approach, which strongly preserves the nested structure of mutational clusters and thereby favors imbalanced trees. In contrast, PairTree‘s sampling-based approach imposes less stringent hierarchical constraints.

Figure 2:

Figure 2:

a. Distribution of mutations across the metastatic NSCLC cases from the TRACERx cohort. Top panel: a mutation is either in a gene with a “putative role in cancer” (i.e., is a oncogene or tumor suppressor - colored orange) or with “no putative role in cancer” (colored gray). Orthogonally, the placement of the mutation is either concordant (i.e., is preserved in the omlta of the trees inferred by CONIPHER and PairTree for the case - solid color) or discordant (i.e., is deleted in the omlta - shaded color). The proportion of discordant mutations are higher among those in genes with a role in cancer. Bottom panel: the proportion of concordantly placed mutations among tumor suppressor genes are similar to that among oncogenes. b. For any given case, the “imbalance” of a clonal tree, measured as the mean node depth (distance from the root), is typically higher if inferred by CONIPHER. E.g., for case CRUK0337, the imbalance of the tree inferred by CONIPHER is 3, but the imbalance of the tree inferred by PairTree is 1.625. (Blue nodes in the trees represent the mutational clusters preserved in their omlta.) c. The inferred timing of metastatic branching (6) differs between the CONIPHER and PairTree trees for case CRUK0733. Left panel: In the CONIPHER inferred tree, the metastatic branching is characterized as “late” whereas in the PairTree tree for the same case, it is characterized as “early”. Middle panel: The timing of metastatic branching differs significantly between CONIPHER and PairTree trees: PairTree typically places the metastatic branching closer to the root. Right panel: The number of cases for which CONIPHER and PairTree agree/disagree with respect to the timing of metastatic branching; additionally, the timing of the metastatic branching based on omlta trees (given in parentheses) agree with CONIPHER more often.

Topological differences can substantially affect biological interpretation. For example, analysis of the structure of subclones in a cancer may guide combination therapy (43) and may yield insights about changes in the rate and types of mutations in later (lower in the tree) subclones (44; 45). For these data, the TRACERx NSCLC study (46) classified each metastatic branching (i.e., seeding) event as either “early” or “late” based on whether mutations “clonal” across primary tumor samples were respectively absent from (early) or shared with (late) the corresponding metastatic sample. Hong and colleagues first showed that different methods of tumor phylogenetic inference on the same input data can yield different interpretations about metastasis in a patient (47). While the study did not differentiate mutations with respect to their clonality beyond whether they are present (or not) in all primary samples, one can use the inferred clonal tree to categorize all mutations that are on the trunk of the tree, i.e., prior to any branching within the primary tumor, as “clonal”. This allows a more refined temporal characterization of metastatic branching events (as early vs. late clonal) based on the node on the trunk of the tree for the primary tumor from which the metastatic sample branches out. (See, e.g., Fig. 2c, left panel). In trees inferred by PairTree, metastatic branching typically occurs closer to the root compared to trees inferred by CONIPHER (Fig. 2c, middle panel). There are 59 cases where metastatic branching would be characterized as ‘late’ using CONIPHER trees but would be characterized as ‘early’ using PairTree trees. A more robust characterization is possible via the alignment trees: omlta trees characterize 47 of these 59 cases as late (in agreement with CONIPHER) and characterize the remaining 12 as early (in agreement with PairTree). Interestingly, an additional six cases characterized as ‘early’ by CONIPHER are characterized as ‘late’ by PairTree; the omlta classification agrees with PairTree in all six. There are two remaining cases which were not characterized as ‘early’ or ‘late’ by by PairTree because their trees had no metastasis specific branch from the trunk of the tree. (Fig. 2c, right panel; see Supplementary Table S1 for details.)

Robustness of mutational placement in clonal trees vary across tumors

We investigated mutational placements that are robust to the choice of inference method by aligning trees obtained from the same case by CONIPHER and PairTree. Pairwise alignment is a label-preserving bijection between subsets of vertices of two labeled trees that induces isomorphic subtrees on the set of preserved labels while minimizing the number of omitted labels. For clonal trees, preserved and omitted mutational labels respectively correspond to ‘concordant’ and ‘discordant’ mutational placements.

We used omlta to quantify the robustness of mutational placements between trees inferred by CONIPHER and PairTree on each tumor from the TRACERx dataset (6; 46). When stratified by histological subtype of NSCLC, the trees obtained by CONIPHER and PairTree exhibited significantly higher discordance for LUAD cases than LUSC cases (Mann-Whitney U test, P=0.003; Fig. 3b and 3c). To identify the basis of this difference, we first considered the cancer cell fraction (CCF) of mutations across the cases of each subtype. We observed that LUAD cases typically harbor a larger fraction of low CCF (typically subclonal) mutations than LUSC cases; e.g., in several LUAD cases more than half of all mutations had CCF ≤ 0.3 (See Supplementary Fig. S5, top panel). This was consistent with the findings of the TRACERx study (46): “in LUAD, the majority of frequently mutated cancer genes were subject to significant positive subclonal selection … no significant positive selection was detectable in truncal mutations.”

Next, we explored whether topological differences between the trees inferred by either method, as well as the omlta trees can explain the differences between LUAD and LUSC cases. For any given case, the tree inferred by CONIPHER was typically more imbalanced than the tree inferred by PairTree - with their omlta falling in between. However within the trees inferred by each method (CONIPHER, PairTree or their omlta), the imbalance distribution for LUAD cases was similar to that for LUSC cases. (See Supplementary Fig. S6.) Likewise, the imbalance difference between the CONIPHER tree and the PairTree tree is distributed similarly among LUAD cases and LUSC cases.

The concordance between the trees inferred by CONIPHER and PairTree for a given case is strongly associated with the subtype (Mann-Whitney U test, P=0.003; Fig. 3c); however, this association can be attributed to LUAD cases harboring a higher proportion of low CCF mutations (Mann-Whitney U test, P=0.012; Fig. 3d), which are typically subclonal. In fact, there is a strong association between mean CCF and tree concordance (Pearson’s Correlation coefficient = 0.78, P=3.14×10−20; Fig. 3e). While it is possible to infer the temporal ordering of clonal mutations robustly, the placement of a subclonal mutation may differ among inference methods, especially if they are based on different assumptions and parameter settings. As a result, cases with higher mean CCF appear to be more robust to the choice of tree inference method.

Robustness of mutational placement in clonal trees vary among genes with distinct roles in cancer

Next, we evaluated the robustness of mutational placements according to the known roles of the genes harboring them in the context of cancer. The genes that harbor these mutations are annotated using a combination of two cancer gene censuses, Catalogue Of Somatic Mutations In Cancer (COSMIC) (48) and OncoKB (49; 50). Below, we refer to mutations by their genes and do not distinguish different mutations in a case - primarily for compactness of display. If a gene harbors more than one mutation in a case, we regard the gene as having unstable placement if any of its mutations were deleted from the omlta.

An earlier study from the TRACERx consortium showed that driver mutations among such consensus cancer genes are typically clonal - with exceptions (51). On the other hand the CONIPHER tool used in the TRACERx NSCLC study does not utilize annotations of genes harboring the mutations in their placement. Thus, we perform a post-hoc analysis of the placement of mutations harbored by genes with a role in cancer.

Genes previously characterized as an oncogene and/or tumor suppressor gene, or as a gene fusion are collectively referred to as genes having a ‘role in cancer’ and are distinguished from those with ‘no putative role’ in tumor initiation, proliferation, or metastasis. In aggregate, 56.9% of genes (3.4% ‘role in cancer’ and 53.5% ‘no putative role’) had discordant inferred placements in at least one case in the NSCLC cohort. It is expected that genes which implicated in tumor progression are associated with clonal expansion—implying that all topological orderings that include such mutations should consistently assign them to more clonal nodes in a tree, and thereby be robust across multiple solutions. Yet such genes exhibited discordant mutational placement between trees in our comparisons with a 1.65-fold higher rate than other genes. Specifically, genes with a ‘role in cancer’ had disproportionately more discordant placements between trees (discordant:concordant ratio of 2.13:1; 3.4% vs 1.6%) compared to genes without an established functional role in cancer (discordant:concordant ratio of 1.29:1; 53.5% vs 41.5%). There was not a discernible difference in the relative number of discordantly placed genes between oncogenes and tumor suppressor genes (Fig. 2a).

Subsequently, we examine whether frequently mutated genes have robust inferred mutational placements. As can be expected, the number of cases in the TRACERx cohort in which a mutated gene is discordantly placed by PairTree and CONIPHER (i.e., the x-axes in Fig. 3f,g) increases with the number of cases in which that gene is mutated (i.e., the y-axes in Fig. 3f,g). Furthermore, commonly mutated genes with a role in cancer (colored orange) are as likely (about one in four) to be discordantly placed as other commonly mutated genes (colored gray). A subset of these genes likely represent key mutations in lung cancer. Interestingly, TP53 which is commonly mutated in NSCLC cases is not often placed discordantly (it was placed discordantly in only 6/89 cases) possibly because it is typically mutated clonally.

A key purpose of inferring clonal trees is to aid oncologists in designing combination therapies such that each major subclone is treated. Among the commonly mutated genes labeled in Fig. 3f,g, somatic mutations in several genes have been associated with response to different treatments. For example, presence of a mutation in either MUC16 (52) or LRP1B (53; 54) is directly associated with better response to immune checkpoint blockade. Such associations with treatment response make correct placement of subclonal mutations essential to suggest how immune checkpoint inhibitors should be combined with targeted therapies to target subclonal variations in disjoint subtrees (43). Several of the genes labeled in Fig. 3f,g have been shown to be associated with higher tumor mutational burden (TMB) including LRP1B, TP53, CSMD3, MUC16, RYR2, TTN, but not KRAS (55; 56). The associations with high TMB for RYR2 and TTN, which are not among the cancer related genes in COSMIC or OncoKB, serve as a reminder that these curated sources have very strict rules for which genes are classified as having a role in cancer, but including other genes in tumor phylogenetics analysis has value.

The quest to identify subtrees that have gained a ”mutator phenotype” (57) with a particular high rate of some types of mutations, such as microsatellite instability (58; 59), was one of the motivating problems for the field of tumor phylogenetics at its inception at the end of the 20th century (59). Therefore, the association with high TMB for certain mutated genes above is important to test assumptions about which subtrees have low or high mutation rates. The association with high TMB is also important clinically since higher TMB also predicts response to immune checkpoint inhibitors, as indicated by the pan-cancer FDA approval of immune checkpoint blockade to treat any cancer that has TMB greater than 10/Mbp. Correctly placing in clonal trees the (mutated) genes associated with higher TMB is also useful because the subtrees with these mutations at the root likely have a distinct, higher mutation rate (44). For these gene-specific and general reasons, the discrepant placement of the labeled genes such as MUC16, as compared to TP53, limits what can be robustly inferred from the clonal trees for some patients in the TRACERx NSCLC dataset. For those patients and samples for which CONIPHER and PairTree agree on the placement of these frequent mutations, more robust inferences about tumor progression can be made.

2.2. Application to SCS trees: B2905 preclinical melanoma model

We applied omlta to tumor progression trees inferred from three sequencing datasets of tumors derived from the B2905 cell line, a murine model of UV-induced, RAS-mutated human melanoma (9): (i) a bulk whole exome sequencing (bWES) dataset of 24 single cell derived sublines, (ii) a bulk whole transcriptome sequencing (bWTS) dataset of the same 24 sublines, and (iii) three single-cell whole transcriptome (scWTS) datasets described in (14). We discuss the omlta between trees derived from these datasets below.

Aligning trees for 24 single cell derived sublines individually sequenced using bulk methods

Our first set of experiments are on bulk sequencing datasets. As described in detail below, we (i) compare a pair of trees, each reconstructed using a distinct tree inference method applied to the the same bulk sequencing dataset, and also (ii) compare a pair of trees, each reconstructed by the same tree inference method, applied independently to two distinct datasets, which were both obtained from the same tumor.

The bWES dataset consists of 24 single-cell-derived sublines, each sequenced independently, featuring a total of 1689 mutations. Each of the 24 sublines was derived from an isolated single cell from the parental cell line and grown in vitro, and represents a genetically homogeneous cell population. As such, the 24 sublines represent an idealized, high coverage version of whole exome sequencing data from 24 single cells. Formally, the input genotype matrix representing the bWES dataset consists of 24 rows, each representing a single subline, and 1689 columns, each representing a mutation observed in one or more of the sublines. Each entry of the binary matrix indicates the absence or presence of a mutation in a subline.

We applied to the bWES dataset two computational methods for inferring trees from single-cell sequencing data: ScisTree (60) (see Fig. 4a for the tree inferred by ScisTree) and SCITE (19) (see Fig. 4b for the tree inferred by SCITE). While these methods are methodologically similar, they exhibit some key differences in their tree-scoring strategies and in the approaches they employ for exploring tree space. Neither ScisTree nor SCITE provides a theoretical guarantee of optimality within a specified time.

Figure 4:

Figure 4:

Comparison of trees reconstructed from bWES data consisting of 24 sublines and 1689 mutations by the use of a ScisTree (60) and b SCITE (19). Each non-root node (clone) is labeled by the number of mutations occurring for the first time at that node. When aligning these trees, omlta removes 29 mutation labels. Numbers shown in red next to the nodes indicate the number of mutations deleted from those nodes. c. The omlta tree between the trees shown in a and b. The green arrows point to the same mutational cluster across all trees.

The alignment between the trees inferred by ScisTree and SCITE on the same input dataset demonstrate high topological concordance in terms of mutational ordering, with only a few mutation label deletions (29 out of 1689). The main difference between the two trees is in the placement of matching nodes each with (the same set of) 69 mutations. In the tree shown in Fig. 4a, the 69 mutations are labels in the right child of the root, while in the tree shown in Fig. 4b, the 69 mutations are in the root’s left child’s subtree; these are indicated by green arrows). To maximize concordance, omlta removes those mutations that are on the path from the root to the node with these 69 mutations in the tree shown in Fig. 4b - although these mutations are concordantly placed in the two trees–enabling the retention of the larger set of 69 mutations in the alignment tree.

Next, we compared trees reconstructed using the same method on distinct sequencing datasets, each derived from the same parental cancer cell line. We conducted two experiments, differing in the sets of mutations used for tree inference, as explained below. The first sequencing dataset used in these experiments is the bWTS dataset, consisting of 11 sublines in which 536 mutations were detected. Each of these 11 sublines was also sequenced using bulk whole-exome sequencing; i.e., these 11 sublines are included in the bWES dataset described above. To allow for a direct comparison, we restricted the bWES dataset to the 11 sublines common to both bWTS and bWES datasets, obtaining the reduced-bWES dataset, consisting of 11 sublines and 1420 mutations.

In principle, the bWTS and reduced-bWES datasets differ technologically in sampling depth and sequencing noise, which may potentially result in discrepancies in the inferred ancestral relationships between mutation pairs across their respective trees. To demonstrate that our omlta algorithm can effectively reconcile trees derived from sequencing data collected by different wet lab methods, we conducted two experiments. The first experiment was on trees inferred using the restricted set of mutations common to both the BWTS and the reduced-bWES datasets. The second experiment was on trees inferred using the mutations observed in either dataset.

The set of mutations observed in both bWTS and reduced-bWES datasets contains only 92 mutations. Due to this reduced size, we were able to use a tree inference method with optimality guarantee, namely PhISCS (20), to build the trees. The omltd between the bWTS (Fig. 5a) and reduced-bWES (Fig. 5b) trees (both on 11 sublines and 92 common mutations) had a notably low value of 12, due to 6 mutation label deletions in each tree. The omlta tree (Fig. 5c) features the maximal set of concordant mutations across bWTS and reduced-bWES trees. If a pair of mutations are not ordered in one input tree, due to being labels of the same node, while the mutations appear in different nodes in the other input tree, then the order implied by the latter input tree is featured in the output alignment tree. As such, omlta can resolve the temporal ordering of each retained mutation pair assigned to the same node in exactly one input tree by using the mutation ordering in the other input tree, potentially producing an output tree with higher resolution than either input tree.

Figure 5:

Figure 5:

Comparison of clonal trees reconstructed by PhISCS (20) from (a) bWTS and (b) reduced-bWES data, each with 11 sublines, featuring a total of 92 mutations common to both datasets. Each non-root node (clone) is labeled by the number of mutations occurring for the first time at that node. When aligning these trees, omltd reports 6 mutation label deletions - numbers shown in red next to the nodes indicate the number of mutations deleted from those nodes. (c) The omlta alignment tree between the trees shown in a and b.

As a companion to the analysis of bulk sequencing melanoma trees built by PhISCS, we built trees with the complete set of mutations observed in either bWTS (11 sublines, 536 mutations) and reduced-bWES (11 sublines, 1420 mutations) datasets. Since tree inference methods with an optimality guarantee, such as PhISCS, can not handle 1420 mutations, we employed ScisTree for tree inference. The omlta alignment tree between the bWTS tree (Figure 6a) and the reduced-bWES tree (Figure 6b) is shown in Figure 6c. Focusing on the 92 mutations shared between the bWTS and reduced-bWES trees (as the other mutations are necessarily excluded from the alignment tree), we observe that only 6 of these 92 mutations are not included in the alignment tree–concordant with the alignment between the bWTS and reduced-bWES trees inferred on mutations common to both datasets (see Fig. 5).

Figure 6:

Figure 6:

Comparison of clonal trees reconstructed by ScisTree (60) on a bWTS (11 sublines and 536 mutations) and b reduced-bWES (11 sublines and 1420 mutations) data. Each non-root node (clone) is labeled by the number of mutations occurring for the first time at that node. In addition to the mutations present in only one of the two trees, when aligning these trees, omlta also reports 6 mutation label deletions in each of them - numbers shown in red next to the nodes indicate the number of mutations deleted from those nodes. c. The omlta alignment tree between the trees shown in a and b.

The comparisons of trees built with PhISCS and ScisTree demonstrate that the tree reconstructed from bulk transcriptome data closely resembles that of the tree inferred from the bulk exome data obtained from the same set of sublines. Notably, the omltd for PhISCS-built trees on mutations shared between the two datasets is equal to that for ScisTree-built trees on the complete set of mutations observed in each dataset. This demonstrates that ScisTree, a method with no optimality guarantees, produced results on a larger set of mutations that are comparable to those produced by an optimal tree reconstruction method, PhISCS, on a restricted set of mutations - providing a strong support for trees built by ScisTree on these datasets. In fact, the subtrees induced on the set of common mutation labels for the reduced-bWES trees built by PhISCS (Fig. 5b) and ScisTree (Fig. 6b) are isomorphic and the corresponding bWTS trees (Fig. 5a and Fig. 6a) have only two differently placed mutations (not shown).

Reconciling trees reconstructed from single-cell RNA sequencing datasets

We subsequently evaluated the trees built from single-cell datasets derived from the same parental cancer cell line. For that, we used two datasets from a preclinical study related to the impact of immunotherapy on intratumoral heterogeneity and subclonal evolution. Specifically, cells from the B2905 melanoma cell line were subcutaneously implanted into six syngeneic mice randomized to two groups corresponding to different treatment settings, mouse anti-CTLA-4 antibody treated (“Treated”, 4 mice) and mouse IgG2b as isotype, negative control (“Control”, 2 mice). Cells from each tumor were sequenced using the Smart-seq2 protocol (61) to generate single-cell, full-length transcript reads, resulting in our smartseq-treated and smartseq-control datasets comprising 508 and 163 cells, respectively. Application of omlta on these trees may offer insights into subclones and mutations they harbor which may have undergone immunoediting. In particular, if a node in the smartseq-control tree is missing from the smartseq-treated tree but its parent node is retained, then the subclone defined by that node may have been selectively eliminated by the immune system. Such a deletion points to a set of mutations which may induce neoantigens recognizable by the immune system.

We inferred clonal trees from these mutational profiles by the use of ScisTree (60)—for both the control and treated tumors; these trees are presented in Fig. 7a. Additional details related to clustering and parameters for tree inference are provided in Section A.5 of Supplementary Material. The topological differences between the true clonal trees for control and treated tumors would imply anti-CTLA-4 therapy induced immunoediting, as they correspond to the negative selection against subclonal mutations.

Figure 7: Tumor progression trees inferred by ScisTree on scRNA data from a preclinical study of anti-CTLA-4 immunotherapy for melanoma.

Figure 7:

a. Tumor progression trees inferred by ScisTree from smartseq-control data (“Control-tree”, left) and smartseq-treated data (“Treated-tree”, right). The clonal trees are labeled by the number of mutations that were inferred to have been acquired for the first time in the evolution of the tumor for each node/subclone. Based on shared mutations labeled at the root of each subtree, there are three major clades (B3, B4, and B5) that were previously identified in (14) and are colored accordingly. b. An optimal alignment between Control- and Treated-tree, “Alignment-tree”, as determined by computing omltd. The clonal tree is labeled by the number of common mutations with concordant placement between Control- and Treated-trees.

The resulting Control-tree was built on 24 clusters with 740 mutations, while the Treated-tree was built on 25 clusters with 1518 mutations; see Figure 7a. The number of mutations common to both trees was 583, among which 333 were deleted to obtain the omlta, i.e, the alignment tree obtained from these clonal trees featured 250 mutations, as presented in Figure 7b. Notably, the omlta exhibits a more “linear” topology than either clonal tree, primarily preserving a specific lineage from each of the three major subtrees (colored orange, purple and blue) observable in both the Control-tree and the Treated-tree. This indicates that, while the major clade structure is preserved between the Control-tree and the Treated-tree, the exact placements of mutations differ substantially. This is not surprising since clonal tree inference from these datasets is substantially more challenging than that from the bulk sequencing datasets not only because individual cells were sampled from highly heterogeneous tumors but also the read coverage on mutational loci was highly variable across cells.

In a final experiment, we compared tumor progression trees inferred exclusively from the control tumors, where each cell was sequenced using one of the two distinct single-cell RNA sequencing protocols: 163 single cells were sequenced using the Smart-seq2 protocol, forming our smartseq-control dataset. An additional 163 single cells were sequenced using the Seq-Well protocol (62) forming our seqwell-control dataset (see (14) for details). In Figure 8a, we present the trees we inferred for the two datasets, and in Figure 8b, we show their corresponding alignment tree. The omltd of these two trees and additional comparisons of trees reconstructed using different clustering criteria are provided in Tables 1 and 2.

Figure 8: Tumor progression trees inferred by ScisTree on scRNA data from control tumors sequenced by Seq-Well and Smart-seq2.

Figure 8:

a. Tumor progression trees inferred by ScisTree from seqwell-control data (“Seq-Well”, left) and smartseq-control data (“Smart-seq2”, right). The clonal trees are labeled by the number of mutations that were inferred to have been acquired for the first time in the evolution of the tumor for each node/subclone.

b. An optimal alignment between Seq-Well and Smart-seq2 tree, “Alignment tree”, as determined by performing omlta. The clonal tree is labeled by the number of common mutations with concordant placement between Seq-Well and Smart-seq2 trees.

Table 1:

Pairwise comparisons of clonal trees reconstructed by the use of ScisTree from control and treated tumors sequenced by Smart-seq2. The omltd/2 for each pair of trees is provided; specifically, this is the number of labels that are deleted from one of the two trees.

Clusters (S=n) Min. cells Control Treated Common Mutations omltd/2
per cluster mutations clusters mutations clusters

100 15 490 3 995 3 361 196
100 14 554 4 1122 4 426 248
100 13 554 4 1122 4 426 248
100 12 628 6 1304 6 505 306
100 11 699 9 1376 9 551 335
100 10 705 10 1393 10 554 338
100 9 720 15 1448 15 569 326
100 8 740 24 1518 25 583 333
100 7 741 30 1531 33 584 355
Table 2:

Pairwise comparisons of clonal trees reconstructed by the use of ScisTree from replicate control tumors sequenced by Smart-seq2 and Seq-Well protocols (min. cells per cluster is 1). The omltd/2 for each pair of trees is provided; specifically, this is the number of labels that are deleted from one of the two trees.

Clusters (S=n) Seq-Well Smart-seq2 Common Mutations omltd/2
mutations clusters mutations clusters

5 978 4 1025 5 978 136
6 983 5 1025 6 983 78
7 983 6 1025 7 983 72
8 983 6 1025 8 983 119
9 984 7 1025 8 984 311
10 994 8 1025 9 994 182
11 994 8 1025 10 994 365
12 994 9 1025 10 994 389
13 994 9 1025 11 994 395
14 995 10 1025 10 995 395
15 995 10 1025 12 995 430
16 995 11 1025 12 995 476
17 1000 12 1025 13 1000 501
18 1001 13 1025 14 1001 523
19 1001 13 1025 14 1001 606
20 1001 14 1025 16 1001 533

A key difference between the trees obtained for single-cell sequencing data and those obtained for single-cell-derived subline bulk sequencing data is that omltd values for the former are much higher; up to two-thirds of the mutation labels shared between the aligned trees may need to be deleted. This is partially because of sampling variability. While the single-cell-derived sublines are fixed (with each subline being well-represented in its respective bulk sequencing dataset), each single-cell dataset is comprised of distinct cells possibly representing distinct cell populations with many distinct mutations. Data sparsity plays a role as well, with many mutational loci not covered by even a single read in certain cells. In addition, pre-clustering of cells could add noise to tree inference process.

Despite these challenges, the omlta alignment between the single-cell trees retains a substantial number of mutations, reflecting that single-cell trees can provide reliable information about the temporal ordering of mutations and the branching patterns leading to distinct cell lineages. The lineages preserved in the omlta tree can be robustly leveraged in downstream analyses, such as integrating mutation profiles with gene expression data in single cells to identify potential associations. Perhaps more importantly, these experiments demonstrate that our omlta algorithm remains practical and effective even in the presence of extensive mutation label deletions in large single-cell trees, highlighting its practical utility.

3. Discussion

Robust tumor phylogeny inference remains fundamentally constrained by the limitations of current sequencing technologies and analytic approaches. Regarding sequencing technology, multi-sample bulk data often lack the resolution needed to unambiguously place key mutations, while single-cell sequencing suffers from substantial sparsity and technical noise that impede confident reconstruction of clonal relationships. Regarding analytical methods, there are different software methods for inferring clonal trees and mutation trees. Moreover, different parameter settings within the same method can yield markedly different trees from the very same dataset.

One premise of this work is that the variation in tree inference methods can be viewed as an opportunity rather than as a limitation. If the trees produced by two tree inference methods can be robustly compared by a neutral third method, then one can identify the substructures shared by the two inferred trees. To address the need for a tree comparison method, we introduced the notion of optimal tree alignment, omlta, for clonal trees of tumor progression and developed an efficient algorithm for computing an optimal alignment. Our method for computing optimal alignments naturally produces the integer distance between the two trees, omltd, which is the sum of the numbers of node label deletions that must be applied in each tree to make the resulting derived trees isomorphic. The omltd is unique, but there may be multiple optimal alignments, as illustrated below in Figure 9.

Figure 9:

Figure 9:

a. A star tree and a single node tree, which have an omltd distance of 4 between them. b. Some possible expansions of a single node tree with label set a, b, c.

Although we showed that computing omlta is formally intractable (NP-complete), we were able to compute omlta in practical runtimes for all input instances tested, including instances with more than 1000 mutations. Thus, the NP-completeness does not represent a practical limitation. However, one practical limitation of our methods and results is that omlta compares exactly two trees at a time. Since there are more than two methods for inferring clonal trees and these methods have parameter settings that can be varied to produce different clonal trees, it may be desirable to compare more than two trees simultaneously. Just as pairwise tree alignment corresponds to pairwise sequence alignment, the problem of comparing more than two trees corresponds to multiple sequence alignment, which is a widely studied problem with widely used methods that offer a mixture of formal optimization criteria and heuristics (63; 64; 65).

In conclusion, applying our framework to clonal trees inferred from both multi-sample bulk and single-cell sequencing data, we demonstrated utility of omlta in revealing robust evolutionary features and consistent mutational placements across pairs of methods and data types, thereby enabling more reliable downstream analyses. The use of omlta should lead to more rigorous use of clonal trees in cancer genomics. Our omlta framework will also provide an impetus to develop new methods for tree inference because it is now possible to compare more rigorously a new method to existing methods, as we compared CONIPHER to PairTree.

4. Methods

4.1. Preliminaries

In this paper, we consider rooted, unordered trees T=(V,E) with node set V, edge set E, and a specified root node denoted r(T). For two nodes u and v,u≠v, such that u lies on the path from r to v, we say that u is an ancestor of v and that v is a descendant of u. A node v∈V is a child of u∈V if v is a descendant of u and (u,v)∈E. For a node u∈V,child(u) denotes the set of children of u. For shorthand, v∈T is used with the same meaning as in v∈V, and |T| is used to denote the number of nodes in T (i.e., |T|=|V|). Given two nodes u,v∈T, P(u,v) denotes the set of nodes on the path from u to v in T, including u and v. We denote the subtree rooted at v∈T as T(v). A forest ℱ is a collection of node-disjoint trees T1,T2,…,Tℓ. For any Ti∈ℱ, ℱ\Ti denotes the forest ℱ excluding Ti. The generalization of the problem to forests is needed because during our recursive algorithm single trees may be transformed into multiple trees via deletions of nodes and edges.

The nodes in our trees have labels from an alphabet Σ, which includes the mutations observed in the sample and to be assigned to nodes in the tree. Each node may have multiple labels (representing mutations), which are treated for computation purposes as an unordered set, but each label appears at most once in a tree. We let λ:V→2Σ represent a label function such that λ(v) is the label set of node v. Given a set of nodes X, we define λ(X) to be the set of all labels present in nodes in X, that is λ(X)=⋃v∈Xλ(v). For a tree T=(V,E), we may refer to λ(v) as λ(T).

Definition 1.

A multi-label tree T=(V,E,λ) with nodes V, edges E, and label function λ:V→2Σ is an unordered tree in which for all v∈V, |λ(v)|≥1, except the root which may have no label. Furthermore, for all vi,vj∈V with i≠j, label sets λvi and λvj are disjoint. A multi-label forest ℱ=T1,T2,…,Tℓ is a collection of multi-label trees such that for any Ti,Tj∈ℱ with i≠j, label sets λTi and λTj are disjoint.

Definition 2.

An edit operation for the multi-label tree edit distance problem is defined as one of the following tree operations:

  • Label Deletion: Delete a label a∈λ(v) for a node v∈V. We denote this label deletion by del(v,a). For a set of labels A⊆λ(v), let del(v,A) denote deletion from λ(v) of all labels that belong to A, i.e., if we start with B=λ(v), then after del(v,A) is applied, we have λ(v)=B\A.

  • Node Deletion: Delete a node v∈V and, if v is not the root of T, make all nodes in child (v) children of u, where u denotes the parent of v. If v is the root of T, then all nodes w∈child(v) become roots of their own distinct trees T(w) and this transforms a single tree into a forest. The node deletion operation can be applied only to empty nodes. We denote this operation as del(v).

  • Expansion: For a node v with |λ(v)|>1 and some A⊆λ(v), add a new node u to V, set λ(v)←λ(v)\A and λ(u)←A. If v was a non-root node with parent w, we set E←E∪{(w,u),(u,v)}\(w,v). Otherwise, u becomes the new root of T and we set E←E∪{(u,v)}. We denote such an expansion as expand(v,A).

Given a forest ℱ with a node v, we use ℱ\v to denote the forest ℱ after performing del(v). Similarly, given a forest ℱ and a subset A of labels present in ℱ, we use ℱ\A to denote the forest ℱ after performing delva,a for all a∈A, where va is the node in ℱ such that a∈λva.

The edit distance between two trees is the cost of a minimum-cost sequence of edits, where an edit may be performed on either tree, that transforms both trees into the same tree, the alignment tree. With this in mind, we must assign costs to each edit. In this work, we are interested in finding the number (and the set) of labels that must be deleted in both trees; therefore, we set the cost of label deletion to 1 and the cost of empty-label node deletion and node expansion to 0, i.e., these are free operations. Since empty-label node deletion and node expansion are 0-cost operations, we say two forests are “equal” or “the same” when referring to two forests that could be transformed into equal forests after a sequence of only empty-label node deletions and node expansion. We make the distinction between forests that are exactly equal and forests that are equal after additional node expansions and empty-label node deletions when it is relevant to do so.

We can now formally define:

Problem 1.

Given two multi-label forests ℱ1, ℱ2, the optimal multi-label tree edit alignment (omlta) asks to find a minimum-cost sequence of label deletions, node deletions, and expansions needed to transform ℱ1 and ℱ2 into equal forests, and optimal multi-label tree edit distance (omltd) of ℱ1, ℱ2, denoted as omltdℱ1,ℱ2, is the cost of this edit sequence.

For the application of our omlta algorithm to real data, we are only interested in finding omlta for trees. However, we define the edit distance problem on forests because the intermediate states when edits are applied in sequence can include multi-tree forests and hence, forests are needed in the proof of correctness and in the formal analysis of asymptotic runtime. When given two trees as input, the minimum-cost edit sequence obtained by our algorithm, which we give in the following subsection, yields the same output tree (not a forest) derived by edits applied to one input tree or the other, and we refer to this common output tree as the alignment tree.

Before discussing the algorithm, we give a small insight into the limitations of the node expansion operation. It may seem that allowing node expansions at no cost may trivialize our distance computation and potentially allow any two trees to be matched without any label deletions needed. As a simple example contradicting this idea, consider two trees, a star and a single node, as in Figure 9a. Following the above definition, expansion can never create a node with degree greater than 1. Therefore, using expansion on a single node can only create various chain topologies with the mutation labels in various orders but can never create a star. Figure 9b shows some example expansions, and we may observe that one of the only notable changes in any expansion of the single node labeled a,b,c is the order of labels in the expanded trees. In all cases, the minimum number of labels that need to be deleted to transform the star and single node into the same tree is 4 (2 from each input tree). Essentially, omltd does not penalize long paths of nodes with degree 1 by allowing free node expansions, but does penalize actual topological differences in branching and mutation label ordering, which is precisely what we aim to measure with this distance.

4.2. An O(2L/2⋅L2)-time recursive algorithm for omlta

In this section, we present a simplified recursive formula to help compute omlta/omltd in 𝒪(2L2⋅L2)-time where L is the number of mutations occurring in the two input trees (counting mutations in both trees as 1). The recursive formula identifies the minimum number of label deletions needed to induce two isomorphic trees up to node deletions and expansions. It is also constructed to handle forests as input since the recursive computation sometimes requires solving smaller subproblems in which the intermediate structure may be a forest of more than one tree. We denote the function to be computed as omltdℱ1,ℱ2 where ℱ1, ℱ2 can be trees or forests. Given two trees T1, T2,omltdT1,T2 finds the minimum number of label deletions that can be used to recover the alignment tree, solving both omltd and omlta simultaneously. After discussing runtime and correctness of our given recursive solution, we show in Supplementary Section 4.4 how to improve the exponent in the asymptotic running time to be linear in k rather than linear in L, where k=omltdℱ1,ℱ2. Our improved algorithm and runtime analysis require knowing an upper bound B=𝒪(k) on omltdℱ1,ℱ2 in advance, and so we run our algorithm with every possible value, 1, 2, 3,…, stopping when we reach k, and show that this search loop does not affect the runtime asymptotically.

Given two forests ℱ1 and ℱ2, the core idea of our algorithm is a recursive approach in which we iteratively target a single mutation label in the root of any tree of ℱ1 and find the node with its matching label in ℱ2 (if one exists). The algorithm then proceeds either to match or to delete this pair of nodes. In either case, the algorithm proceeds recursively on the remaining set of labels after removing the current considered label from both forests. If all the labels of a root node v of any tree in ℱ1 have been deleted by the algorithm or v is matched, then v is removed from ℱ1 for the remainder of the algorithm and the subtrees of the children of v are added into ℱ1 so that their labels may be matched or deleted next. By considering each label one at a time, all labels will eventually be matched or deleted while guaranteeing that the resulting forests after all deletions are equal as required by the formalized Problem 1. The algorithm finds exactly the sequence of matches and deletions that minimizes the number of label deletions needed to reach the alignment tree.

The main challenge is how to determine whether each label should be matched or deleted. For any tree T in ℱ1 that has no corresponding label-isomorphic tree in ℱ2, for each label in r(T), the algorithm will try both options, deleting and matching. Since there are L labels, we need to explore both options at most L times, which suggests a factor of 2L in the runtime; actually, since the choice of whether to match or to delete arises only when the label occurs once in each forest, formal analysis in Section 4.3 shows that the exponential term can be reduced to 2L2. To improve the dependency further from L to k, we rely on the fact that the number of label deletions is bounded by some positive integer k≥omltdℱ1,ℱ2, and therefore, we argue that we only have to explore both choices at most k times, otherwise the distance must be larger than k.

Figure 11 shows an example of the basic approach of our algorithm. We compute omltd by iteratively matching or deleting each mutation label in the input trees. A root-to-leaf traversal of one of the input trees, chosen arbitrarily from the two, determines the order in which we consider mutation labels. In a preliminary step, we do a linear traversal of the trees and delete any mutation labels not present in both trees. In our example figure, there is one such label m6 only present in T2, which is deleted immediately. Then we begin our iterative approach to handle remaining mutation labels shared between the input trees. As mentioned, we start at the root of T1. First, the algorithm handles m0. Any mutation contained in the root of both trees may be preserved at no cost via a node expansion. Thus, m0 is matched between the two trees in the omlta and will remain in the final alignment tree. Next, m1, the other label in the root of T1 is considered. m1 is in a lower level of T2 and therefore matching m1 and retaining this label in the alignment tree requires some edits. The omltd computation therefore breaks into two alternative cases. In one alternative case, the algorithm tries to maintain m1 in both trees. As shown in the figure, maintaining m1 requires deleting the path of nodes above m1 from the current root of T2 and then also deleting the new hanging subtree of m5, since it will not have an isomorphic match in T1 if m1 is preserved. In the resulting trees, a node expansion can be made in each tree to place m1 in its own node to be retained in the resulting alignment tree. In the other alternative case, m1 is deleted in both trees. In either case, after handling m1, the algorithm recurses and continues iterating on the remaining trees. Whichever path leads to a lower number of total mutation label deletions is then chosen as the solution path and the alignment tree from that path is outputted. In the figure example, intuitively, deleting m1 is most likely the correct choice since it only requires 2 immediate deletions whereas matching m1 requires 86 immediate deletions.

Figure 11.

Figure 11

Before giving our recurrence for computing omlta/omltd, we define a useful function that is used in the final case of the recurrence. Given a forest ℱ and node v in tree T∈ℱ, let R(ℱ,v) denote the forest ℱ after deleting all nodes of P(v,r(T)) (recall that P(v,r(T)) is the path in T from root r(T) to node v, including the endpoints) from ℱ and adding the subtree of any child node c∉P(r(t),v) of a deleted node p∈P(r(t),v)\{v}. See Figure 10 for an example.

Figure 10:

Figure 10:

Left panel: A forest ℱ (in this example just a tree) with root r and node v. Right panel: Tree T(v) and forest R(ℱ,v) obtained from ℱ by deleting all nodes on the path from r to v and adding to ℱ the subtrees of any children node c∉P(r,v) whose parent p∈P(r,v)\{v} has been deleted.

We consider one mutation at a time. Let v1 be the root of a tree T1 in ℱ1. Let b be a label in v1. Recall that empty-labeled node deletions have no cost towards omltd, so we may delete empty-labeled nodes for free. Additionally, if a root node of an input tree of ℱ1 (or ℱ2) has no labels, we may similarly delete that empty node before applying the recursive algorithm to ensure that all root nodes contain at least one label.

Let u2 be the node in tree T2∈ℱ2 with b∈λu2 if it exists. If u2 exists, let v2 be the node in the path from rT2 to u2, inclusive, that is closest to rT2 and shares some label with v1, i.e., λv1∩λv2≠∅. Set a to be any mutation in λv1∩λv2 or just b if no matching label for b was found in ℱ2. While not written in formula 1, we assume that when the last label of a node is deleted at any step, the now empty-labeled node is deleted as well. We define the following recursive formula for omltdℱ1,ℱ2 :

λℱ2ifℱ1=∅omltdℱ1\{a},ℱ2+1ifa∉λℱ2minomltdT1\{a},T2v2\{a}+omltdℱ1\T1,Rℱ2,v2+λPv2,rT2−λv2,omltdℱ1\{a},ℱ2\{a}+2otherwise. (1)

The above recurrence helps us compute omltd and find which labels need to be deleted for omlta. The three above cases handle all possibilities for label a. In the first case, if there are no labels in ℱ1 at all, then ℱ2 must be deleted to match and so we compute the cost of deleting all labels in ℱ2. In the second case, label a is present in ℱ1 but not in ℱ2. Since none of the edit operations insert a label into the label set of a node, all edit sequences must delete a and so we add 1 to the distance and remove a from consideration moving forward. In the final case, we try both matching the nodes of ℱ1 and ℱ2 containing a, as well as deleting a from both forests, and we compute and return the minimum cost edit sequence between these two cases. Since a is a label of the root of T1, when trying to match the nodes corresponding to a, it is important we delete all nodes above v2 so that a is also a label of T2. This is why we split ℱ2 into T2v2 and Rℱ2,v2. Also one crucial detail of our setup is that by choosing v2 to be the highest node in T2 that shares a label with v1, we can guarantee that during the process of deleting nodes above v2, we do not accidentally delete a label that we could have kept via a node expansion on v1. Since v1 shares no labels with the deleted nodes, we know that it cannot expand to match to any of these soon-to-be-deleted nodes, and we are sure not to delete too many labels in this case.

As mentioned in the previous subsection, by tracing the path which minimizes label deletions through the recursion tree for Equation 1, we may recover the exact minimum cost edit sequence found by omltdT1,T2 for two input trees T1 and T2, which when applied to the input trees yields the common alignment tree for omlta in an additional 𝒪(k) time.

Equation 1 thus provides the starting point and the core structure for our 𝒪(2k2⋅L3logL)-time algorithm for omlta. We prove that Equation 1 correctly computes omltd (ℱ1,ℱ2) and that it can be computed in time 𝒪(2L2⋅L2), where L=λℱ1+λℱ2 in Section 4.3. Additional details on how we modify and improve this approach for our final result can be found in Section 4.4. We also provide the proof that computing omltd is an NP-hard problem in Section A.3.

4.3. Proof of correctness and analysis of asymptotic runtime for the algorithm in Section 4.2

The minimum cost sequence of edits for two forests is typically not unique, since there are often many orderings of the edits that will produce the same transformations. With this in mind, we give a useful observation for computing the omlta/omltd between two forests in which we have some prior knowledge that a pair of trees, one from each forest, are going to be transformed into the same tree after an optimal sequence of edits. Instead of finding the cost of an optimal edit sequence on the entire forest, we can instead find a minimum-cost sequence of edits on just the trees separately from the rest of the forest and then sum up the computed distances for the pair of trees and the remaining forests. We have implicitly used this idea when building the third case of Equation 1, and now we provide a formal proof of it.

Observation 1.

Given forests ℱ1=T11,T21,…,Tα1, ℱ2=T12,T22,…,Tβ2 and a minimum-cost edit sequence S transforming ℱ1 and ℱ2 into the same forest, if Ti1 and Tj2 are transformed into the same forest by S for any i∈[1,α], j∈[1,β], then omltdℱ1,ℱ2=omltdTi1,Tj2+omltdℱ1\Ti1,ℱ2\Tj2.

Proof.

Consider a minimum cost edit sequence S that transforms ℱ1 and ℱ2 into the same forest such that Ti1 and Tj2 are transformed into the same forest by S. Let c(S) denote the cost, i.e., the number of label deletions, in S. Let ST be the subsequence of S that transforms Ti1 and Tj2 into the same forest, and let SR be the remaining edits (which transform ℱ1\Ti1 and ℱ2\Tj2 into the same forest). As ST is a valid edit sequence, omltd Ti1,Tj2≤cST. Similarly, omltdℱ1\Ti1,ℱ2\Tj2≤cSR. Thus,

omltdTi1,Tj2+omltdℱ1\Ti1,ℱ2\Tj2≤cST+cSR=c(S)=omltdℱ1,ℱ2.

Now for contradiction, assume there is a minimum cost edit sequence ST′ such that ST′<ST and ST′ transforms Ti1 and Tj2 into the same forest. Then ST′, SR form a valid edit sequence transforming ℱ1 and ℱ2 into the same forest with cST′+cSR<c(S), which contradicts S being a minimum cost edit sequence. Therefore, no such cST′ can exist and so omltdTi1,Tj2=cST by contradiction. By a similar argument, omltdℱ1\Ti1,F2\Tj2=cSR, and therefore, omltdℱ1,ℱ2=cST+cSR=omltdTi1,Tj2+omltdℱ1\Ti1,ℱ2\Tj2.

We make one more useful observation that if two root nodes, one from each forest ℱ1 and ℱ2, share a label, we can expand the root nodes with this shared label and then compute the rest of the edit distance on the remaining labels in the trees.

Observation 2.

Given trees T1, T2 and label a∈λrT1∩λrT2, then omltdT1,T2=omltdT1\{a},T2\{a})

Proof.

Consider trees T1′ and T2′ that are the result of performing expansions expand rT1,{a} and expand rT2,{a}. Any minimum cost edit sequence on T1\{a} and T2\{a} will be a minimum cost edit sequence on T1′ and T2′ and vise versa. Furthermore, since node expansions are a 0-cost operation, we have that omltdT1,T2=omltdT1′,T2′=T1\{a},T2\{a}.

Claim 1.

Given two multi-label forests ℱ1, ℱ2, Equation 1 correctly computes omtdℱ1,ℱ2.

Proof.

To compute omldtℱ1,ℱ2, recall that by the formalization of Problem 1, we can find a minimum-cost sequence of label deletions, node deletions, and node expansions that transforms ℱ1 and ℱ2 into equal forests where the cost of an edit sequence is the number of label deletions performed.

In the first case of Equation 1, when ℱ1 is empty, since no allowed edit operations can add any nodes to ℱ1, any optimal edit sequence must delete all nodes of ℱ2 as well so that both forests are empty after all edits. The number of deleted labels will therefore be λℱ2, matching the first case of Equation 1.

In the second case, when a mutation label a is in ℱ1 but not in ℱ2, again no allowed edit operations can add a to ℱ2, so any optimal edit sequence must delete a. We may therefore compute omltd ℱ1\{a},ℱ2, the distance between ℱ1 without mutation a and ℱ2, and then add 1 for the deletion of a.

In the third case, when mutation label a is present in both ℱ1 and ℱ2, we compute the cost of two possible edit sequences and return the minimum of them. Since all labels only appear once per forest by Definition 1, either both appearances of a must be kept in the final versions of ℱ1 and ℱ2 after all edits or both appearances of a are deleted. If both are deleted, this adds 2 to the final cost. It is easy to see that any minimum-cost edit sequence transforming ℱ1\{a} and ℱ2\{a} into equal forests will be a minimum-cost edit sequence for ℱ1, ℱ2 with two extra label deletions to delete the copies of a. The final cost of such an edit sequence is omltd ℱ1\{a},ℱ2\{a}+2, which matches the second parameter of the min function in the third case of Equation 1.

If instead both copies of a remain in ℱ1, ℱ2, note that since v1 is the root of T1∈ℱ1 and v2 is the highest node in T2 sharing a label with v1, then all labels in an ancestor of v2 must be deleted in any edit sequence. It may be the case that a minimum-cost edit sequence does not delete the ancestor nodes of v2 even though they have empty labels, but since node deletions do not contribute to the distance, any such minimum-cost edit sequence may be modified to delete all ancestor nodes of v2 and the empty-labeled nodes in ℱ1 that matched them with no additional cost. Performing these deletions transforms ℱ2 into T2v2∪Rℱ2,v2. Furthermore, any optimal edit sequence preserving the a labels in v1 and v2 must transform T2v2 and T1 into the same tree. With the above assumption, by Observation 1, we know that

omltdℱ1,T2v2∪Rℱ2,v2=omltdT1,T2v2+omltdℱ1\T1,Rℱ2,v2. (2)

The cost of deleting all ancestors of v2 is exactly the cost of deleting all labels on the path from rT2 to v2 excluding v2, i.e., λPrT2,v2−λv2. Combining this cost with Equality 2 when mutation a is preserved by a minimum-cost sequence of edits transforming ℱ1 and ℱ2 into the same forest yields

omltdℱ1,ℱ2=omltdℱ1,T2v2∪Rℱ2,v2+λPrT2,v2−λv2=omltdT1,T2v2+omltdℱ1\T1,Rℱ2+λPrT2,v2−λv2.

This almost matches the first parameter of the min function in the third case of Equation 1, except that there instead of omltdT1,T2v2 we have omltdT1\{a},T2v2\{a}. However, note that v1 and v2 are both root nodes in T1 and T2v2, respectively, so by Observation 2, omltdT1,T2v2=omltdT1\{a},T2v2\{a}. Thus, we correctly compute both the cost of an edit sequence preserving label a in both forests and an edit sequence deleting label a, and we set the distance to be the minimum of the two in the third case of Equation 1.

Claim 2.

Given two multi-label forests ℱ1, ℱ2, omltdℱ1,ℱ2 can be computed in time 𝒪(2L2⋅L2), where L=λℱ1+λℱ2.

Proof of Claim 2.

By Claim 1, we know an algorithm utilizing Equation 1 will correctly compute omltd ℱ1,ℱ2. We now analyze the runtime complexity of such an algorithm using induction on the number of labels L in ℱ1 and ℱ2. Our base case occurs when ℱ1 contains no more labels, which is the first case of Equation 1. In this case, there is no recursion and computing λℱ2 can be done via a simple traversal through ℱ2 to count each label, which will take time L≤L22L2.

Now, we define our induction hypothesis to be that omltd ℱ1,ℱ2 takes time 2i22i2 to compute for all forests ℱ1, ℱ2 with λℱ1+λℱ2=i<L. Now, consider forests ℱ1, ℱ2 such that λℱ1+λℱ2=L. In the second and third cases of Equation 2, we must search through ℱ2 to find label a if it exists. This can be done again with a simple linear-time search through ℱ2 in time L. In the second case, a is not present in ℱ2 and we have a recursive call on omltd ℱ1\{a},ℱ2. Deleting a from the label of node v can be done in at most L time. By the induction hypothesis, the recursive call resolves in time 2(L−1)22L−12, so the total time will be

2L+2(L−1)22L−12=2L22L−12+(2L−4L2L−12+2⋅2L−12)≤2L22L−12≤2L22L2

In the third case of Equation 1, we must construct Rℱ2,v2 and remove a from ℱ1 and ℱ2. This can be done in at most 2L steps by deleting all labels one at a time in λPr,v2 excluding the labels of v2 itself, and when a node has its last label deleted, we delete the node itself as well. Finally, there are 3 recursive calls to omltd. By the inductive hypothesis, omltdT1\{a},T2v2\{a} takes time at most 2λT1+λT2v2−222L−22 and omltd ℱ1\T1,Rℱ2,v2 takes time at most 2λF1\T1+λRℱ2,v222L−22. Note that λℱ1\T1+λT1=λℱ1 and λRℱ2,v2+λT2v2≤λℱ2, so together these recursive calls take time

2λT1+λT2v2−222L−22+2λF1\T1+λRℱ2,v222L−22≤2λℱ1+∣λℱ2∣−222L−22=2(L−2)22L−22

As for the last recursive call omltdℱ1\{a},ℱ2\{a}, by the induction hypothesis this takes time 2(L−2)22L−22. In total, for the third case we have time

3L+2(L−2)22L−22+2(L−2)22L−22=3L+2(L−2)22L2≤2L22L2+(3L−8L2L2+8⋅2L2)≤2L22L2

where the last inequality is true for L≥2, which must be satisfied in the third case of Equation 1 since both ℱ1 and ℱ2 contain (a copy of) the label a.

Therefore, both recursive cases of Equation 2 are done in time 2L2⋅2L2 and so, by induction, the entire computation of omltdℱ1,ℱ2 can be done in time 𝒪(2L2⋅L2).

4.4. An asymptotically faster 𝒪(2k/2⋅L3logL)-time algorithm for computing omlta/omltd

In this section, we show how to compute omlta/omltd utilizing an improvement to the recursive algorithm defined by Equation 1 such that the runtime depends on k, the optimal edit distance between the two input forests. We start by giving the new recursive definition, which takes an additional parameter ku, that can be viewed as an upper bound on k that we use to bound the runtime of the recursive computation.

We define the same set of variables as for Equation 1. We let v1 be the root of any tree T1∈ℱ1, and let b∈λv1. Let u be the node in tree T2∈ℱ2 with b∈λ(u), if it exists. If such a u exists, let v2 denote the node in the path from rT2 to u, inclusive, that is closest to rT2 and shares some label with v1, i.e., λv1∩λv2≠∅. Set a to be any mutation in λv1∩λv2 or just b if no matching label for b was found in ℱ2. We assume implicitly that when the last label of a node is deleted at any step, the now empty-labeled node is deleted as well.

There are two new variables we must define. Let dT=minomltdT1,T2v2+λPv2,rT2−λv2,2 and dℱ=minomltdℱ1\T1,ℱ2\T2+λPv2,rT2−λv2,2. dT and dℱ variables correspond to the omltd between pairs T1,T2v2 and ℱ1\T1,Rℱ2,v2, respectively. When these distances are either 0 or 1, the trees and forests are almost exactly matching already and we do not want to make any substantial edits on them. We add two corresponding cases for when either of these distances is small. While computing tree edit distance is NP-hard, checking if two forests are exactly matching (or off by 1 label) can be done in polynomial time dependent on the total number of labels in the forest, and so computing dT and dℱ does not increase our asymptotic runtime too much.

omltdℱ1,ℱ2,ku=∞ifku≤0,omltdℱ1,ℱ2>00ifku≤0,omltdℱ1,ℱ2=0λℱ2ifℱ1=∅omltdℱ1\{a},ℱ2,ku−1+1ifa∉λℱ2omltdℱ1\T1,Rℱ2,v2,ku−dT+dTifdT≤1omltdT1,T2v2,ku−dℱ+dℱifdℱ≤1minomltdT1\{a},T2v2\{a},ku−2+omltdℱ1\T1,Rℱ2,v2,ku−2+λPv2,rT2−λv2,omltdℱ1\{a},ℱ2\{a},ku−2+2otherwise. (3)

The following two lemmas help prove the correctness of the new fifth and sixth cases in Equation 3. After that, we provide a polynomial-time algorithm for checking if the distance between two forests is at most 1 to show that these cases can be evaluated quickly.

Lemma 1.

Given multi-label forests ℱ1, ℱ2 with trees T1∈ℱ1, T2∈ℱ2 and a∈λrT1∩λrT2. Let ℱ1′=ℱ1\T1, ℱ2′=ℱ2\T2. If d=omltdT1,T2≤1, then omltdℱ1,ℱ2=omltdℱ1′,ℱ2′+d. If d′=omltdℱ1′,ℱ2′≤1, then omltdℱ1,ℱ2=omltdT1,T2+d′.

Proof.

If d or d′ are 0, then the lemma statement follows directly from Observation 1.

Consider when d=omltdT1,T2=1. In this case, an optimal edit sequence between T1 and T2 must delete a single label b present in exactly one of T1 or T2. Without loss of generality let b∈T2. Now consider a minimum cost edit sequence S between ℱ1 and ℱ2, i.e., a sequence that minimizes the number of label deletions needed to make these two forests equal. If S deletes b, then T1 and T2 already match. Thus, S performs no more label deletions on nodes in T1 and T2 and by Observation 1, omltd ℱ1,ℱ2=omltdℱ1′,ℱ2′+omltdT1,T2=omltdℱ1′,ℱ2′+1. If instead S does not delete b, then to match the nodes with label b in ℱ1 and ℱ2 together, the roots of T2 and T1 can no longer be matched since b is in T2 but not T1. Since a is in the root of ℱ1 and ℱ2, label a must be deleted since these roots are no longer matched together. Since there are two copies of a, S must have two label deletions corresponding to deletions of a. We may consider a new edit sequence obtaining by modifying S to delete both copies of b instead and then match T1 and T2, which match perfectly after deletion of b, and note that the new sequence has the same number of label deletions as S. Therefore, any minimum cost edit sequence can be modified to delete b, match T1 and T2 and so, omltdℱ1,ℱ2=omltdℱ1′,ℱ2′+1.

If omltdℱ1′,ℱ2′=1, then there must be a label b present in exactly one of ℱ1′ or ℱ2′. Without loss of generality let b∈ℱ2′. Consider a minimum cost edit sequence S between ℱ1 and ℱ2. If S deletes b, then by Observation 1, omltdℱ1,ℱ2=omltdT1,T2+1. If instead S does not delete b, then its copy must be in T1. Similarly to the previous case above, since a is in the root of T1, it must be deleted by S in order for the nodes labeled with b to match. We consider a new edit sequence obtained by modifying S to delete both copies of b instead of both copies of a and by Observation 2, since a labels the root of both T1 and T2, the modified edit sequence of S still transforms ℱ1 and ℱ2 into the same forests and requires no additional label deletions. Therefore, any optimal edit sequence can be modified to delete b and subsequently match ℱ1′ and ℱ2′; therefore, omltdℱ1,ℱ2=omltdℱ1′,ℱ2′+1.

Lemma 2.

Given multi-label forests ℱ1, ℱ2 with trees T1∈ℱ1, T2∈ℱ2 and a node v∈T2 such that

  • v∈childrT2,

  • there exists a label a∈λrT1∩λ(v),

  • λrT2=1.

  • λrT1∩λrT2=∅

If omltdT1,T2(v)=0, then omldℱ1,ℱ2=omltdℱ1\T1,Rℱ2,v+1. If omltdℱ1\T1,Rℱ2,v=0, then omltdℱ1,ℱ2=omltdT1,T2(v)+1.

Proof.

Since λrT2=1, there is only a single label on rT2. Let b denote this label. Let S be a minimum cost edit sequence of ℱ1 and ℱ2.

If S deletes b, then it can be modified to delete rT2 for no cost since empty label deletions are not counted towards omltd. If omltd T1,T2(v)=0, then S does not have to make any further edits to T1 and T2 and so by Observation 1, mltdℱ1,ℱ2=omltdℱ1\T1,Rℱ2,v+omltdT1,T2(v)+1=omltdℱ1\T1,Rℱ2,v+1. By a symmetric argument, if omltdℱ1\T1,Rℱ2,v=0, omltdℱ1,ℱ2=omltdT1,T2(v)+1.

If S does not delete b, we claim that S must delete label a. Note that a∈λrT1 and b is the only label of rT2, which is not included in λrT1 since λrT1∩λrT2=∅. Furthermore, a is in the label set of v, a child of rT2. The only way for a to remain in the forests is if rT2 is deleted and v becomes a root node of its own subtree, but note that deleting rT2 would require deleting label b. By our assumption, rT2 must not be deleted since b is not deleted. Therefore, a must be deleted. Since there are 2 label deletions for a, we may modify S to instead match a together and delete both copies of b for the same cost. By Observation 2, after deleting b, we know that the modified edit sequence of S still transforms ℱ1, ℱ2 into equal forests and no further label deletions need to be added to S. Therefore, all edit sequences can be modified to delete b instead of a. Thus, if omltd T1,T2(v)=0 or omltd ℱ1\T1,Rℱ2,v=0, the lemma statement holds by Observation 1.

Lemma 3.

Given multi-label forests ℱ1, ℱ2, minomtdℱ1,ℱ2,2 can be determined in 𝒪L2logL time where L=λℱ1+λℱ2.

Proof.

We now describe an algorithm that computes minomltdℱ1,ℱ2,2.

First, we check if the label sets of ℱ1 and ℱ2 differ by at most 1 label. If they differ by more than 1 label, we may return 2 immediately. If they differ by a single label, we may delete the label. This can be done in 𝒪(L)-time. For the remaining labels present in both forests, if any label a in ℱ1 must be deleted, label a must also be in ℱ2 since by definition, there is only one copy of each label per multi-label forest. Therefore, if a label shared in both forests is deleted, then omltd ℱ1,F2≥2. Thus, we can check if ℱ1 and ℱ2 are exactly the same up to node expansions as no labels may be deleted, and we will find maxomltdℱ1,ℱ2,2. There are many ways to check forest equality, for the sake of completion we outline one below. Define a branching node as a node with more than one child and non-branching nodes as a node with 1 or 0 children. Note that any node expansion creates a non-branching node, and so when checking if trees are equal up to node expansions, we must check if paths of non-branching nodes can be expanded to become equal. This is done in step 3 of the following routine for checking forest equality.

  1. Compute set 𝒫1 of paths P=v1,v2,…,vi∈ℱ1 such that

    • v1 is the node in P closest to the root of the tree containing P in ℱ1,

    • the parent of v1 is a branching node or v1 is the root of the tree containing P,

    • vi is a branching node or a leaf.

    We call v1 the root of path P. We assume that node v1 has a pointer to its path P and vice versa.

  2. Sort 𝒫1 and 𝒫2 lexicographically according to λ(P) for all P∈𝒫1∪𝒫2.

  3. For each path P1∈𝒫1:

    1. Use binary search on 𝒫2 to find a path P2 in ℱ2 with exactly the same label set as P1 (i.e., λP1=λP2). If no such path is found, return 2.

    2. Check if P1 and P2 are equal up to node expansions. We can do this by checking the labels of the nodes in the paths one at a time starting at the roots of the paths according to Observation 2. If both paths’ roots contain the label, we may remove the label from consideration. Once a root node has all labels removed, we delete it and move to the next node in the path. If the current pair of root nodes considered has no more shared labels and both root node label sets are still non-empty, we return 2.

    3. If P1 and P2 are empty after the previous step, we mark these paths as matching by storing a pointer to P2 in P1 and move on to the next path of 𝒫1.

  4. Starting in the root node of a tree T in ℱ1 we find it’s corresponding path P in 𝒫1 and the marked matching path P′ in 𝒫2. Let bP be the last node in P and let bP′ be the last node in P′. Note by Step 1 these are branching nodes or leaves. For every child node ci of bP for 1≤i≤childbP we find it’s corresponding path Pi∈𝒫1 and check that the root of the matching path Pi′∈𝒫2 has parent bP′. If the parents of the checked pairs of paths are not bP and bP′, we output 2, otherwise we continue iteratively, performing the same check for the children nodes of the last node in Pi and Pi′ for all 1≤i≤childbP. We then continue iteratively until we’ve performed these checks for every pair of matching paths. After all paths in tree T pass these checks, we move on to a new tree in ℱ1 until all paths of ℱ1 are checked or 2 is returned.

The first and last step above take 𝒪(L) time and sorting in step 2 can be done in 𝒪(LlogL) (e.g., via mergesort). The third step dominates the runtime. Performing the binary search on 𝒫2 may take time 𝒪(logL). When checking if two paths are equal up to node expansions, each label in ℱ1 is only considered during its corresponding path of 𝒫1, and it is compared to at most every label of ℱ2. Therefore, this step takes time at most 𝒪L2logL. Overall, checking if omltdℱ1,ℱ2≤2 can be done in time 𝒪L2logL.

Finally, we prove the correctness and runtime of an algorithm computing omltd according to Equation 3. We begin with the correctness.

Lemma 4.

Given two multi-label forests ℱ1, ℱ2, omltdℱ1,ℱ2,ku for a positive integer ku computes

minomltdℱ1,ℱ2,ku+1.
Proof.

First, we consider when ku≥omltdℱ1,ℱ2 and show Equation 3 correctly computes omltd ℱ1,ℱ2 when this inequality holds. As an invariant, we will argue that we maintain that the value passed to parameter ku is larger than the distance between the two forests of any recursive call we make in any case of Equation 3.

The first three cases of Equation 3 do not have any recursive calls and comprise the base cases.

Case 1: In the first case ku≤0 and omltdℱ1,ℱ2>0. Therefore, the first case can never occur when ku≥omltdℱ1,ℱ2.

Case 2: The second case is trivially correct. If ku≥omldℱ1,ℱ2=0 then 0 is correctly output.

Case 3: Similarly, the third case occurs when ℱ1 is empty and any optimal edit sequence must delete all of ℱ2, which has cost omltdℱ1,ℱ2=omltd∅,ℱ2=λℱ2, as in Equation 3.

Case 4: The correctness of the fourth case follows from Claim 1. However, we must also show that ku−1≥omltdℱ1\{a},ℱ2. By the case constraint, a must be deleted by any optimal edit sequence between ℱ1 and ℱ2 since a is only contained in ℱ1. Therefore,

ku−1≥omltdℱ1,ℱ2−1=omltdℱ1\{a},ℱ2.

Case 5: In the fifth case, we have that dT≤1 where recall that dT=minomltdT1,T2v2+λPv2,rT2−λv2,2. Note that since omltdT1,T2v2 is non-negative, if dT≤1, it must be the case that λPv2,rT2−λv2≤1. If λPv2,rT2−λv2=0, then v2 is the root of T2 and so omltdT1,T2v2=omltdT1,T2. The correctness of this case then follows from Lemma 1. If instead λPv2,rT2−λv2=1, then v2 must be the child of rT2. Furthermore, since dT≤1, we must have that omltd T1,T2v2=0, and so the correctness of this case follows from Lemma 2.

Case 6: The correctness of the sixth case follows from an analogous argument to the fifth case.

Case 7: The correctness of the final case follows from Claim 1, however, we must make sure that ku−2 is a correct upper-bound for each recursive call made in this case. Consider the first parameter of the min function. Recall that omltd T1\{a},T2v2\{a}+omltdℱ1\T1,Rℱ2,v2+λPv2,rT2−λv2 computes the cost of a minimum cost edit sequence matching label a together in ℱ1 and ℱ2 by deleting all ancestors of v2 in ℱ2. We know that since we are not in Case 6, dℱ=omltdℱ1\T1,Rℱ2,v2+λPv2,rT2−λv2≥2. Therefore, if this edit sequence is optimal, we have that

ku−2≥omltdℱ1,ℱ2−2=omltdT1\{a},T2v2\{a}+omltdℱ1\T1,Rℱ2,v2+λPv2,rT2−λv2−2≥omltdT1\{a},T2v2\{a}+2−2=omltdT1\{a},T2v2\{a}.

We also know that since we are not in Case 5, dT=omltdT1,T2v2+λPv2,rT2−λv2≥2. An analogous argument shows that ku−2≥omltdℱ1\T1,Rℱ2,v2 as well.

Recall that the second parameter of the min function represents an optimal sequence of edits that deletes label a from ℱ1 and ℱ2. Since a is contained in both forests, this requires 2 deletions and so

ku−2≥omltdℱ1,ℱ2−2=omltdℱ1\{a},ℱ2\{a}+2−2=omltdℱ1\{a},ℱ2\{a}.

Therefore, we maintain the invariant that ku≥omltdℱ1,ℱ2 in any recursive call of Equation 3 if it is true at the first call, and so the algorithm will correctly output omltdℱ1,ℱ2 by induction.

If ku<omltdℱ1,ℱ2, the correctness of Equation 3 still holds from the previous arguments. However, we may additionally reach Case 1, which returns ∞ or we may compute a number higher than ku. If omltdℱ1,ℱ2,ku computes a value greater than ku, we return ku+1, which satisfies the lemma statement.

We now prove the runtime of an algorithm implementing Equation 3 via induction. The proof follows similarly to that of Claim 2.

Theorem 1.

Given two multi-label forests ℱ1, ℱ2 and k=omltdℱ1,ℱ2, then omltdℱ1,ℱ2 can be computed in time 𝒪(2k2⋅L3logL).

Proof.

By Lemma 4, we know that an algorithm utilizing Equation 3 will correctly compute omltdℱ1,ℱ2 using k≥omltdℱ1,ℱ2. We now analyze the runtime complexity of such an algorithm using induction on k.

By Lemma 3, we can check the constraints of the fifth and sixth cases of Equation 3 in less than CL2logL time where C>3 (note the lower bound on 3 is arbitrary and we choose it for convenience later in this proof) is a constant and L=λℱ1+λℱ2. Now, we define our induction hypothesis to be that omltdℱ1,ℱ2,k takes time 2CL3logL⋅2k2.

Cases 1–3: Our base case occurs when either of the first three cases of Equation 3 are reached. In any of these cases, there is no recursion. Checking if omltdℱ1,ℱ2=0 can be done in time CL2logL by Lemma 3 and computing λℱ2 can be done via a simple traversal through ℱ2 to count each label, which will take time L, so the total amount of time is less than 2CL3logL⋅2k2 in any of these cases.

Case 4: In the fourth case, there is a recursive call on omltdℱ1\{a},ℱ2,k−1, which takes time C(L−1)3logL⋅2k−12 by the induction hypothesis. Finding and deleting label a can be done in 2L time, and so in total, this step takes

2L+C(L−1)3logL⋅2k−12≤2CL3logL⋅2k2

Case 5: In this case, we must find label a and construct Rℱ2,v2, which can be done in 2L time. Additionally, we must compute dT. By Lemma 3, this can be done in time at most CλT1+λT22logL. By the induction hypothesis, the recursive call takes time at most <mi>. Let S=λT1+λT2. The total time of this step is then at most

2L+CS2logL+2C(L−S)3logL⋅2k2=2L+CS2logL+2CL3−3L2S+3LS2−S3logL⋅2k2≤2CL3logL⋅2k2+2C−3L2S+3LS2+2L+−S3+S2logL⋅2k2≤2CL3logL⋅2k2+2C−3L2S+3LS2+1+0logL⋅2k2≤2CL3logL⋅2k2+2C−3L2S+3L2SlogL⋅2k2=2CL3logL⋅2k2

where note the second last line follows since S2+1≤LS since T1 and T2 contain at least label a each so S>0 and L>S (if L=S, we can skip the recursive call as the remaining forests would be empty).

Case 6: This case follows from a symmetric argument to case 5.

Case 7: This is the final case. As for Equation 1, we must construct Rℱ2,v2 and remove a from ℱ1 and ℱ2. This can be done in at most 2L steps by deleting all labels one at a time in λPr,v2 excluding the labels of v2 itself, and when a node has its last label deleted, we delete the node itself as well. We additionally must compute dT and dℱ to check if we indeed fall into any of the previous cases, which takes time at most CL2logL. There are three recursive calls we consider. Let S=λT1+λT2. By the inductive hypothesis, omltd T1\{a},T2v2\{a},k−2 takes time at most 2C(S−2)3logL⋅2k−22 and omltd ℱ1\T1,Rℱ2,v2,k−2 takes time at most 2C(L−S)3logL⋅2k−22. Together, these recursive calls take time

2C(S−2)3logL⋅2k−22+2C(L−S)3logL⋅2k−22≤2C(L−2)3logL⋅2k−22.

As for the last recursive call, omltdℱ1\{a},ℱ2\{a},k−2 takes time at most 2C(L−2)3logL⋅2k−22 by the inductive hypothesis. We therefore have total time at most,

3L+CL2logL+2C(L−2)3logL⋅2k−22+2C(L−2)3logL⋅2k−22≤3L+CL2logL+2C(L−2)3logL⋅2k2≤2CL2logL+2C(L−2)3logL⋅2k2≤2CL3logL⋅2k2+2C−2L2+4L−8+L2logL⋅2k2≤2CL3logL⋅2k2+2C−L2+4LlogL⋅2k2≤2CL3logL⋅2k2

where the last inequality follows since L2≥4L for all L≥4. We know that L is at least 4 since otherwise we would have fallen into case 5 or case 6 as there would be no labels in ℱ1 and ℱ2 besides both copies of a and potentially one other label.

Therefore, all cases take time at most 2CL3logL⋅2k2, and so by induction, omltdℱ1,ℱ2,k takes time 𝒪(L3logL⋅2k2).

Given an upper bound B≥omltdℱ1,ℱ2, Theorem 1 provides a very fast bound 𝒪(L3logL⋅2B2) for omlta/omltd if omltdℱ1,ℱ2≤B, otherwise it reports that there is no valid solution. However, for real data sets we cannot know in advance what value to assign to B. We run our algorithm multiple times incrementing B by 1 at each iteration and starting at B=1 until our algorithm outputs a valid solution. Let k=omltdℱ1,ℱ2. The total runtime to compute omltdℱ1,ℱ2 considering these k iterations will be:

CL3logL⋅21/2+CL3logL⋅22/2+CL3logL⋅23/2+…+CL3logL⋅2k/2=CL3logL⋅∑B=1k2B≤22−1CL3logL⋅2k/2,

where the above inequality follows from the geometric series formula.

Obtaining omlta from omltd calculation.

As shown, Equation 3 provides a recursive computation of omltd that can be used to find the minimum number of label deletions for two input trees T1 and T2. In other words, in the recursion tree for this computation, there exists at least one optimal branch that can be used to compute omltd. If we keep track of the optimal branch of the recursive algorithm in the recursion tree, we may additionally construct a minimum cost edit sequence that constructs the omlta alignment tree. We describe how to do so informally in the following paragraph using the notation of Equation 3.

While following the optimal branch, we add label deletions to our minimum cost edit sequence corresponding to removed labels in cases 3, 4, 5, 6, where the latter two cases only have a label deletion if dT=1 or dℱ=1. In case 7, there are two subcases. Either we delete label a in both subtrees, which if optimal, we add as a label deletion for T1 and T2 in our minimum cost edit sequence, or we delete all nodes and labels in the path leading to node v2, which again we add to our edit sequence if optimal. In the latter subcase, we choose to retain label a in T1 and T2, which is maintained as we continue down the optimal branch, so we may add a node expansion for v1 and v2 to our minimum cost edit sequence to separate label a from v1 and v2 into a pair of matching nodes in the final alignment tree. Finally, after reaching the bottom of the optimal recursion tree branch, we obtain all label deletions and node expansions. We may then finish our minimum cost edit sequence by adding any node deletions needed for any nodes whose entire label set is deleted in the minimum cost edit sequence. By performing the resulting edit sequence on T1 and T2, both are transformed into the alignment tree for omlta.

Supplementary Material

Supplement 1

Acknowledgments

This research was supported in part by the Intramural Research Program of the National Institutes of Health (NIH). The contributions of the NIH authors were made as part of their official duties as NIH federal employees, are in compliance with agency policy requirements, and are considered Works of the United States Government. However, the findings and conclusions presented in this paper are those of the authors and do not necessarily reflect the views of the NIH or the U.S. Department of Health and Human Services. This work utilized the computational resources of the NIH HPC Biowulf cluster (https://hpc.nih.gov).

References

  • 1.Levenshtein V. Binary codes capable of correcting deletions, insertions and reversals. Sov. Phys. Dokl. 10, 707 (1966). [Google Scholar]
  • 2.Needleman S. B. & Wunsch C. D. A general method applicable to the search for similarities in the amino acid sequence of two proteins. J. Mol. Biol. 48, 443–453 (1970). [DOI] [PubMed] [Google Scholar]
  • 3.Smith T. F. & Watermanm M. S. Identification of common molecular subsequences. J. Mol. Biol. 147, 195–197 (1981). [DOI] [PubMed] [Google Scholar]
  • 4.Demeulemeester J., Dentro S. C., Gerstung M. & Van Loo P. Biallelic mutations in cancer genomes reveal local mutational determinants. Nat. Genet. 54, 128–133 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 5.Akutsu T., Fukagawa D., Takasu A. & Tamura T. Exact algorithms for computing the tree edit distance between unordered trees. Theor. Comp. Sci. 412, 352–364 (2011). [Google Scholar]
  • 6.Al Bakir M. et al. The evolution of non-small cell lung cancer metastases in tracerx. Nature 616, 534–542 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 7.Grigoriadis K. et al. CONIPHER: a computational framework for scalable phylogenetic reconstruction with error correction. Nature Prot. 19, 159–183 (2024). [DOI] [PubMed] [Google Scholar]
  • 8.Wintersinger J. A. et al. Reconstructing complex cancer evolutionary histories from multiple bulk DNA samples using Pairtree. Blood Cancer Discov. 3, 208–219 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 9.Pérez-Guijarro E. et al. Multimodel preclinical platform predicts clinical response of melanoma to immunotherapy. Nat. Med. 26, 781–791 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 10.Govek K., Sikes C., Zhou Y. & Oesper L. Graphyc: Using consensus to infer tumor evolution. IEEE/ACM Trans. Comput. Biol. Bioinformatics 19, 465–478 (2022). [DOI] [PubMed] [Google Scholar]
  • 11.Guang Z., Smith-Erb M. & Oesper L. A weighted distance-based approach for deriving consensus tumor evolutionary trees. Bioinformatics 39, i204–i212 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 12.Fu X. & Schwartz R. Contreedp: A consensus method of tumor trees based on maximum directed partition support problem. In 2021 IEEE International Conference on Bioinformatics and Biomedicine (BIBM), 125–130 (2021). [Google Scholar]
  • 13.Aguse N., Qi Y. & El-Kebir M. Summarizing the solution space in tumor phylogeny inference by multiple consensus trees. Bioinformatics 35, i408–i416 (2019). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 14.Mehrabadi F. R. et al. Profiles of expressed mutations in single cells reveal subclonal expansion patterns and therapeutic impact of intratumor heterogeneity. bioRxiv; 2021. –03 (2021). [Google Scholar]
  • 15.Christensen S., Kim J., Chia N., Koyejo O. & El-Kebir M. Detecting evolutionary patterns of cancers using consensus trees. Bioinformatics 36, i684–i691 (2020). [DOI] [PubMed] [Google Scholar]
  • 16.Karpov N., Malikic S., Rahman K. & Sahinalp C. A multi-labeled tree dissimilarity measure for comparing “clonal trees” of tumor progression. Algorithms Mol. Biol. 14, 17 (2019). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 17.Malikic S., McPherson A. W., Donmez N. & Sahinalp C. S. Clonality inference in multiple tumor samples using phylogeny. Bioinformatics 31, 1349–1356 (2015). [DOI] [PubMed] [Google Scholar]
  • 18.El-Kebir M., Oesper L., Acheson-Field H. & Raphael B. J. Reconstruction of clonal trees and tumor composition from multi-sample sequencing data. Bioinformatics 31, i62–i70 (2015). URL 10.1093/bioinformatics/btv261. https://academic.oup.com/bioinformatics/article-pdf/31/12/i62/49014148/bioinformatics_31_12_i62.pdf. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 19.Jahn K., Kuipers J. & Beerenwinkel N. Tree inference for single-cell data. Genome Biol. 17, 86 (2016). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 20.Malikic S. et al. Phiscs: a combinatorial approach for subperfect tumor phylogeny reconstruction via integrative use of single-cell and bulk sequencing data. Genome Res. 29, 1860–1877 (2019). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 21.Robinson D. F. & Foulds L. R. Comparison of phylogenetic trees. Math. Biosci. 53, 131–147 (1981). URL 10.1016/0025-5564(81)90043-2. [DOI] [Google Scholar]
  • 22.DiNardo Z., Tomlinson K., Ritz A. & Oesper L. Distance measures for tumor evolutionary trees. Bioinformatics 36, 2090–2097 (2019). URL 10.1093/bioinformatics/btz869. https://academic.oup.com/bioinformatics/article-pdf/36/7/2090/50670253/bioinformatics_36_7_2090.pdf. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 23.Jahn K., Beerenwinkel N. & Zhang L. The Bourque distances for mutation trees of cancers. Algorithms Mol. Biol. 16, 9 (2021). URL 10.1186/s13015-021-00188-3. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 24.Ciccolella S. et al. Triplet-based similarity score for fully multilabeled trees with poly-occurring labels. Bioinformatics 37, 178–184 (2020). URL 10.1093/bioinformatics/btaa676. https://academic.oup.com/bioinformatics/article-pdf/37/2/178/50322388/btaa676.pdf. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 25.Selkow S. M. The tree-to-tree editing problem. Inf. Proc. Lett. 6, 184–186 (1977). [Google Scholar]
  • 26.Tai K.-C. The tree-to-tree correction problem. J. ACM 26, 422–433 (1979). [Google Scholar]
  • 27.Zhang K. & Shasha D. Simple fast algorithms for the editing distance between trees and related problems. SIAM J. Comput. 18, 1245–1262 (1989). [Google Scholar]
  • 28.Klein P. N. Computing the edit-distance between unrooted ordered trees. In Bilardi G., Italiano G. F., Pietracaprina A. & Pucci G. (eds.) 6th Annual European Symposium on Algorithms, ESA 1998, vol. 1461 of LNCS, 91–102 (Springer, 1998). [Google Scholar]
  • 29.Demaine E. D., Mozes S., Rossman B. & Weimann O. An optimal decomposition algorithm for tree edit distance. ACM Trans. Algorithms 6, 2:1–2:19 (2009). [Google Scholar]
  • 30.Mao X. Breaking the cubic barrier for (unweighted) tree edit distance. In 62nd IEEE Annual Symposium on Foundations of Computer Science, FOCS 2021, 792–803 (IEEE, 2021). [Google Scholar]
  • 31.Zhang K., Statman R. & Shasha D. On the editing distance between unordered labeled trees. Inf. Proc. Lett. 42, 133–139 (1992). [Google Scholar]
  • 32.Akutsu T., Tamura T., Fukagawa D. & Takasu A. Efficient exponential time algorithms for edit distance between unordered trees. In Kärkkäinen J. & Stoye J. (eds.) Combinatorial Pattern Matching, 360–372 (Springer Berlin Heidelberg, Berlin, Heidelberg, 2012). [Google Scholar]
  • 33.Akutsu T., Fukagawa D., Halldórsson M., Takasu A. & Tanaka K. Approximation and parameterized algorithms for common subtrees and edit distance between unordered trees. Theor. Comp. Sci. 470, 10–22 (2013). [Google Scholar]
  • 34.Fukagawa D., Tamura T., Takasu A., Tomita E. & Akutsu T. A clique-based method for the edit distance between unordered trees and its application to analysis of glycan structures. BMC Bioinformatics 12 Suppl 1, S13 (2011). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 35.Mori T. et al. A clique-based method using dynamic programming for computing edit distance between unordered trees. J. Comput. Biol. 19, 1089–1104 (2012). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 36.Mair A. & Keselman D. Maximum agreement subtree in a set of evolutionary trees:metrics and efficient algorithms. SIAM J. Comput. 26, 1656–1669 (1997). [Google Scholar]
  • 37.Cole R., Farach-Colton M., Hariharan R., Przytycka T. & Thorup M. An O(nlog n) algorithm for the maximum agreement subtree problem for binary trees. SIAM J. Comput. 30, 1385–1404 (2000). [Google Scholar]
  • 38.Farach M., Przytycka T. & Thorup M. On the agreement of many trees. Inf. Proc. Lett. 55, 297–301 (1995). [Google Scholar]
  • 39.Qi Y. & El-Kebir M. Sapling: Inferring and summarizing tumor phylogenies from bulk data using backbone trees. In Pissis S. P. & Sun W. (eds.) 24th International Workshop on Algorithms in Bioinformatics (WABI 2024), vol. 312 of Leibniz International Proceedings in Informatics (LIPIcs), 7:1–7:19 (2024). [Google Scholar]
  • 40.Roth A. et al. Pyclone: statistical inference of clonal population structure in cancer. Nature Meth. 11, 396–398 (2014). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 41.Popic V. et al. Fast and scalable inference of multi-sample cancer lineages. Genome Biol. 16, 91 (2015). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 42.Fischer M., Herbst L., Kersting S., Kühn A. L. & Wicke K. Tree balance indices: A comprehensive survey (Springer Nature, Cham, Switzerland, 2023). [Google Scholar]
  • 43.Burrell R. A. & Swanton C. Re-evaluating clonal dominance in cancer evolution. Trends Cancer 2, 263–276 (2016). [DOI] [PubMed] [Google Scholar]
  • 44.Attolini C. S.-O. & Michor F. Evolutionary theory of cancer. Ann. N. Y. Acad. Sci. 1168, 23–51 (2009). [DOI] [PubMed] [Google Scholar]
  • 45.Cross W. C. H., Graham T. A. & Wright N. A. New paradigms in clonal evolution: punctuated equilibrium in cancer. J. Pathol. 126–136 (2016). [DOI] [PubMed] [Google Scholar]
  • 46.Frankell A. M. et al. The evolution of lung cancer and impact of subclonal selection in tracerx. Nature 616, 525–533 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 47.Hong W. S., Shpak M. & Townsend J. P. Inferring the origin of metastases from cancer phylogenies. Cancer Res. 75, 4021–4025 (2015). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 48.Sondka Z. et al. COSMIC: a curated database of somatic variants and clinical data for cancer. Nucleic Acids Res. 52, D1210–D1217 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 49.Suehnholz S. P. et al. Quantifying the expanding landscape of clinical actionability for patients with cancer. Cancer Discov. 14, 49–65 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 50.Chakravarty D. et al. OncoKB: a precision oncology knowledge base. JCO Precis. Oncol. 1, 1–16 (2017). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 51.McGranahan N. et al. Clonal status of actionable driver events and the timing of mutational processes in cancer evolution. Sci. Transl. Med. 7, 283ra54 (2015). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 52.Zhang L., Han X. & Shi Y. Association of itmuc16 mutation with response to immune checkpoint inhibitors in solid tumors. JAMA Netw. Open 3, e2013201 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 53.Chen H. et al. Association of lrp1b mutation with tumor mutation burden and outcomes in melanoma and non-small cell lung cancer patients treated with immune check-point blockades. Front. Immunol. 10, 1113 (2019). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 54.Brown L. C. et al. LRP1B mutations are associated with favorable outcomes to immune checkpoint inhibitors across multiple cancer types. J. Immunother. Cancer 9, e001792 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 55.Hao F., Ma Q. & Zhong D. Potential predictive value of comutant lrp1b and fat for immune response in non-small cell lung cancer: Lrp1b and fat comutation enhance immune response. Transl. Oncol. 24, 101493 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 56.Liu T. et al. Comprehensive characterization of muc16 mutations in lung adenocarcinoma for immunotherapies and prognosis: An observational study. Medicine 102, e35481 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 57.Loeb L. A. Mutator phenotype may be required for multistage carcinogenesis. Cancer Res. 51, 3075–3079 (1991). [PubMed] [Google Scholar]
  • 58.Cahill D. P., Kinzler K. W., Vogelstein B. & Lengauer C. Genetic instability and darwinian selection in tumours. Trends Cell Biol. 9, M57–M60 (1999). [PubMed] [Google Scholar]
  • 59.Tsao J. et al. Genetic reconstruction of individual colorectal tumor histories. Proc. Natl, Acad. Sci. USA 97, 1236–1241 (2000). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 60.Wu Y. Accurate and efficient cell lineage tree inference from noisy single cell data: the maximum likelihood perfect phylogeny approach. Bioinformatics 36, 742–750 (2020). [DOI] [PubMed] [Google Scholar]
  • 61.Picelli S. et al. Full-length RNA-seq from single cells using Smart-seq2. Nat. Prot. 9, 171–181 (2014). [DOI] [PubMed] [Google Scholar]
  • 62.Gierahn T. M. et al. Seq-well: portable, low-cost rna sequencing of single cells at high throughput. Nat. Meth. 14, 395–398 (2017). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 63.Gotoh O. Multiple sequence alignment: Algorithms and applications. Adv. Biophys. 11, 159–206 (1999). [DOI] [PubMed] [Google Scholar]
  • 64.Edgar R. C. & Batzoglu S. Multiple sequence alignment. Curr. Opin. Struct. Biol. 16, 368–373 (2006). [DOI] [PubMed] [Google Scholar]
  • 65.Zhang Y., Zhang Q., Zhou J. & Zou Q. A survey on the algorithm and development of multiple sequence alignment. Brief. Bioinformatics 23, bbbac069 (2022). [DOI] [PubMed] [Google Scholar]
  • 66.Cormen T. H., Leiserson C. E., Rivest R. L. & Stein C. Introduction to Algorithms, 3rd Edition (MIT Press, 2009). URL http://mitpress.mit.edu/books/introduction-algorithms. [Google Scholar]
  • 67.Garey M. R. & Johnson D. S. Computers and Intractability; A Guide to the Theory of NP-Completeness (W. H. Freeman & Co., New York, USA, 1990). [Google Scholar]
  • 68.Qiu P. Embracing the dropouts in single-cell rna-seq analysis. Nat Commun. 11, 1169 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 69.Bouland G. A., Mahfouz A. & Reinders M. J. T. Consequences and opportunities arising due to sparser single-cell RNA-seq datasets. Genome Biol. 24, 86 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 70.Cardona G., Mir A., Rosselló L. R. & Sánchez D. Cophenetic metrics for phylogenetic trees, after Sokal and Rohlf. BMC Bioinformatics 14, 3 (2013). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 71.Llabrés M., Rosselló F. & Valiente G. The generalized Robinson-Foulds distance for phylogenetic trees. J. Comput. Biol. 28, 1181–1195 (2021). URL https://doi.org/10.1089/cmb.2021.0342. 10.1089/cmb.2021.0342. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 72.Popic V. et al. Fast and scalable inference of multi-sample cancer lineages. Genome Biol. 16, 91 (2015). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 73.Malikic S., Jahn K., Kuipers J., Sahinalp S. C. & Beerenwinkel N. Integrative inference of subclonal tumour evolution from single-cell and bulk sequencing data. Nat. Commun. 10, 2750 (2019). [DOI] [PMC free article] [PubMed] [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Supplementary Materials

Supplement 1

Articles from bioRxiv are provided here courtesy of Cold Spring Harbor Laboratory Preprints

RESOURCES