codonTable-class: An S4 class 'codonTable'

Description Usage Arguments Value Methods (by generic) Slots Examples

Description

Contains codon counts and optional annotation for a set DNA sequences.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
codonTable(x)

## S4 method for signature 'DNAStringSet'
codonTable(x)

## S4 method for signature 'matrix'
codonTable(x)

## S4 method for signature 'data.frame'
codonTable(x)

codonCounts(object)

## S4 method for signature 'codonTable'
codonCounts(object)

getID(object)

## S4 method for signature 'codonTable'
getID(object)

getlen(object)

## S4 method for signature 'codonTable'
getlen(object)

getKO(object)

## S4 method for signature 'codonTable'
getKO(object)

setKO(object, ann)

## S4 method for signature 'codonTable'
setKO(object, ann)

getCOG(object)

## S4 method for signature 'codonTable'
getCOG(object)

setCOG(object, ann)

## S4 method for signature 'codonTable'
setCOG(object, ann)

Arguments

x

An object of DNAStringSet, matrix or data.frame class.

object

A codonTable object.

ann

A character vector of sequence annotations, must be of length equal to length(object).

Value

A codonTable.

Methods (by generic)

Slots

ID

A character vector of sequence identifiers.

counts

A matrix containing codon counts. Columns are codons, rows are sequences.

len

A numeric vector,length equal to nrow(counts), containing lengths of sequnces.

KO

A character vector of KEGG annotations for sequences, length equal to nrow(counts). If no annotation is available, this will be an empty vector.

COG

A character vector of COG annotations for sequences, length equal to nrow(counts). If no annotation is available, this will be an empty vector.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# create codonTable with codon counts for sequences in DNAStringSet
require(Biostrings)
dna <- DNAStringSet(c("ACGAAGTGTACTGTAATTTGCACAGTACTTAAATGT",
                      "ACGTCCGTACTGATCGATTCCGTGATT"))
cT <- codonTable(dna)
codonCounts(cT)
getlen(cT)
getKO(cT)
cT <- setKO(cT, c("K00001", "K00002"))
getKO(cT)

# convert matrix containing codon counts to codonTable
mat <- matrix(sample(1:10, 122, replace = TRUE), nrow = 2)
codonTable(mat) # produces informative warning

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