Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

AAbin

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'
c(..., recursive = FALSE)

## S3 method for class 'AAbin'
rbind(...)
## S3 method for class 'AAbin'
cbind(..., check.names = TRUE, fill.with.Xs = FALSE,
             quiet = 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, grid = FALSE,
      show.aa = FALSE, aa.cex = 1, aa.font = 1, aa.col = "black",...)

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

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

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

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

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

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

## S3 method for class 'AAbin'
as.matrix(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" (or else depending on the function).

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.

recursive

logical; whether to go down lists and concatenate its elements.

check.names

a logical specifying whether to check the rownames before binding the columns (see details).

fill.with.Xs

a logical indicating whether to keep all possible individuals as indicating by the rownames, and eventually filling the missing data with insertion gaps (ignored if check.names = FALSE).

quiet

a logical to switch off warning messages when some rows are dropped.

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).

grid

a logical controlling whether to draw a grid (FALSE by default).

show.aa

a logical controlling whether to show the AA symbols (FALSE by default).

aa.cex, aa.font, aa.col

control the aspect of the AA symbols (ignored if the previous is FALSE).

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 is a conversion function to and from characters.

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).

The two functions cbind.AAbin and rbind.AAbin work in the same way than the similar methods for the class "DNAbin": see cbind.DNAbin for more explanations about their respective behaviours.

Value

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

Author(s)

Emmanuel Paradis, Franz Krah

See Also

Examples

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

ape

Analyses of Phylogenetics and Evolution

v5.5
GPL-2 | GPL-3
Authors
Emmanuel Paradis [aut, cre, cph] (<https://orcid.org/0000-0003-3092-2199>), Simon Blomberg [aut, cph] (<https://orcid.org/0000-0003-1062-0839>), Ben Bolker [aut, cph] (<https://orcid.org/0000-0002-2127-0443>), Joseph Brown [aut, cph] (<https://orcid.org/0000-0002-3835-8062>), Santiago Claramunt [aut, cph] (<https://orcid.org/0000-0002-8926-5974>), Julien Claude [aut, cph] (<https://orcid.org/0000-0002-9267-1228>), Hoa Sien Cuong [aut, cph], Richard Desper [aut, cph], Gilles Didier [aut, cph] (<https://orcid.org/0000-0003-0596-9112>), Benoit Durand [aut, cph], Julien Dutheil [aut, cph] (<https://orcid.org/0000-0001-7753-4121>), RJ Ewing [aut, cph], Olivier Gascuel [aut, cph], Thomas Guillerme [aut, cph] (<https://orcid.org/0000-0003-4325-1275>), Christoph Heibl [aut, cph] (<https://orcid.org/0000-0002-7655-3299>), Anthony Ives [aut, cph] (<https://orcid.org/0000-0001-9375-9523>), Bradley Jones [aut, cph] (<https://orcid.org/0000-0003-4498-1069>), Franz Krah [aut, cph] (<https://orcid.org/0000-0001-7866-7508>), Daniel Lawson [aut, cph] (<https://orcid.org/0000-0002-5311-6213>), Vincent Lefort [aut, cph], Pierre Legendre [aut, cph] (<https://orcid.org/0000-0002-3838-3305>), Jim Lemon [aut, cph], Guillaume Louvel [aut, cph] (<https://orcid.org/0000-0002-7745-0785>), Eric Marcon [aut, cph] (<https://orcid.org/0000-0002-5249-321X>), Rosemary McCloskey [aut, cph] (<https://orcid.org/0000-0002-9772-8553>), Johan Nylander [aut, cph], Rainer Opgen-Rhein [aut, cph], Andrei-Alin Popescu [aut, cph], Manuela Royer-Carenzi [aut, cph], Klaus Schliep [aut, cph] (<https://orcid.org/0000-0003-2941-0161>), Korbinian Strimmer [aut, cph] (<https://orcid.org/0000-0001-7917-2056>), Damien de Vienne [aut, cph] (<https://orcid.org/0000-0001-9532-5251>)
Initial release
2021-04-24

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.