AAbin {ape} | R Documentation

## Amino Acid Sequences

### Description

These functions help to create and manipulate AA sequences.

### Usage

    ## S3 method for class 'AAbin'
    print(x, ...)

    ## S3 method for class 'AAbin'
    x[i, j, drop = FALSE]

    ## S3 method for class 'AAbin'
    as.character(x, ...)

    ## S3 method for class 'AAbin'
    labels(object, ...)

    ## S3 method for class 'AAbin'
    image(x, what, col, bg = "white", xlab = "", ylab = "",
          show.labels = TRUE, cex.lab = 1, legend = TRUE, ...)

    as.AAbin(x, ...)
    ## S3 method for class 'character'
    as.AAbin(x, ...)

    ## S3 method for class 'AAbin'
    as.phyDat(x, ...)

    dist.aa(x, pairwise.deletion = FALSE, scaled = FALSE)
    AAsubst(x)

### Arguments

`x, object` | an object of class `"AAbin"`.
`i, j` | indices of the rows and/or columns to select or to drop. They may be numeric, logical, or character (in the same way than for standard R objects).
`drop` | logical; if `TRUE`, the returned object is of the lowest possible dimension.
`what` | a vector of characters specifying the amino acids to visualize. Currently, the only possible choice is to show the three categories hydrophobic, small, and hydrophilic.
`col` | a vector of colours. If missing, this is set to “red”, “yellow” and “blue”.
`bg` | the colour used for AA codes not among `what` (typically X and *).
`xlab` | the label for the x-axis; none by default.
`ylab` | Idem for the y-axis. Note that by default, the labels of the sequences are printed on the y-axis (see next option).
`show.labels` | a logical controlling whether the sequence labels are printed (`TRUE` by default).
`cex.lab` | a single numeric controlling the size of the sequence labels. Use `cex.axis` to control the size of the annotations on the x-axis.
`legend` | a logical controlling whether the legend is plotted (`TRUE` by default).
`pairwise.deletion` | a logical indicating whether to delete the sites with missing data in a pairwise way. The default is to delete the sites with at least one missing data for all sequences.
`scaled` | a logical value specifying whether to scale the number of AA differences by the sequence length.
`...` | further arguments to be passed to or from other methods.

### Details

These functions help to manipulate amino acid sequences of class `"AAbin"`. These objects are stored in vectors, matrices, or lists which can be manipulated with the usual `[` operator.

There are conversion functions to and from characters, and to `"phyDat"`.

The function `dist.aa` computes the number of AA differences between each pair of sequences in a matrix; this can be scaled by the sequence length. See the function `dist.ml` in phangorn for evolutionary distances with AA sequences.

The function `AAsubst` returns the indices of the polymorphic sites (similar to `seg.sites` for DNA sequences; see examples below).

### Value

an object of class `"AAbin"`, `"character"`, `"phyDat"`, `"dist"`, or `"numeric"`, depending on the function.

### Note

Package phangorn has the function `read.aa` to read amino acid sequence files in FASTA format.

### Author(s)

Emmanuel Paradis

### See Also

`trans`, `alview`

### Examples

    data(woodmouse)
    AA <- trans(woodmouse, 2)
    seg.sites(woodmouse)
    AAsubst(AA)

[Package ape version 4.1 Index]