subset: Subset 'codonTable' object.

Description Usage Arguments Value Examples

Description

Subset codonTable object.

Usage

1
2
3
4
5
6
7
8
## S4 method for signature 'codonTable'
x[i]

## S4 method for signature 'codonTable'
x[[i]]

## S3 method for class 'codonTable'
subset(x, subset, ...)

Arguments

x

A codonTable object to be subset.

i

indices specifying elements to extract or replace. Indices are numeric or character vectors or empty (missing) or NULL. Numeric values are coerced to integer as by as.integer (and hence truncated towards zero). Character vectors will be matched to the names of the object (or for matrices/arrays, the dimnames): see ‘Character indices’ below for further details.

For [-indexing only: i, j, ... can be logical vectors, indicating elements/slices to select. Such vectors are recycled if necessary to match the corresponding extent. i, j, ... can also be negative integers, indicating elements/slices to leave out of the selection.

When indexing arrays by [ a single argument i can be a matrix with as many columns as there are dimensions of x; the result is then a vector with elements corresponding to the sets of indices in each row of i.

An index value of NULL is treated as if it were integer(0).

subset

A logical or character vector indicating which elements of x to keep. If logical, subset should be of length length(x). If character, subset should contain at least some of the elements of either getKO(x) or getCOG(x).

...

further arguments to be passed to or from other methods.

Value

subsets of codonTable object, keeping in each slot only those elements that meet the criteria in subset, if specified.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# create codonTable
mat <- matrix(sample(1:10, 610, replace = TRUE), nrow = 10)
cT <- codonTable(mat) # produces informative warning
cT
cT[1]
cT[[1]]
subset(cT, c(rep(c(TRUE,FALSE), 5))) # subset odd sequences

cT <- setKO(cT, rep(c("K00001", "K00002"), 5))
subset(cT, "K00001")

cT <- setCOG(cT, rep(c("COG0001", "COG0002"), 5))
subset(cT, "COG0001")

coRdon documentation built on Nov. 8, 2020, 5:28 p.m.