# How to Build a Structure-Based Phylogenetic Tree: Integrating Structural Alignments with Evolutionary Analysis

Structure-based phylogenetic inference addresses a specific limitation of conventional sequence-only approaches: protein sequences diverge faster than their three-dimensional folds, so deeply divergent homologs may share a common architecture while retaining little detectable sequence identity. When sequence alignments become unreliable, structural alignments provide an alternative basis for evolutionary comparison. This article explains how to construct a phylogenetic tree from structural alignments using tools such as DALI for structure superposition and PhyML or RAxML for maximum likelihood inference, with attention to data preparation, alignment quality control, model selection, tree interpretation, and reproducibility.

The intended reader is a graduate student, postdoctoral researcher, or laboratory professional who has experience with sequence-based phylogenetics and needs to extend that workflow to structural data. The practical outcome is a defensible tree-building protocol that integrates structural alignments with evolutionary analysis, including explicit checks for alignment reliability, branch support, and interpretation limits.

## Why Structure-Based Phylogenetics Matters for Deep Evolutionary Relationships

Sequence-based phylogenetic methods assume that aligned positions are homologous, meaning they descend from a common ancestral position. This assumption degrades when sequences have diverged so far that gap placement and residue identity carry little signal. Structural alignment methods instead superpose three-dimensional coordinates and define equivalence based on spatial correspondence, which can recover homology relationships that sequence alignment misses.

The practical consequence is that structure-based trees can resolve relationships among proteins that share a fold but have sequence identities in the twilight zone, roughly below 20 to 25 percent identity. For example, enzymes that share a catalytic core but have diverged in peripheral loops may align confidently by structure while their sequences produce ambiguous alignments. Researchers studying ancient gene families, structural genomics targets, or cross-species orthology benefit most from this approach.

Structural alignments also provide a check on sequence-based conclusions. If a sequence alignment places two domains as sister clades but the structural superposition shows incompatible core geometries, the sequence-based result may reflect alignment artifact instead of evolutionary signal. Conversely, when sequence and structure trees disagree, the discrepancy itself becomes a finding worth reporting.

The workflow described here assumes you have a set of protein structures, either experimentally determined or predicted, and you want to infer their evolutionary relationships. The same principles apply whether your structures come from X-ray crystallography, cryo-electron microscopy, NMR, or AlphaFold predictions, though the quality controls differ by source.

## At a Glance: Structure-Based Phylogenetic Workflow

| Workflow Stage | Primary Tools | Key Decision | Common Error |
| --- | --- | --- | --- |
| Structure collection | PDB, AlphaFold Database, NCBI Structure | Define inclusion criteria for structure quality and redundancy | Including low-resolution or truncated models without filtering |
| Structural alignment | DALI, Foldseek, SBAL with ASSP | Choose alignment method and scoring parameters | Treating alignment output as ground truth without visual inspection |
| Alignment trimming | Automated or manual curation | Remove unreliable columns and gapped regions | Over-trimming that discards informative positions |
| Model selection | ModelFinder, jModelTest, ProtTest | Select amino acid substitution model and rate heterogeneity | Defaulting to a model without testing |
| Tree inference | PhyML, RAxML, IQ-TREE | Choose optimality criterion and branch support method | Using a single run without bootstrap or Bayesian support |
| Visualization and interpretation | FigTree, iTOL, R packages | Root the tree and annotate structural features | Overinterpreting poorly supported nodes |

The table above summarizes the six stages covered in this article. Each stage involves a decision that affects downstream inference, and each has a characteristic failure mode that can invalidate the final tree.

## Data Inputs: Selecting and Preparing Structures

### Defining the Structure Set

The first decision is which structures to include. Your inclusion criteria should be explicit and recorded before you begin alignment. Common criteria include sequence identity thresholds for redundancy reduction, structure resolution cutoffs for experimental models, and confidence score thresholds for predicted models.

For experimentally determined structures, resolution and completeness matter. A structure solved at 2.0 angstrom resolution with continuous electron density is a stronger input than a 3.5 angstrom model with disordered loops. Check the PDB entry for the resolution, the R-free value, and the presence of missing residues. Structures with large disordered regions may still be usable if the core fold is complete, but you should record which residues are missing and consider whether those gaps affect the alignment.

For predicted structures, the confidence metrics matter more than any single coordinate. AlphaFold produces per-residue confidence scores and a predicted aligned error matrix. Residues with low confidence should be treated cautiously in alignments, and regions with high predicted aligned error may indicate uncertain relative domain orientations. If you include predicted structures, state the prediction method and version, and consider whether the prediction pipeline introduces bias into your alignment.

### Redundancy Reduction

Structural databases contain many near-identical entries. Including multiple structures of the same protein from different organisms or different ligand states can skew the tree by creating dense clusters of nearly identical sequences that dominate the alignment. Reduce redundancy by clustering structures at a sequence identity threshold, commonly 90 percent or 95 percent, and select one representative per cluster.

The choice of representative affects the tree. If you keep the highest-resolution structure, you prioritize coordinate quality. If you keep the structure with the most complete sequence coverage, you prioritize alignment completeness. Record your selection rule and apply it consistently.

### Structure Quality Assessment

Before alignment, assess each structure for the following:

- Resolution or prediction confidence
- Completeness of the polypeptide chain
- Presence of ligands, cofactors, or modified residues that may affect conformation
- Oligomeric state and whether the biological unit differs from the asymmetric unit
- Evidence of domain movements or alternative conformations

Structures that capture different conformational states of the same protein may align poorly in mobile regions even when the core fold is identical. If your study focuses on evolutionary relationships, consider whether conformational heterogeneity should be treated as biological signal or alignment noise.

## Core Principles of Structural Alignment

### What Structural Alignment Computes

Structural alignment algorithms seek a superposition that minimizes the distance between equivalent C-alpha atoms or backbone atoms while maximizing the number of aligned residues. The output is a set of equivalent positions, a root-mean-square deviation (RMSD) for those positions, and a sequence alignment implied by the structural equivalence.

DALI, one of the most widely used structural alignment tools, divides structures into hexapeptide fragments and compares contact matrices to identify similar packing patterns. The DALI Z-score indicates the statistical significance of the structural similarity. A Z-score above 2 is typically considered significant, with higher scores indicating more confident matches. However, the Z-score depends on the database searched and the query structure, so interpret it in context.

Foldseek offers a faster alternative that encodes structures as sequences of structural states and searches using sequence alignment methods. Foldseek is substantially faster than DALI for database searches, which matters when comparing many structures. For pairwise structural alignment, both tools can produce equivalent residue mappings, but the scoring schemes differ.

### Mapping Secondary Structure onto Alignments

Secondary structure information can improve alignment quality and interpretability. The SBAL tool, described in the peer-reviewed literature, generates amino acid sequence alignments with mapped secondary structure elements. Its companion application ASSP assigns secondary structure using the dictionary of protein secondary structure method of Kabsch and Sander, the same assignment scheme used throughout structural biology.

The practical value of secondary structure mapping is that it lets you check whether aligned columns contain equivalent secondary structure elements. If a column aligns a helix residue in one protein with a strand residue in another, that column is suspect regardless of the structural superposition score. Secondary structure mapping also helps you identify conserved core elements versus variable loops when you trim the alignment.

### The Relationship Between Structural and Sequence Alignment

A structural alignment implies a sequence alignment, but the reverse is not true. Sequence alignment methods can produce alignments that are structurally impossible, for example by aligning residues that face different directions in the folded protein. Structural alignment methods avoid this by construction, because equivalence is defined by spatial proximity after superposition.

This distinction matters for phylogenetic inference. When you build a tree from a structural alignment, you are using the sequence characters that correspond to structurally equivalent positions. The phylogenetic model still operates on amino acid characters, but the alignment that defines positional homology comes from structure instead of sequence.

## Practical Workflow for Building the Tree

### Step 1: Generate Pairwise Structural Alignments

Begin with pairwise structural alignments to assess the overall similarity landscape of your structure set. Run DALI or Foldseek for all pairs, or use a representative subset if the full pairwise comparison is computationally expensive. Record the Z-scores or equivalent similarity scores, the number of aligned residues, and the RMSD for each pair.

This pairwise matrix serves two purposes. First, it identifies outlier structures that align poorly to everything else, which may indicate a misclassified structure, a genuinely divergent fold, or a data quality problem. Second, it provides a sanity check for the multiple alignment you will generate next.

### Step 2: Generate a Multiple Structural Alignment

Multiple structural alignment is more complex than pairwise alignment because it must reconcile pairwise equivalences into a single consistent mapping. Some tools build the multiple alignment progressively from pairwise alignments, while others use iterative superposition.

DALI can produce multiple alignments through its web server, and several other tools support multiple structural alignment. The output is a structure-based multiple sequence alignment where each column represents structurally equivalent positions.

Inspect the multiple alignment visually. Look for columns where the secondary structure assignments are inconsistent, where gaps interrupt core secondary structure elements, and where the alignment includes residues with poor electron density or low prediction confidence. These columns are candidates for trimming.

### Step 3: Trim the Alignment

Alignment trimming removes unreliable columns before phylogenetic inference. The goal is to retain columns that are confidently aligned and informative while removing columns that are gappy, poorly resolved, or structurally inconsistent.

Trimming decisions should be recorded. Common approaches include:

- Removing columns with gaps in more than a specified fraction of sequences
- Removing columns where secondary structure assignments conflict
- Removing N-terminal and C-terminal extensions that align poorly
- Removing loop regions that show high conformational variability

The tradeoff is between alignment confidence and phylogenetic information. Aggressive trimming produces a shorter, more reliable alignment but discards potentially informative positions. Conservative trimming retains more characters but risks including misaligned columns that add noise.

### Step 4: Select a Substitution Model

Phylogenetic inference requires a model of amino acid substitution. Common empirical models include WAG, LG, and JTT, each derived from different protein databases. Model selection tools compare candidate models and choose the best fit to your alignment using information criteria such as the Akaike information criterion or the Bayesian information criterion.

Rate heterogeneity across sites is almost always necessary for real protein alignments. The gamma distribution with a proportion of invariant sites, or the gamma distribution alone, typically fits protein data better than a uniform rate model. Model selection tools will estimate the shape parameter and the proportion of invariant sites from your data.

Do not assume that the model that worked for your previous sequence-based tree is appropriate for your structural alignment. The structural alignment has different column composition than a sequence alignment of the same proteins, because structurally equivalent positions are enriched for core residues and depleted for variable surface residues. Model selection should be run on the trimmed structural alignment.

### Step 5: Infer the Tree

Maximum likelihood and Bayesian methods are the standard choices for protein phylogenetics. PhyML and RAxML implement maximum likelihood inference, while BEAST2 implements Bayesian inference with additional capabilities for molecular dating and phylodynamic analysis.

For a maximum likelihood tree, run a heuristic search with multiple random starting trees and retain the best-scoring tree. Assess branch support with bootstrap resampling, typically 100 to 1000 replicates. The bootstrap proportion for each branch indicates the proportion of resampled alignments that recovered that branch.

For a Bayesian tree, run multiple Markov chain Monte Carlo chains, check convergence using effective sample size diagnostics, and summarize the posterior distribution as a maximum clade credibility tree with posterior probabilities on branches. Bayesian inference is computationally more expensive but provides a natural framework for incorporating priors and for co-estimating parameters.

### Step 6: Root and Interpret the Tree

Phylogenetic trees are unrooted unless you specify an outgroup. Choose an outgroup that is structurally similar enough to align reliably but evolutionarily distant enough to root the ingroup. If no suitable outgroup exists, you may need to root the tree using a midpoint method or an external classification, and you should state the rooting assumption explicitly.

Interpret the tree with attention to branch support. Branches with bootstrap support above 70 percent or posterior probability above 0.95 are generally considered well supported, but these thresholds are conventions, not guarantees. Branches with lower support should be treated as unresolved, and you should avoid drawing strong evolutionary conclusions from them.

## Options and Tradeoffs in Tool Selection

### DALI versus Foldseek for Structural Alignment

DALI is the established standard for structural alignment and provides a well-validated Z-score for assessing similarity significance. Its web server is straightforward to use for moderate-sized structure sets. The main limitation is speed, which becomes relevant when comparing hundreds or thousands of structures.

Foldseek is much faster and can handle large structure sets that would be impractical with DALI. Its scoring is based on structural state sequences instead of contact patterns, which makes it sensitive to different aspects of structure. For phylogenetic purposes, the choice between DALI and Foldseek may affect the resulting alignment, so consider running both and comparing the alignments for your specific structure set.

### PhyML versus RAxML versus IQ-TREE for Tree Inference

PhyML is a mature maximum likelihood program with a straightforward command-line interface and good documentation. RAxML is designed for large alignments and offers efficient bootstrap resampling. IQ-TREE includes integrated model selection and is often the most convenient choice because it combines model testing and tree inference in one program.

All three programs implement maximum likelihood phylogenetics and should produce similar trees for the same alignment and model, though heuristic search may find different local optima. The choice among them is largely a matter of convenience, computational resources, and familiarity.

### Bayesian Inference with BEAST2

BEAST2 provides a Bayesian framework that can co-estimate the tree, substitution parameters, and other evolutionary parameters. The MASCOT package extends BEAST2 for phylogeographic analysis, jointly inferring spatial and temporal transmission dynamics, which is relevant if your structural phylogeny is embedded in a broader epidemiological or ecological study. The BEAM package, also built on BEAST2, infers tissue-migration histories in metastatic cancer from cell-lineage tracing data, demonstrating the flexibility of the BEAST2 platform for integrating phylogenetic inference with additional data types.

For a structure-based phylogeny, BEAST2 is appropriate when you need divergence times, when you want to incorporate calibration information, or when you want to model population dynamics jointly with the tree. The cost is increased computational demand and the need to assess convergence carefully.

## Observations and Measurements During the Workflow

### Recording Alignment Statistics

For each alignment you generate, record the following:

- Number of sequences and number of aligned columns
- Number of distinct alignment patterns
- Proportion of gaps in the trimmed alignment
- Pairwise sequence identity distribution
- Structural similarity scores for representative pairs

These statistics provide a quantitative description of your alignment and help you compare alternative alignment strategies. They also belong in the methods section of any paper or report.

### Checking for Alignment Artifacts

Alignment artifacts can produce trees that are statistically well supported but biologically wrong. Common artifacts include:

- Attraction of long branches due to convergent amino acid composition
- Misalignment of repetitive or low-complexity regions
- Inclusion of paralogs that confuse orthology relationships
- Compositional heterogeneity across lineages that violates model assumptions

Check for these artifacts by examining the alignment visually, by testing for compositional heterogeneity, and by comparing trees built from different alignment methods. If sequence-based and structure-based trees disagree, investigate the source of the disagreement before trusting either result.

### Assessing Branch Support

Branch support values are the primary quantitative measure of confidence in your tree. Bootstrap proportions from maximum likelihood and posterior probabilities from Bayesian inference are not directly comparable, and neither should be interpreted as the probability that the branch is correct. They measure different things: bootstrap proportions measure the stability of the result under resampling, while posterior probabilities measure the posterior support under the model.

Report both the tree and the support values, and make the alignment and model available so others can reproduce the analysis.

## Records and Reproducibility

### Version Control for Analyses

Reproducibility requires recording every input, parameter, and software version used in the analysis. Store your structure files, alignment files, model selection results, tree files, and scripts in a version-controlled repository. The Carpentries lessons provide foundational training in version control with Git, which is essential for tracking changes to analysis code and data.

### Workflow Management

For complex analyses with many steps, workflow management systems help ensure that each step runs with the correct inputs and parameters. The Galaxy Training Network provides accessible tutorials for running bioinformatics analyses through the Galaxy platform, which tracks the history of every analysis step. The nf-core documentation describes community standards for Nextflow pipelines, which are useful for scaling analyses to large structure sets and for sharing pipelines with collaborators.

### Containerization

Software versions change, and a tree built with one version of RAxML may differ slightly from a tree built with another version. Containerization with Docker or Singularity freezes the software environment so that your analysis can be reproduced exactly. Record the container image identifier in your methods.

### Documentation Standards

Write a methods document that includes:

- The source and version of every structure
- The structural alignment tool and parameters
- The trimming criteria and the trimmed alignment
- The model selection procedure and the chosen model
- The tree inference program, version, and search parameters
- The branch support method and number of replicates
- The rooting method and outgroup choice

This document should be sufficient for another researcher to reproduce your tree without contacting you.

## Common Failure Patterns and How to Avoid Them

### Failure 1: Treating Structural Alignment as Ground Truth

Structural alignments are computational inferences, not experimental facts. Different algorithms can produce different equivalences, especially in regions of conformational flexibility or structural divergence. Always inspect the alignment visually and consider whether the equivalences make structural sense.

### Failure 2: Mixing Structures of Different Quality

Including a low-quality structure in an otherwise high-quality set can distort the alignment and the tree. The low-quality structure may have misplaced residues, missing loops, or incorrect domain orientations that create spurious gaps or equivalences. Filter structures by quality before alignment, and report the quality metrics for every structure included.

### Failure 3: Ignoring Model Assumptions

Phylogenetic models assume that substitutions occur independently across sites and that the substitution process is the same across the tree. Structural alignments may violate these assumptions because structurally constrained positions evolve differently from variable positions. The gamma distribution partially accommodates rate variation, but it does not model different substitution processes in different structural environments.

### Failure 4: Overinterpreting Poorly Supported Branches

A tree with high bootstrap support on some branches and low support on others is a normal result. The temptation is to tell a story that treats all branches as equally reliable. Resist this temptation. Report support values and discuss the evolutionary implications only for well-supported branches.

### Failure 5: Failing to Compare with Sequence-Based Trees

A structure-based tree is most informative when compared with a sequence-based tree of the same proteins. The comparison reveals which relationships are robust to alignment method and which depend on the structural information. If you only build the structure-based tree, you miss this diagnostic information.

## Limitations of Structure-Based Phylogenetics

### Structural Convergence

Protein folds can converge, meaning that unrelated proteins adopt similar structures without common ancestry. Structural similarity alone does not prove homology. If your structure set includes proteins that may be structurally similar by convergence instead of descent, the structural alignment will create false equivalences and the tree will be misleading.

### Domain Architecture Complexity

Many proteins contain multiple domains with different evolutionary histories. A structural alignment of a multidomain protein may align one domain well and the other poorly, producing a chimeric alignment that does not represent either domain's evolutionary history accurately. Consider analyzing domains separately if their evolutionary histories differ.

### Conformational Heterogeneity

Proteins are dynamic, and structures determined in different states may differ by domain movements, loop rearrangements, or disorder-to-order transitions. These conformational differences can reduce the number of confidently aligned residues and may bias the alignment toward the most rigid parts of the protein.

### Computational Cost

Structural alignment and tree inference are computationally intensive. Large structure sets require substantial memory and processing time, and Bayesian inference can take days or weeks. Plan your computational resources before starting, and consider whether a representative subset of structures can answer your question.

### Model Limitations

The substitution models used in phylogenetic inference were developed for sequence alignments, not structural alignments. Applying them to structural alignments assumes that the evolutionary process at structurally equivalent positions is adequately described by standard amino acid substitution models. This assumption is reasonable but untested for many structure sets.

## Safety and Regulatory Context

### Data Licensing and Attribution

Protein structures come from databases with specific usage terms. The Protein Data Bank and the AlphaFold Database have usage policies that generally permit academic use with attribution. NCBI provides access to sequence and structure data with its own usage guidelines. Check the license for each structure and cite the original structure determination papers in your methods.

### Export and Sharing Considerations

If your research involves pathogens, toxins, or dual-use sequences, consider whether sharing structures or alignments raises biosecurity concerns. Institutional biosafety committees and export control offices can advise on applicable regulations. This consideration applies to the structures themselves, not to the phylogenetic methods described here.

### Reproducibility as Research Integrity

Journals increasingly require that phylogenetic analyses be reproducible. Providing your alignment, model, tree file, and scripts demonstrates that your results are not the product of undisclosed parameter choices. The Galaxy Training Network and nf-core documentation provide guidance on building reproducible workflows that meet these expectations.

## Professional Escalation Criteria

### When to Seek Expert Help

You should escalate to a specialist in structural bioinformatics or phylogenetic methodology when:

- Your structural alignments produce inconsistent equivalences across tools
- Your tree shows extreme branch lengths or implausible relationships
- You need to model complex evolutionary processes such as recombination, horizontal gene transfer, or population structure
- You are analyzing structures with unusual features such as circular permutations, chimeric domains, or extensive disorder
- Your results will inform clinical, regulatory, or high-stakes decisions

### When to Question Your Data

Before escalating, check whether the problem lies in your data instead of your methods. Re-examine the structure quality metrics, the alignment, and the model selection output. A tree that looks wrong may be telling you that one of your structures is wrong, that your sequences are not orthologous, or that your alignment includes non-homologous positions.

### When to Publish or Report

Structure-based phylogenetic trees are publishable when they provide new evolutionary insight, when they resolve relationships that sequence-based methods cannot, or when they reveal discrepancies with sequence-based conclusions. Report the full workflow, including the structural alignment, trimming criteria, model selection, and support values, so that readers can evaluate the evidence for your conclusions.

## Decision Framework: Choosing Between Structure-Based and Sequence-Based Phylogenies

### When Structural Information Is Required

The decision to build a structure-based tree instead of a sequence-based tree should follow explicit criteria instead of habit or convenience. Structure-based inference is justified when sequence identity falls below the reliable alignment threshold, when you suspect that sequence alignment artifacts are driving your conclusions, or when you need to test whether a sequence-based result reflects genuine evolutionary signal or alignment noise.

Apply the following decision rules before committing to a structural workflow. First, compute pairwise sequence identities across your structure set. If the median pairwise identity falls below roughly 25 percent, sequence alignment reliability is questionable and structural alignment becomes the preferred basis for homology assignment. Second, run a sequence-based tree and inspect the alignment visually. If you observe gap placement that interrupts conserved secondary structure elements, or if the alignment aligns residues that clearly occupy different structural environments, the sequence alignment is likely introducing error. Third, consider whether your research question requires resolving relationships among deeply divergent homologs. If your set spans multiple folds or ancient gene families, structural information may recover equivalences that sequence methods miss.

Conversely, structure-based inference is not automatically superior. If your sequences share high identity, above roughly 40 to 50 percent, sequence alignment is reliable and the additional computational cost and methodological complexity of structural alignment may not improve your result. In this regime, sequence-based trees are faster, better validated, and easier to reproduce. The structural workflow adds value primarily when sequence signal is degraded.

### A Practical Decision Matrix for Method Selection

| Condition | Recommended Approach | Rationale |
| --- | --- | --- |
| Median pairwise identity above 40 percent | Sequence-based tree with standard alignment | Sequence alignment is reliable and faster |
| Median pairwise identity 20 to 40 percent | Compare sequence and structure trees | Structural alignment may resolve ambiguous regions |
| Median pairwise identity below 20 percent | Structure-based tree with quality filtering | Sequence alignment is unreliable in the twilight zone |
| Sequence and structure trees disagree | Investigate alignment and model assumptions | Disagreement indicates a methodological or biological signal |
| Structures include predicted models | Structure-based tree with confidence filtering | Predicted structures require explicit quality controls |
| Multidomain proteins with different histories | Analyze domains separately | Chimeric alignments obscure domain-specific signals |

This matrix provides a starting point, but your specific structure set may warrant exceptions. Record the rationale for your choice in the methods document so that reviewers and collaborators understand why you selected one approach over the other.

### Cost-Benefit Assessment Before Starting

Structural alignment and tree inference consume substantially more time and computational resources than sequence-based workflows. Before committing, estimate the costs and benefits for your specific project.

The computational cost scales with the number of structures and their sizes. Pairwise structural alignment with DALI becomes impractical beyond a few hundred structures, while Foldseek can handle thousands. Tree inference cost depends on alignment length, number of taxa, and the optimality criterion. Bayesian inference with BEAST2 can take days or weeks for large datasets, while maximum likelihood with IQ-TREE or RAxML is typically faster.

The benefit side of the assessment depends on what you expect to gain. If you anticipate that structural alignment will recover additional homologous positions, estimate how many columns the structural alignment adds compared with the sequence alignment. If the structural alignment is only marginally longer or if the additional columns are concentrated in variable loops, the phylogenetic benefit may be small. If the structural alignment recovers conserved core positions that the sequence alignment missed, the benefit is substantial.

Conduct a pilot analysis on a representative subset before scaling to the full dataset. Run both sequence and structural alignments on the subset, build trees from both, and compare the results. This pilot costs a fraction of the full analysis and reveals whether the structural approach changes your conclusions. If the pilot shows no meaningful difference, the full structural workflow may not be justified.

### Record System for Method Selection Decisions

Document the following for every structure-based phylogenetic project:

- The date of the method selection decision
- The pairwise sequence identity distribution for the structure set
- The sequence alignment tool and parameters used for comparison
- The structural alignment tool and parameters used for the final analysis
- The pilot analysis results comparing sequence and structure trees
- The rationale for the final method choice

This record serves multiple purposes. It provides the basis for the methods section of your paper, it allows collaborators to understand why you chose one approach over another, and it creates a reference point if you need to revisit the decision after seeing the final tree.

Store this record in a version-controlled repository alongside your analysis files. The Carpentries lessons provide foundational training in Git for tracking changes to analysis code and data, which is essential for maintaining a reliable record of method decisions.

### Troubleshooting Method Selection Failures

#### Failure Pattern 1: Structural Alignment Does Not Improve Resolution

You built a structure-based tree expecting it to resolve relationships that sequence methods could not, but the structure-based tree shows the same poorly supported branches or the same topology. This outcome indicates that the structural alignment did not add informative signal beyond the sequence alignment.

Check whether the structural alignment actually differs from the sequence alignment. Compute the fraction of aligned columns that are identical between the two alignments. If the alignments are nearly identical, the structural information did not change the homology assignment. This can happen when the proteins are structurally similar in the regions that sequence alignment already aligned reliably, while the divergent regions are too variable to align confidently even with structural information.

Consider whether your structure set actually spans the twilight zone. If the pairwise identities are higher than you estimated, sequence alignment may have been adequate all along. Recompute the identity distribution and reconsider whether the structural workflow was necessary.

#### Failure Pattern 2: Structural Alignment Produces Implausible Equivalences

The structural alignment aligns residues that you know from functional or biochemical data are not equivalent. This can happen when the alignment algorithm matches surface loops that happen to superpose well in the crystal structures but do not share evolutionary ancestry.

Inspect the alignment visually with secondary structure mapped onto the columns. The SBAL tool with its ASSP component, described in the peer-reviewed literature, maps secondary structure elements onto sequence alignments using the dictionary of protein secondary structure method of Kabsch and Sander. This mapping lets you check whether aligned columns contain equivalent secondary structure elements. If a column aligns a helix residue in one protein with a strand residue in another, that column is suspect regardless of the superposition score.

Consider whether conformational heterogeneity is driving the spurious equivalences. If your structures capture different conformational states, mobile regions may superpose by chance. Restrict the alignment to core structural elements or use a tool that weights core regions more heavily.

#### Failure Pattern 3: Structure-Based Tree Conflicts with Known Biology

The structure-based tree places two proteins as sister clades, but you have independent evidence that they belong to different functional families or that their domain architectures differ. This conflict indicates that the structural alignment may be aligning non-homologous positions or that structural convergence is misleading the inference.

Investigate the affected branches by examining the aligned columns that support them. Identify the specific residues that distinguish the conflicting clades and check whether those residues are structurally equivalent in a way that makes evolutionary sense. If the supporting columns are concentrated in a region of structural convergence, such as a common active site geometry that arises independently, the tree may reflect convergence instead of descent.

Compare the structure-based tree with a sequence-based tree of the same proteins. If the sequence-based tree agrees with the known biology and the structure-based tree does not, the structural alignment is likely introducing error. Report both trees and explain the discrepancy instead of presenting only the structure-based result.

#### Failure Pattern 4: Computational Cost Exceeds Available Resources

The structural alignment or tree inference step exceeds your available memory, processing time, or disk space. This failure often occurs when the structure set is larger than anticipated or when the alignment produces a longer alignment than expected.

Reduce the structure set by applying stricter redundancy reduction. Cluster structures at a higher sequence identity threshold, such as 90 percent instead of 95 percent, and select one representative per cluster. This reduces the number of taxa without losing major evolutionary lineages.

Consider whether you need all structures for your research question. If you are studying domain evolution, you may not need every structure of every domain. Select a representative set that spans the known diversity and justify the selection in your methods.

Switch to a faster alignment tool if the pairwise comparison is the bottleneck. Foldseek is substantially faster than DALI for large structure sets, though the resulting alignments may differ. Run both on a subset and compare before committing to the faster tool for the full analysis.

### Professional Escalation Criteria for Method Selection

Escalate to a specialist in structural bioinformatics or phylogenetic methodology when:

- Your pilot analysis shows that sequence and structure trees disagree substantially and you cannot explain the disagreement
- Your structure set includes proteins with circular permutations, chimeric domain architectures, or extensive disorder that complicate alignment
- You need to model evolutionary processes that standard phylogenetic tools do not handle, such as recombination or horizontal gene transfer
- Your results will inform clinical, regulatory, or high-stakes decisions where a wrong tree has serious consequences
- You are analyzing structures that may be related by structural convergence instead of common ancestry

Before escalating, verify that your method selection record is complete and that you have documented the pilot analysis results. A specialist can act more effectively when they can see the evidence that led to your method choice.

### Integrating Method Selection with the Full Workflow

The method selection decision is the first stage of the structure-based phylogenetic workflow, and it determines the validity of everything that follows. A structure-based tree built from a dataset that did not require structural alignment may be unnecessarily complex without adding insight. A sequence-based tree built from a dataset that required structural alignment may be positively misleading.

Treat method selection as a documented, testable decision instead of a default choice. Run the pilot comparison, record the results, and justify your approach in the methods section. This practice improves the quality of your phylogenetic inference and makes your work reproducible by others who may face the same decision with their own datasets.

The Galaxy Training Network provides accessible tutorials for running bioinformatics analyses through the Galaxy platform, which tracks the history of every analysis step and supports reproducible method selection. The nf-core documentation describes community standards for Nextflow pipelines, which are useful for scaling method comparison analyses to large structure sets and for sharing the comparison workflow with collaborators.

## Frequently Asked Questions

### What is the main advantage of a structure-based phylogenetic tree over a sequence-based tree?

A structure-based tree uses structural superposition to define positional homology, which can recover evolutionary relationships among proteins whose sequences have diverged beyond the reliable range of sequence alignment. This matters for deeply divergent homologs that share a fold but retain little sequence identity.

### Which structural alignment tool should I use for my structure set?

DALI is the established standard with a well-validated similarity score, while Foldseek is much faster and scales to large structure sets. For small to moderate sets, DALI is a safe choice. For large sets, Foldseek may be the only practical option. Consider running both and comparing the alignments.

### How do I know if my structural alignment is reliable?

Inspect the alignment visually, check that aligned columns contain equivalent secondary structure elements, and compare the structural alignment with a sequence alignment of the same proteins. Large discrepancies between the two alignment types indicate regions where the homology assignment is uncertain.

### Should I trim my structural alignment before building the tree?

Yes. Trimming removes columns that are gappy, poorly resolved, or structurally inconsistent, which reduces noise in the phylogenetic inference. Record your trimming criteria and report the trimmed alignment so others can reproduce your analysis.

### Which substitution model should I use for a structural alignment?

Run model selection on your trimmed structural alignment instead of assuming a model from a previous analysis. Empirical models such as LG or WAG with gamma-distributed rate heterogeneity are common choices, but the best model depends on your specific alignment.

### How many bootstrap replicates do I need?

Bootstrap support values stabilize with more replicates, and 100 replicates is a common minimum for exploratory analysis. For publication-quality results, 1000 replicates provides more stable support estimates. The computational cost scales with alignment length and tree size.

### Can I use predicted structures from AlphaFold for phylogenetic analysis?

Yes, but you must assess prediction confidence and consider whether low-confidence regions or uncertain domain orientations affect your alignment. Report the prediction method and version, and treat predicted structures with the same quality scrutiny as experimental structures.

### What should I do if my structure-based tree disagrees with my sequence-based tree?

Investigate the source of the disagreement before trusting either result. Check the alignments, examine the affected branches, and consider whether the disagreement reflects alignment artifact, model violation, or genuine evolutionary signal. The disagreement itself may be a publishable finding if you can explain it.

## Related Bioinformatics Guides

- [Structural and Evolutionary Dynamics of Coronavirus Spike Protein: Integrating Cryo-EM, Molecular Dynamics, and Phylogenetic Surveillance](/knowledge/bioinformatics/structural-evolutionary-dynamics-coronavirus-spike-protein)
- [Genomic Data Analysis Tools: A Comparative Guide for Researchers](/knowledge/bioinformatics/genomic-data-analysis-tools-a-comparative-guide-for-researchers)
- [Deep Learning for Whole Slide Image Analysis: An Overview](/knowledge/bioinformatics/deep-learning-for-whole-slide-image-analysis-an-overview)
- [Structural and Evolutionary Dynamics of Zoonotic Viral Glycoproteins: Integrating Molecular Modeling, Sequence Surveillance, and Receptor Binding Prediction](/knowledge/bioinformatics/structural-evolutionary-dynamics-zoonotic-viral-glycoproteins)
- [Mass Spectrometry-Based Proteomics: Data Analysis Pipelines and Tools](/knowledge/bioinformatics/mass-spectrometry-based-proteomics-data-analysis-pipelines-and-tools)

## References and Further Reading

- [NCBI Data Resources](https://www.ncbi.nlm.nih.gov/). National Center for Biotechnology Information.
- [EMBL-EBI Training](https://www.ebi.ac.uk/training). European Bioinformatics Institute.
- [Bioconductor](https://bioconductor.org/). Bioconductor Project.
- [Galaxy Training Network](https://training.galaxyproject.org/). Galaxy Project.
- [nf-core Documentation](https://nf-co.re/docs). nf-core.
- [The Carpentries Lessons](https://carpentries.org/lessons). The Carpentries.
- [An integrated Java tool for generating amino acid sequence alignments with mapped secondary structure elements.](https://pubmed.ncbi.nlm.nih.gov/28324365). 3 Biotech, 2015.
- [MASCOT-Skyline integrates population and migration dynamics to enhance phylogeographic reconstructions.](https://doi.org/10.1371/journal.pcbi.1013421). 2025.
- [Bayesian inference of tissue-migration histories in metastatic cancer from cell-lineage tracing data.](https://doi.org/10.1016/j.xgen.2026.101193). 2026.

> This article is educational and does not replace validated analysis plans, institutional policy, clinical interpretation, or specialist review.