findSites {sitePath} | R Documentation

## Finding sites with variation

### Description

Single nucleotide polymorphism (SNP) in the whole package refers to variation of amino acid. `findSNPsite` will try to find SNP in the multiple sequence alignment. A reference sequence and gap character may be specified to number the site. This is irrelevant to the intended analysis but might be helpful to evaluate the performance of `fixationSites`.

After finding the `lineagePath` of a phylogenetic tree, `fixationSites` uses the result to find those sites that show fixation on some, if not all, of the lineages. Parallel evolution is relatively common in RNA virus. There is chance that some site be fixed in one lineage but does not show fixation because of different sequence context.

After finding the `lineagePath` of a phylogenetic tree, `multiFixationSites` uses random sampling on the original tree and applies the method used in `fixationSites` to each sampled tree and summarize the results from all the samples.

### Usage

    SNPsites(tree, minSNP = NULL)

    ## S3 method for class 'lineagePath'
    fixationSites(
      paths,
      minEffectiveSize = NULL,
      searchDepth = 1,
      method = c("compare", "insert", "delete"),
      ...
    )

    ## S3 method for class 'lineagePath'
    multiFixationSites(
      paths,
      samplingSize = NULL,
      samplingTimes = 100,
      minEffectiveSize = 0,
      searchDepth = 1,
      method = c("compare", "insert", "delete"),
      ...
    )

### Arguments

`tree` | The return from `addMSA` function
`minSNP` | Minimum number of amino acid variation to be a SNP
`paths` | a `lineagePath` object returned from `lineagePath` function
`minEffectiveSize` | A vector of two integers to specifiy minimum tree tips involved before/after mutation. Otherwise the mutation will not be counted into the return. If more than one number is given, the ancestral takes the first and descendant takes the second as the minimum. If only given one number, it's the minimum for both ancestral and descendant.
`searchDepth` | The function uses heuristic search but the termination of the search cannot be intrinsically decided. `searchDepth` is needed to tell the search when to stop.
`method` | The strategy for predicting the fixation. The basic approach is entropy minimization and can be achieved by adding or removing fixation point, or by comparing the two.
`...` | further arguments passed to or from other methods.
`samplingSize` | The number of tips sampled for each round of resampling. It shoud be at least 10th and at most nine 10ths of the tree tips.
`samplingTimes` | The total times of random sampling to do. It should be greater than 100.

### Value

`SNPsite` returns a list of qualified SNP site

`fixationSites` returns a list of fixation mutations with names of the tips involved.

`multiFixationSites` returns sites with multiple fixations.

### Examples

    data(zikv_tree_reduced)
    data(zikv_align_reduced)
    tree <- addMSA(zikv_tree_reduced, alignment = zikv_align_reduced)
    SNPsites(tree)
    fixationSites(lineagePath(tree))

[Package sitePath version 1.2.3 Index]