Skip to contents

ListCodonMatrix-class objects are generated by function codon_matrix.

Usage

ListCodonMatrix(object, cube, group, seq_alias = NULL, names = NULL)

valid.ListCodonMatrix(x)

Arguments

object

A list of CodonMatrix-class objects

x

A 'ListCodonMatrix-class' object

Examples

## ListCodonMatrix-class objects are generated by function 'codon_matrix'.
## Let's create DNAStringSet-class object
base <- DNAStringSet(x = c( seq1 ='ACGTGATCAAGT',
                            seq2 = 'GTGTGATCCAGT',
                            seq3 = 'TCCTGATCAGGT'))

x1 <- codon_matrix(base)
x1
#> ListCodonMatrix object of length: 4
#> Seq.Alias: codon.1 codon.2 codon.3 codon.4 ...
#> 
#> ------- 
#> $codon.1
#> CodonMatrix object with 3 ranges and 3 metadata columns:
#>       seqnames    ranges strand |        S1        S2        S3
#>          <Rle> <IRanges>  <Rle> | <numeric> <numeric> <numeric>
#>   [1]        1       1-3      + |         0         2         3
#>   [2]        1       1-3      + |         1         3         1
#>   [3]        1       1-3      + |         2         2         1
#>   -------
#>   seqinfo: 1 sequence from an unspecified genome; no seqlengths
#> 
#> 
#> $codon.2
#> CodonMatrix object with 3 ranges and 3 metadata columns:
#>     seqnames    ranges strand |        S1        S2        S3
#>        <Rle> <IRanges>  <Rle> | <numeric> <numeric> <numeric>
#>   4        1       4-6      + |         3         3         3
#>   5        1       4-6      + |         2         2         2
#>   6        1       4-6      + |         0         0         0
#>   -------
#>   seqinfo: 1 sequence from an unspecified genome; no seqlengths
#> 
#> ...
#> 
#> <2 more CodonMatrix element(s)>
#> Three slots: 'DataList', 'group', 'cube' & 'seq_alias'
#> ------- 

## Extract the first element
x1[1]
#> ListCodonMatrix object of length: 1
#> Seq.Alias: codon.1 codon.2 codon.3 codon.4 
#> 
#> ------- 
#> $codon.1
#> CodonMatrix object with 3 ranges and 3 metadata columns:
#>       seqnames    ranges strand |        S1        S2        S3
#>          <Rle> <IRanges>  <Rle> | <numeric> <numeric> <numeric>
#>   [1]        1       1-3      + |         0         2         3
#>   [2]        1       1-3      + |         1         3         1
#>   [3]        1       1-3      + |         2         2         1
#>   -------
#>   seqinfo: 1 sequence from an unspecified genome; no seqlengths
#> Three slots: 'DataList', 'group', 'cube' & 'seq_alias'
#> ------- 
x1$codon.1
#> CodonMatrix object with 3 ranges and 3 metadata columns:
#>       seqnames    ranges strand |        S1        S2        S3
#>          <Rle> <IRanges>  <Rle> | <numeric> <numeric> <numeric>
#>   [1]        1       1-3      + |         0         2         3
#>   [2]        1       1-3      + |         1         3         1
#>   [3]        1       1-3      + |         2         2         1
#>   -------
#>   seqinfo: 1 sequence from an unspecified genome; no seqlengths
x1[[1]]
#> CodonMatrix object with 3 ranges and 3 metadata columns:
#>       seqnames    ranges strand |        S1        S2        S3
#>          <Rle> <IRanges>  <Rle> | <numeric> <numeric> <numeric>
#>   [1]        1       1-3      + |         0         2         3
#>   [2]        1       1-3      + |         1         3         1
#>   [3]        1       1-3      + |         2         2         1
#>   -------
#>   seqinfo: 1 sequence from an unspecified genome; no seqlengths