Description Usage Arguments Value Author(s) References See Also Examples
These functions provide additional methods to manipulate objects of class
"DNAbin"
and "AAbin"
to supplement those available in the
ape
package.
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, ...)
|
x |
a |
incomparables |
placeholder, not currently functional. |
pointers |
logical indicating whether the re-replication index key
should be returned as a |
... |
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 |
subset |
logical vector giving the elements or rows to be kept. |
unique
and subset
return a
DNAbin
or AAbin
object. duplicated
returns a logical vector.
Shaun Wilkinson
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.
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)
|
[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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.