---
name: "treetime"
section: "1"
platform: "linux"
package: "python3-treetime"
version: "0.11.4-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/treetime"
---

# treetime(1)

Maximum Likelihood Phylodynamics

## NAME

treetime - Maximum Likelihood Phylodynamics

## SYNOPSIS

**treetime** \<positional\> \[optional\]

## DESCRIPTION

TreeTime provides routines for ancestral sequence reconstruction and inference of molecular-clock phylogenies, i.e., a tree where all branches are scaled such that the positions of terminal nodes correspond to their sampling times and internal nodes are placed at the most likely time of divergence.

To optimize the likelihood of time-scaled phylogenies, TreeTime uses an iterative approach that first infers ancestral sequences given the branch length of the tree, then optimizes the positions of unconstrained nodes on the time axis, and then repeats this cycle. The only topology optimization are (optional) resolution of polytomies in a way that is most (approximately) consistent with the sampling time constraints on the tree. The package is designed to be used as a stand-alone tool on the command-line or as a library used in larger phylogenetic analysis work-flows.

## OPTIONS

### positional arguments

- **ancestral**

  infer ancestral sequences maximizing the joint or marginal likelihood.

- **homoplasy**

  analyze patterns of recurrent mutations aka homoplasies.

- **clock**

  estimate molecular clock parameters and reroot the tree.

- **mugration**

  map discrete character such as host or country to the tree.

### optional arguments

- **-h**, **--help**

  show this help message and exit

- **--tree** TREE

  Name of file containing the tree in newick, nexus, or phylip format. If none is provided, treetime will attempt to build a tree from the alignment using fasttree, iqtree, or raxml (assuming they are installed)

- **--sequence-length** SEQUENCE\_LENGTH

  length of the sequence, used to calculate expected variation in branch length. Not required if alignment is provided.

- **--aln** ALN

  alignment file (fasta)

- **--vcf-reference** VCF\_REFERENCE

  only for vcf input: fasta file of the sequence the VCF was mapped to.

- **--dates** DATES

  csv file with dates for nodes with 'node\_name, date' where date is float (as in 2012.15)

- **--clock-filter** CLOCK\_FILTER

  ignore tips that don't follow a loose clock, 'clockfilter=number of interquartile ranges from regression'

- **--reroot** REROOT

  reroot the tree. Valid choices are 'ML', 'ML-rough', 'least-squares', 'min\_dev', 'midpoint' or a node name to be used as outgroup. Use **--keep-root** to keep the current root.

- **--keep-root**

  don't reroot the tree. Otherwise, reroot to minimize the the residual of the regression of root-to-tip distance and sampling time

- **--gtr** GTR

  GTR model to use. '--gtr infer' will infer a model from the data. Alternatively, specify the model type. If the specified model requires additional options, use '--gtr-params' to specify those.

- **--gtr-params** GTR\_PARAMS \[GTR\_PARAMS ...\]

  GTR parameters for the model specified by the **--gtr** argument. The parameters should be feed as 'key=value' list of parameters. Example: '--gtr K80 **--gtr-params** kappa=0.2 pis=0.25,0.25,0.25,0.25'. See the exact definitions of the parameters in the GTR creation methods in treetime/nuc\_models.py or treetime/aa\_models.py

- **--clock-rate** CLOCK\_RATE

  if specified, the rate of the molecular clock won't be optimized.

- **--branch-length-mode** {auto,input,joint,marginal}

  If set to 'input', the provided branch length will be used without modification. Note that branch lengths optimized by treetime are only accurate at short evolutionary distances.

- **--confidence**

  estimate confidence intervals of divergence times.

- **--keep-polytomies**

  Don't resolve polytomies using temporal information.

- **--relax** \[RELAX \[RELAX ...\]\]

  use an autocorrelated molecular clock. Prior strength and coupling of parent and offspring rates can be specified e.g. as **--relax** 1.0 0.5

- **--max-iter** MAX\_ITER

  maximal number of iterations the inference cycle is run. Note that for polytomy resolution and coalescence models max\_iter should be at least 2

- **--coalescent** COALESCENT

  coalescent time scale **--** sensible values are on the order of the average hamming distance of contemporaneous sequences. In addition, 'opt' 'skyline' are valid options and estimate a constant coalescent rate or a piecewise linear coalescent rate history

- **--plot-tree** PLOT\_TREE

  filename to save the plot to. Suffix will determine format (choices pdf, png, svg, default=pdf)

- **--plot-rtt** PLOT\_RTT

  filename to save the plot to. Suffix will determine format (choices pdf, png, svg, default=pdf)

- **--keep-overhangs**

  do not fill terminal gaps

- **--zero-based**

  zero based mutation indexing

- **--report-ambiguous**

  include transitions involving ambiguous states

- **--verbose** VERBOSE

  verbosity of output 0-6

- **--outdir** OUTDIR

  directory to write the output to

## SEE ALSO

https://github.com/neherlab/treetime

## EXAMPLES

https://github.com/neherlab/treetime\_examples

## AUTHOR

This manpage was written by Andreas Tille for the Debian distribution and can be used for any other usage of the program.
