addMSA {sitePath} | R Documentation

## Prepare data for sitePath analysis

### Description

sitePath requires both tree and sequence alignment to do the analysis. `addMSA` wraps `read.alignment` function in `seqinr` package and helps match names in tree and sequence alignment. Either provide the file path to an alignment file and its format or an alignment object from the return of `read.alignment` function. If both the file path and alignment object are given, the function will use the sequence in the alignment file.

### Usage

    addMSA(tree, msaPath = "", msaFormat = "", alignment = NULL)

### Arguments

`tree` | a `phylo` object. This commonly can be from tree parsing function in `ape` or `ggtree`. All the `tip.label` should be found in the sequence alignment.
`msaPath` | The file path to the multiple sequence alignment file
`msaFormat` | The format of the multiple sequence alignment file
`alignment` | an `alignment` object. This commonly can be from sequence parsing function in the `seqinr` package. Sequence names in the alignment should include all `tip.label` in the tree

### Value

`addMSA` returns a `phylo` object with matched multiple sequence alignment

### Examples

    data(zikv_tree)
    msaPath <- system.file('extdata', 'ZIKV.fasta', package = 'sitePath')
    addMSA(zikv_tree, msaPath = msaPath, msaFormat = 'fasta')

[Package sitePath version 1.3.1 Index]