lineagePath {sitePath} | R Documentation

## Resolving lineage paths using SNP

### Description

`lineagePath` finds the lineages of a phylogenetic tree providing the corresponding sequence alignment. This is done by finding 'major SNPs' which usually accumulate along the evolutionary pathways.

`sneakPeek` is intended to plot 'similarity' (actually the least percentage of 'major SNP') as a threshold against number of output lineagePath. This plot is intended to give user a rough view about how many lineages they could expect from the 'similarity' threshold in the function `lineagePath`. The number of lineagePath is preferably not be too many or too few. The result excludes where the number of lineagePath is greater than number of tips divided by 20 or user-defined maxPath. The zero lineagePath result will also be excluded.

When used on the return of `sneakPeek`, a `lineagePath` with the closest `similarity` will be retrieved from the returned value.

### Usage

    lineagePath(tree, similarity, ...)

    ## S3 method for class 'phyMSAmatched'
    lineagePath(
      tree,
      similarity = NULL,
      simMatrix = NULL,
      forbidTrivial = TRUE,
      ...
    )

    sneakPeek(tree, step = 9, maxPath = NULL, minPath = 0, makePlot = TRUE)

    ## S3 method for class 'sneakPeekedPaths'
    lineagePath(tree, similarity, ...)

### Arguments

`tree` | The return from `addMSA` or `sneakPeek` function.
`similarity` | This decides how minor SNPs are to remove. If provided as fraction between 0 and 1, then the minimum number of SNP will be total tips times `similariy`. If provided as integer greater than 1, the minimum number will be `similariy`. The default `similariy` is 0.05 for `lineagePath`.
`...` | Other arguments.
`simMatrix` | Deprecated and will not have effect.
`forbidTrivial` | Does not allow trivial trimming.
`step` | the 'similarity' window for calculating and plotting. To better see the impact of threshold on path number. The default is 10.
`maxPath` | maximum number of path to return show in the plot. The number of path in the raw tree can be far greater than trimmed tree. To better see the impact of threshold on path number. This is preferably specified. The default is one 20th of tree tip number.
`minPath` | minimum number of path to return show in the plot. To better see the impact of threshold on path number. The default is 1.
`makePlot` | Whether make a plot when return.

### Value

Lineage path represent by node number.

`sneakPeek` return the similarity threhold against number of lineagePath. There will be a simple dot plot between threshold and path number if `makePlot` is TRUE.

### Examples

    data('zikv_tree')
    data('zikv_align')
    tree <- addMSA(zikv_tree, alignment = zikv_align)
    lineagePath(tree)
    sneakPeek(tree, step = 3)
    x <- sneakPeek(tree, step = 3)
    lineagePath(x, similarity = 0.05)

[Package sitePath version 1.6.6 Index]