manipulate: Further bit-level manipulation of DNA and amino acid...

Description Usage Arguments Value Author(s) References See Also Examples

Description

These functions provide additional methods to manipulate objects of class "DNAbin" and "AAbin" to supplement those available in the ape package.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## S3 method for class 'DNAbin'
duplicated(x, incomparables = FALSE, pointers = TRUE, ...)

## S3 method for class 'DNAbin'
unique(x, incomparables = FALSE, attrs = TRUE, drop = FALSE, ...)

## S3 method for class 'DNAbin'
subset(x, subset, attrs = TRUE, drop = FALSE, ...)

## S3 method for class 'AAbin'
duplicated(x, incomparables = FALSE, pointers = TRUE, ...)

## S3 method for class 'AAbin'
unique(x, incomparables = FALSE, attrs = TRUE, drop = FALSE, ...)

## S3 method for class 'AAbin'
subset(x, subset, attrs = TRUE, drop = FALSE, ...)

Arguments

x

a "DNAbin" or "AAbin" object.

incomparables

placeholder, not currently functional.

pointers

logical indicating whether the re-replication index key should be returned as a "pointers" attribute of the output vector (only applicable for duplicated.DNAbin and duplicated.AAbin). Note that this can increase the computational time for larger sequence lists.

...

further arguments to be passed between methods.

attrs

logical indicating whether the attributes of the input object whose length match the object length (or number of rows if it is a matrix) should be retained and subsetted along with the object. This is useful if the input object has species, lineage and/or taxon ID metadata that need to be retained following the duplicate analysis.

drop

logical; indicates whether the input matrix (assuming one is passed) should be reduced to a vector if subset to a single sequence. Defaults to FALSE in keeping with the style of the ape package functions.

subset

logical vector giving the elements or rows to be kept.

Value

unique and subset return a DNAbin or AAbin object. duplicated returns a logical vector.

Author(s)

Shaun Wilkinson

References

Paradis E, Claude J, Strimmer K, (2004) APE: analyses of phylogenetics and evolution in R language. Bioinformatics 20, 289-290.

Paradis E (2007) A bit-level coding scheme for nucleotides. http://ape-package.ird.fr/misc/BitLevelCodingScheme.html.

Paradis E (2012) Analysis of Phylogenetics and Evolution with R (Second Edition). Springer, New York.

See Also

DNAbin

Examples

1
2
3
4
5
6
7
8
9
  data(whales)
  duplicates <- duplicated.DNAbin(whales, point = TRUE)
  attr(duplicates, "pointers")
  ## returned indices show that the last sequence is
  ## identical to the second one.
  ## subset the reference sequence database to only include unques
  whales <- subset.DNAbin(whales, subset = !duplicates)
  ## this gives the same result as
  unique.DNAbin(whales)

Example output

 [1]  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18  2
18 DNA sequences in binary format stored in a list.

Mean sequence length: 130.167 
   Shortest sequence: 129 
    Longest sequence: 131 

Labels:
AJ554063|9742
AB201256|255217
AB201258|9769
AJ554062|40151
AJ554061|27610
AJ554060|48723
...

Base composition:
    a     c     g     t 
0.329 0.236 0.209 0.225 
(Total: 2.34 kb)

insect documentation built on Aug. 9, 2021, 5:07 p.m.