Skip to contents

Extract the Coordinate Representation from DNA Sequences on Specified Abelian Group.

Usage

matrices(x, ...)

# S4 method for MatrixList
matrices(x)

# S4 method for CodonSeq
matrices(x)

# S4 method for DNAStringSet_OR_NULL
matrices(
  x,
  base_seq = TRUE,
  filepath = NULL,
  cube = "ACGT",
  group = c("Z4", "Z5", "Z64", "Z125", "Z4^3", "Z5^3"),
  start = NA,
  end = NA,
  chr = 1L,
  strand = "+"
)

Arguments

x

An object from a DNAStringSet or DNAMultipleAlignment class carrying the DNA pairwise alignment of two sequences.

...

Not in use.

base_seq

Logical. Whether to return the base or codon coordinates on the selected Abelian group. If codon coordinates are requested, then the number of the DNA bases in the given sequences must be multiple of 3.

filepath

A character vector containing the path to a file in fasta format to be read. This argument must be given if codon & base arguments are not provided.

cube

A character string denoting one of the 24 Genetic-code cubes, as given in references (2-3).

group

A character string denoting the group representation for the given base or codon as shown in reference (1).

start, end, chr, strand

Optional parameters required to build a GRanges-class. If not provided the default values given for the function definition will be used.

Value

The a list of vectors (group = c("Z4", "Z5", "Z64", "Z125") or a list of matrices (group = ("Z4^3", "Z5^3")) carrying the coordinate representation on the specified Abelian group.

Details

These are alternative ways to get the list of matrices of base/codon coordinate and the information on the codon sequence from CodonSeq and MatrixList class objects. These functions can either take the output from functions base_coord and matrices or to operate directly on a DNAStringSet or to retrieve the a DNA sequence alignment from a file.

base_seq parameter will determine whether to return the matrices of coordinate for a DNA or codon sequence. While in function seqranges, granges parameter will determine whether to return a GRanges-class object or a DataFrame.

References

  1. Robersy Sanchez, Jesus Barreto (2021) Genomic Abelian Finite Groups. doi: 10.1101/2021.06.01.446543

  2. M. V Jose, E.R. Morgado, R. Sanchez, T. Govezensky, The 24 possible algebraic representations of the standard genetic code in six or in three dimensions, Adv. Stud. Biol. 4 (2012) 119-152.PDF.

  3. R. Sanchez. Symmetric Group of the Genetic-Code Cubes. Effect of the Genetic-Code Architecture on the Evolutionary Process MATCH Commun. Math. Comput. Chem. 79 (2018) 527-560.

Author

Robersy Sanchez https://genomaths.com

Examples

## Load a pairwise alignment
data("aln", package = "GenomAutomorphism")
aln
#> DNAStringSet object of length 2:
#>     width seq
#> [1]    51 ACCTATGTTGGTATT---GCGCTCCAACTCCTTGGCTCTAGCTCACTACAT
#> [2]    51 ATCTATGTTGGTATTACGACGCTCCAATTCCTTGGGTCC------CTCCTT

## Coordinate representation of the aligned sequences on "Z4".
## A list of vectors
matrices(
    x = aln,
    base_seq = TRUE,
    filepath = NULL,
    cube = "ACGT",
    group = "Z4",
)
#> $coord1
#>  [1]  0  1  1  3  0  3  2  3  3  2  2  3  0  3  3 NA NA NA  2  1  2  1  3  1  1
#> [26]  0  0  1  3  1  1  3  3  2  2  1  3  1  3  0  2  1  3  1  0  1  3  0  1  0
#> [51]  3
#> 
#> $coord2
#>  [1]  0  3  1  3  0  3  2  3  3  2  2  3  0  3  3  0  1  2  0  1  2  1  3  1  1
#> [26]  0  0  3  3  1  1  3  3  2  2  2  3  1  1 NA NA NA NA NA NA  1  3  1  1  3
#> [51]  3
#> 

## Coordinate representation of the aligned sequences on "Z4".
## A list of matrices
matrices(
    x = aln,
    base_seq = FALSE,
    filepath = NULL,
    cube = "ACGT",
    group = "Z5^3",
)
#> $coord1
#>       [,1] [,2] [,3]
#>  [1,]    1    2    2
#>  [2,]    4    1    4
#>  [3,]    3    4    4
#>  [4,]    3    3    4
#>  [5,]    1    4    4
#>  [6,]    0    0    0
#>  [7,]    3    2    3
#>  [8,]    2    4    2
#>  [9,]    2    1    1
#> [10,]    2    4    2
#> [11,]    2    4    4
#> [12,]    3    3    2
#> [13,]    4    2    4
#> [14,]    1    3    2
#> [15,]    4    2    1
#> [16,]    2    4    1
#> [17,]    2    1    4
#> 
#> $coord2
#>       [,1] [,2] [,3]
#>  [1,]    1    4    2
#>  [2,]    4    1    4
#>  [3,]    3    4    4
#>  [4,]    3    3    4
#>  [5,]    1    4    4
#>  [6,]    1    2    3
#>  [7,]    1    2    3
#>  [8,]    2    4    2
#>  [9,]    2    1    1
#> [10,]    4    4    2
#> [11,]    2    4    4
#> [12,]    3    3    3
#> [13,]    4    2    2
#> [14,]    0    0    0
#> [15,]    0    0    0
#> [16,]    2    4    2
#> [17,]    2    4    4
#>