treemer {sitePath} | R Documentation

## Topology-dependent tree trimming

### Description

`groupTips` uses sequence similarity to group tree tips. Members in a group are always constrained to share the same ancestral node. Similarity between two tips is derived from their multiple sequence alignment. The site will not be counted into total length if both are gap. Similarity is calculated as number of matched divided by the corrected total length. So far the detection of divergence is based on one simple rule: the miminal pairwise similarity. The two branches are decided to be divergent if the similarity is lower than the threshold. (Other more statistical approaches such as Kolmogorov-Smirnov Tests among pair-wise distance could be introduced in the future)

`lineagePath` finds the lineages of a phylogenetic tree providing the corresponding sequence alignment. This is done by trimming the tree to the ancestor node of tips in each group and then find the bifurcated terminals of the trimmed tree. The `nodepath` between root node and the bifurcated terminals is the lineages. In order to extend the search of mutational site. The lineages will tag some of its trailing nodes. Here nodes up to the ancestor of the tips with the longest `nodepath` are added.

### Usage

    groupTips(tree, similarity = NULL, simMatrix = NULL,
      forbidTrivial = TRUE, tipnames = TRUE)

    lineagePath(tree, similarity = NULL, simMatrix = NULL,
      forbidTrivial = TRUE)

### Arguments

`tree` | The return from `addMSA` function
`similarity` | Similarity threshold for tree trimming. If not provided, an average value of similarity among all sequences will be used.
`simMatrix` | S diagonal matrix of similarity between sequences
`forbidTrivial` | Does not allow trivial trimming
`tipnames` | If return as tipnames

### Value

grouping of tips

path represent by node number

### Examples

    data("zikv_tree")
    data("zikv_align")
    tree <- addMSA(zikv_tree, alignment = zikv_align)
    groupTips(tree, 0.996)
    lineagePath(tree, 0.996)

[Package sitePath version 1.0.3 Index]