
A class definition to store list of Automorphism class objects.
Source:R/allClasses.R, R/as.AutomorphismList.R
AutomorphismList.RdA class definition to store list of Automorphism class objects
derived from the pairwise automorphism estimation from pairwise
alignments. Objects from this class are created by function
automorphisms and as.AutomorphismList.
AutomorphismList-class methods
as.AutomorphismList(x):
as.AutomorphismList function transform a list of
GRanges-class, a
GRangesList-class, a list of
data.frame or a
DataFrame-class
objects into a AutomorphismList-class object.
as.list(x)
It transforms a list of Automorphism-class objects into an AutomorphismList-class object.
as(x, "GRangesList")
It transforms a GRangesList of
Automorphism-class objects into an
'AutomorphismList-class' object.
Examples
## Load datasets
data("autm", "brca1_autm")
## Transforming a list of Automorphisms into an AutomorphismList object
lista <- list(human = brca1_autm[[1]], gorilla = brca1_autm[[2]])
as.AutomorphismList(lista)
#> AutomorphismList object of length: 2
#> names(2): human gorilla
#> -------
#> Automorphism object with 761 ranges and 8 metadata columns:
#> seqnames ranges strand | seq1 seq2 aa1
#> <Rle> <IRanges> <Rle> | <character> <character> <character>
#> [1] 1 1 + | ATG ATG M
#> [2] 1 2 + | GAT GAT D
#> [3] 1 3 + | TTA TTA L
#> [4] 1 4 + | TCT TCT S
#> [5] 1 5 + | GCT GCT A
#> ... ... ... ... . ... ... ...
#> [757] 1 757 + | CAC CAC H
#> [758] 1 758 + | AGC AGC S
#> [759] 1 759 + | CAC CAC H
#> [760] 1 760 + | TAC TAC Y
#> [761] 1 761 + | TGA TGA *
#> aa2 coord1 coord2 autm cube
#> <character> <numeric> <numeric> <numeric> <character>
#> [1] M 50 50 1 ACGT
#> [2] D 11 11 1 ACGT
#> [3] L 60 60 1 ACGT
#> [4] S 31 31 1 ACGT
#> [5] A 27 27 1 ACGT
#> ... ... ... ... ... ...
#> [757] H 5 5 1 ACGT
#> [758] S 33 33 1 ACGT
#> [759] H 5 5 1 ACGT
#> [760] Y 13 13 1 ACGT
#> [761] * 44 44 1 ACGT
#> -------
#> seqinfo: 1 sequence from an unspecified genome; no seqlengths
#> ...
#> <1 more DFrame element(s)>
#> Two slots: 'DataList' & 'SeqRanges'
#> -------
## Alternatively we can set
aut <- as.list(brca1_autm[seq(2)])
class(aut)
#> [1] "list"
## And reverse it
aut <- as.AutomorphismList(aut)
aut
#> AutomorphismList object of length: 2
#> names(2): human_1.human_2 human_1.gorilla_1
#> -------
#> Automorphism object with 761 ranges and 8 metadata columns:
#> seqnames ranges strand | seq1 seq2 aa1
#> <Rle> <IRanges> <Rle> | <character> <character> <character>
#> [1] 1 1 + | ATG ATG M
#> [2] 1 2 + | GAT GAT D
#> [3] 1 3 + | TTA TTA L
#> [4] 1 4 + | TCT TCT S
#> [5] 1 5 + | GCT GCT A
#> ... ... ... ... . ... ... ...
#> [757] 1 757 + | CAC CAC H
#> [758] 1 758 + | AGC AGC S
#> [759] 1 759 + | CAC CAC H
#> [760] 1 760 + | TAC TAC Y
#> [761] 1 761 + | TGA TGA *
#> aa2 coord1 coord2 autm cube
#> <character> <numeric> <numeric> <numeric> <character>
#> [1] M 50 50 1 ACGT
#> [2] D 11 11 1 ACGT
#> [3] L 60 60 1 ACGT
#> [4] S 31 31 1 ACGT
#> [5] A 27 27 1 ACGT
#> ... ... ... ... ... ...
#> [757] H 5 5 1 ACGT
#> [758] S 33 33 1 ACGT
#> [759] H 5 5 1 ACGT
#> [760] Y 13 13 1 ACGT
#> [761] * 44 44 1 ACGT
#> -------
#> seqinfo: 1 sequence from an unspecified genome; no seqlengths
#> ...
#> <1 more DFrame element(s)>
#> Two slots: 'DataList' & 'SeqRanges'
#> -------
## Let's get the element names from object 'aut'
names(aut)
#> [1] "human_1.human_2" "human_1.gorilla_1"
## Let's assign new names
names(aut) <- c("human_1", "gorilla_1")
names(aut)
#> [1] "human_1" "gorilla_1"
## Transforming a GRangesList of Automorphisms into an AutomorphismList
## object
lista <- as(lista, "GRangesList")
as.AutomorphismList(lista)
#> AutomorphismList object of length: 2
#> names(2): human gorilla
#> -------
#> Automorphism object with 761 ranges and 8 metadata columns:
#> seqnames ranges strand | seq1 seq2 aa1
#> <Rle> <IRanges> <Rle> | <character> <character> <character>
#> [1] 1 1 + | ATG ATG M
#> [2] 1 2 + | GAT GAT D
#> [3] 1 3 + | TTA TTA L
#> [4] 1 4 + | TCT TCT S
#> [5] 1 5 + | GCT GCT A
#> ... ... ... ... . ... ... ...
#> [757] 1 757 + | CAC CAC H
#> [758] 1 758 + | AGC AGC S
#> [759] 1 759 + | CAC CAC H
#> [760] 1 760 + | TAC TAC Y
#> [761] 1 761 + | TGA TGA *
#> aa2 coord1 coord2 autm cube
#> <character> <numeric> <numeric> <numeric> <character>
#> [1] M 50 50 1 ACGT
#> [2] D 11 11 1 ACGT
#> [3] L 60 60 1 ACGT
#> [4] S 31 31 1 ACGT
#> [5] A 27 27 1 ACGT
#> ... ... ... ... ... ...
#> [757] H 5 5 1 ACGT
#> [758] S 33 33 1 ACGT
#> [759] H 5 5 1 ACGT
#> [760] Y 13 13 1 ACGT
#> [761] * 44 44 1 ACGT
#> -------
#> seqinfo: 1 sequence from an unspecified genome; no seqlengths
#> ...
#> <1 more DFrame element(s)>
#> Two slots: 'DataList' & 'SeqRanges'
#> -------
## Transform a AutomorphismList-class object into an Automorphism-class
## object
unlist(brca1_autm[seq(2)])
#> Automorphism object with 1522 ranges and 8 metadata columns:
#> seqnames ranges strand | seq1 seq2
#> <Rle> <IRanges> <Rle> | <character> <character>
#> human_1.human_2 1 1 + | ATG ATG
#> human_1.human_2 1 2 + | GAT GAT
#> human_1.human_2 1 3 + | TTA TTA
#> human_1.human_2 1 4 + | TCT TCT
#> human_1.human_2 1 5 + | GCT GCT
#> ... ... ... ... . ... ...
#> human_1.gorilla_1 1 757 + | CAC CAC
#> human_1.gorilla_1 1 758 + | AGC AGC
#> human_1.gorilla_1 1 759 + | CAC CAC
#> human_1.gorilla_1 1 760 + | TAC TAC
#> human_1.gorilla_1 1 761 + | TGA TGA
#> aa1 aa2 coord1 coord2 autm
#> <character> <character> <numeric> <numeric> <numeric>
#> human_1.human_2 M M 50 50 1
#> human_1.human_2 D D 11 11 1
#> human_1.human_2 L L 60 60 1
#> human_1.human_2 S S 31 31 1
#> human_1.human_2 A A 27 27 1
#> ... ... ... ... ... ...
#> human_1.gorilla_1 H H 5 5 1
#> human_1.gorilla_1 S S 33 33 1
#> human_1.gorilla_1 H H 5 5 1
#> human_1.gorilla_1 Y Y 13 13 1
#> human_1.gorilla_1 * * 44 44 1
#> cube
#> <character>
#> human_1.human_2 ACGT
#> human_1.human_2 ACGT
#> human_1.human_2 ACGT
#> human_1.human_2 ACGT
#> human_1.human_2 ACGT
#> ... ...
#> human_1.gorilla_1 ACGT
#> human_1.gorilla_1 ACGT
#> human_1.gorilla_1 ACGT
#> human_1.gorilla_1 ACGT
#> human_1.gorilla_1 ACGT
#> -------
#> seqinfo: 1 sequence from an unspecified genome; no seqlengths
## Load a DNA sequence alignment
data("brca1_autm", package = "GenomAutomorphism")
names(brca1_autm)
#> [1] "human_1.human_2" "human_1.gorilla_1"
#> [3] "human_1.gorilla_2" "human_1.gorilla_3"
#> [5] "human_1.chimpanzee_1" "human_1.chimpanzee_2"
#> [7] "human_1.chimpanzee_3" "human_1.chimpanzee_4"
#> [9] "human_1.bonobos_1" "human_1.bonobos_2"
#> [11] "human_1.bonobos_3" "human_1.bonobos_4"
#> [13] "human_1.silvery_gibbon_1" "human_1.silvery_gibbon_1"
#> [15] "human_1.silvery_gibbon_3" "human_1.golden_monkey_1"
#> [17] "human_1.golden_monkey_2" "human_1.gelada_baboon"
#> [19] "human_1.bolivian_monkey" "human_2.gorilla_1"
#> [21] "human_2.gorilla_2" "human_2.gorilla_3"
#> [23] "human_2.chimpanzee_1" "human_2.chimpanzee_2"
#> [25] "human_2.chimpanzee_3" "human_2.chimpanzee_4"
#> [27] "human_2.bonobos_1" "human_2.bonobos_2"
#> [29] "human_2.bonobos_3" "human_2.bonobos_4"
#> [31] "human_2.silvery_gibbon_1" "human_2.silvery_gibbon_1"
#> [33] "human_2.silvery_gibbon_3" "human_2.golden_monkey_1"
#> [35] "human_2.golden_monkey_2" "human_2.gelada_baboon"
#> [37] "human_2.bolivian_monkey" "gorilla_1.gorilla_2"
#> [39] "gorilla_1.gorilla_3" "gorilla_1.chimpanzee_1"
#> [41] "gorilla_1.chimpanzee_2" "gorilla_1.chimpanzee_3"
#> [43] "gorilla_1.chimpanzee_4" "gorilla_1.bonobos_1"
#> [45] "gorilla_1.bonobos_2" "gorilla_1.bonobos_3"
#> [47] "gorilla_1.bonobos_4" "gorilla_1.silvery_gibbon_1"
#> [49] "gorilla_1.silvery_gibbon_1" "gorilla_1.silvery_gibbon_3"
#> [51] "gorilla_1.golden_monkey_1" "gorilla_1.golden_monkey_2"
#> [53] "gorilla_1.gelada_baboon" "gorilla_1.bolivian_monkey"
#> [55] "gorilla_2.gorilla_3" "gorilla_2.chimpanzee_1"
#> [57] "gorilla_2.chimpanzee_2" "gorilla_2.chimpanzee_3"
#> [59] "gorilla_2.chimpanzee_4" "gorilla_2.bonobos_1"
#> [61] "gorilla_2.bonobos_2" "gorilla_2.bonobos_3"
#> [63] "gorilla_2.bonobos_4" "gorilla_2.silvery_gibbon_1"
#> [65] "gorilla_2.silvery_gibbon_1" "gorilla_2.silvery_gibbon_3"
#> [67] "gorilla_2.golden_monkey_1" "gorilla_2.golden_monkey_2"
#> [69] "gorilla_2.gelada_baboon" "gorilla_2.bolivian_monkey"
#> [71] "gorilla_3.chimpanzee_1" "gorilla_3.chimpanzee_2"
#> [73] "gorilla_3.chimpanzee_3" "gorilla_3.chimpanzee_4"
#> [75] "gorilla_3.bonobos_1" "gorilla_3.bonobos_2"
#> [77] "gorilla_3.bonobos_3" "gorilla_3.bonobos_4"
#> [79] "gorilla_3.silvery_gibbon_1" "gorilla_3.silvery_gibbon_1"
#> [81] "gorilla_3.silvery_gibbon_3" "gorilla_3.golden_monkey_1"
#> [83] "gorilla_3.golden_monkey_2" "gorilla_3.gelada_baboon"
#> [85] "gorilla_3.bolivian_monkey" "chimpanzee_1.chimpanzee_2"
#> [87] "chimpanzee_1.chimpanzee_3" "chimpanzee_1.chimpanzee_4"
#> [89] "chimpanzee_1.bonobos_1" "chimpanzee_1.bonobos_2"
#> [91] "chimpanzee_1.bonobos_3" "chimpanzee_1.bonobos_4"
#> [93] "chimpanzee_1.silvery_gibbon_1" "chimpanzee_1.silvery_gibbon_1"
#> [95] "chimpanzee_1.silvery_gibbon_3" "chimpanzee_1.golden_monkey_1"
#> [97] "chimpanzee_1.golden_monkey_2" "chimpanzee_1.gelada_baboon"
#> [99] "chimpanzee_1.bolivian_monkey" "chimpanzee_2.chimpanzee_3"
#> [101] "chimpanzee_2.chimpanzee_4" "chimpanzee_2.bonobos_1"
#> [103] "chimpanzee_2.bonobos_2" "chimpanzee_2.bonobos_3"
#> [105] "chimpanzee_2.bonobos_4" "chimpanzee_2.silvery_gibbon_1"
#> [107] "chimpanzee_2.silvery_gibbon_1" "chimpanzee_2.silvery_gibbon_3"
#> [109] "chimpanzee_2.golden_monkey_1" "chimpanzee_2.golden_monkey_2"
#> [111] "chimpanzee_2.gelada_baboon" "chimpanzee_2.bolivian_monkey"
#> [113] "chimpanzee_3.chimpanzee_4" "chimpanzee_3.bonobos_1"
#> [115] "chimpanzee_3.bonobos_2" "chimpanzee_3.bonobos_3"
#> [117] "chimpanzee_3.bonobos_4" "chimpanzee_3.silvery_gibbon_1"
#> [119] "chimpanzee_3.silvery_gibbon_1" "chimpanzee_3.silvery_gibbon_3"
#> [121] "chimpanzee_3.golden_monkey_1" "chimpanzee_3.golden_monkey_2"
#> [123] "chimpanzee_3.gelada_baboon" "chimpanzee_3.bolivian_monkey"
#> [125] "chimpanzee_4.bonobos_1" "chimpanzee_4.bonobos_2"
#> [127] "chimpanzee_4.bonobos_3" "chimpanzee_4.bonobos_4"
#> [129] "chimpanzee_4.silvery_gibbon_1" "chimpanzee_4.silvery_gibbon_1"
#> [131] "chimpanzee_4.silvery_gibbon_3" "chimpanzee_4.golden_monkey_1"
#> [133] "chimpanzee_4.golden_monkey_2" "chimpanzee_4.gelada_baboon"
#> [135] "chimpanzee_4.bolivian_monkey" "bonobos_1.bonobos_2"
#> [137] "bonobos_1.bonobos_3" "bonobos_1.bonobos_4"
#> [139] "bonobos_1.silvery_gibbon_1" "bonobos_1.silvery_gibbon_1"
#> [141] "bonobos_1.silvery_gibbon_3" "bonobos_1.golden_monkey_1"
#> [143] "bonobos_1.golden_monkey_2" "bonobos_1.gelada_baboon"
#> [145] "bonobos_1.bolivian_monkey" "bonobos_2.bonobos_3"
#> [147] "bonobos_2.bonobos_4" "bonobos_2.silvery_gibbon_1"
#> [149] "bonobos_2.silvery_gibbon_1" "bonobos_2.silvery_gibbon_3"
#> [151] "bonobos_2.golden_monkey_1" "bonobos_2.golden_monkey_2"
#> [153] "bonobos_2.gelada_baboon" "bonobos_2.bolivian_monkey"
#> [155] "bonobos_3.bonobos_4" "bonobos_3.silvery_gibbon_1"
#> [157] "bonobos_3.silvery_gibbon_1" "bonobos_3.silvery_gibbon_3"
#> [159] "bonobos_3.golden_monkey_1" "bonobos_3.golden_monkey_2"
#> [161] "bonobos_3.gelada_baboon" "bonobos_3.bolivian_monkey"
#> [163] "bonobos_4.silvery_gibbon_1" "bonobos_4.silvery_gibbon_1"
#> [165] "bonobos_4.silvery_gibbon_3" "bonobos_4.golden_monkey_1"
#> [167] "bonobos_4.golden_monkey_2" "bonobos_4.gelada_baboon"
#> [169] "bonobos_4.bolivian_monkey" "silvery_gibbon_1.silvery_gibbon_1"
#> [171] "silvery_gibbon_1.silvery_gibbon_3" "silvery_gibbon_1.golden_monkey_1"
#> [173] "silvery_gibbon_1.golden_monkey_2" "silvery_gibbon_1.gelada_baboon"
#> [175] "silvery_gibbon_1.bolivian_monkey" "silvery_gibbon_1.silvery_gibbon_3"
#> [177] "silvery_gibbon_1.golden_monkey_1" "silvery_gibbon_1.golden_monkey_2"
#> [179] "silvery_gibbon_1.gelada_baboon" "silvery_gibbon_1.bolivian_monkey"
#> [181] "silvery_gibbon_3.golden_monkey_1" "silvery_gibbon_3.golden_monkey_2"
#> [183] "silvery_gibbon_3.gelada_baboon" "silvery_gibbon_3.bolivian_monkey"
#> [185] "golden_monkey_1.golden_monkey_2" "golden_monkey_1.gelada_baboon"
#> [187] "golden_monkey_1.bolivian_monkey" "golden_monkey_2.gelada_baboon"
#> [189] "golden_monkey_2.bolivian_monkey" "gelada_baboon.bolivian_monkey"
## Load a DNA sequence alignment
data("brca1_autm", package = "GenomAutomorphism")
x1 <- brca1_autm[seq(2)]
names(x1)
#> [1] "human_1.human_2" "human_1.gorilla_1"
## Let's assign a new names
names(x1) <- c("human_1.human_2.0", "human_1.gorilla_0")
names(x1)
#> [1] "human_1.human_2.0" "human_1.gorilla_0"
## Load a DNA sequence alignment
data("brca1_autm", package = "GenomAutomorphism")
## The list of the first three elements
autm_list <- as.list(brca1_autm[seq(3)])
autm_list
#> $human_1.human_2
#> Automorphism object with 761 ranges and 8 metadata columns:
#> seqnames ranges strand | seq1 seq2 aa1
#> <Rle> <IRanges> <Rle> | <character> <character> <character>
#> [1] 1 1 + | ATG ATG M
#> [2] 1 2 + | GAT GAT D
#> [3] 1 3 + | TTA TTA L
#> [4] 1 4 + | TCT TCT S
#> [5] 1 5 + | GCT GCT A
#> ... ... ... ... . ... ... ...
#> [757] 1 757 + | CAC CAC H
#> [758] 1 758 + | AGC AGC S
#> [759] 1 759 + | CAC CAC H
#> [760] 1 760 + | TAC TAC Y
#> [761] 1 761 + | TGA TGA *
#> aa2 coord1 coord2 autm cube
#> <character> <numeric> <numeric> <numeric> <character>
#> [1] M 50 50 1 ACGT
#> [2] D 11 11 1 ACGT
#> [3] L 60 60 1 ACGT
#> [4] S 31 31 1 ACGT
#> [5] A 27 27 1 ACGT
#> ... ... ... ... ... ...
#> [757] H 5 5 1 ACGT
#> [758] S 33 33 1 ACGT
#> [759] H 5 5 1 ACGT
#> [760] Y 13 13 1 ACGT
#> [761] * 44 44 1 ACGT
#> -------
#> seqinfo: 1 sequence from an unspecified genome; no seqlengths
#>
#> $human_1.gorilla_1
#> Automorphism object with 761 ranges and 8 metadata columns:
#> seqnames ranges strand | seq1 seq2 aa1
#> <Rle> <IRanges> <Rle> | <character> <character> <character>
#> [1] 1 1 + | ATG ATG M
#> [2] 1 2 + | GAT GAT D
#> [3] 1 3 + | TTA TTA L
#> [4] 1 4 + | TCT TCT S
#> [5] 1 5 + | GCT GCT A
#> ... ... ... ... . ... ... ...
#> [757] 1 757 + | CAC CAC H
#> [758] 1 758 + | AGC AGC S
#> [759] 1 759 + | CAC CAC H
#> [760] 1 760 + | TAC TAC Y
#> [761] 1 761 + | TGA TGA *
#> aa2 coord1 coord2 autm cube
#> <character> <numeric> <numeric> <numeric> <character>
#> [1] M 50 50 1 ACGT
#> [2] D 11 11 1 ACGT
#> [3] L 60 60 1 ACGT
#> [4] S 31 31 1 ACGT
#> [5] A 27 27 1 ACGT
#> ... ... ... ... ... ...
#> [757] H 5 5 1 ACGT
#> [758] S 33 33 1 ACGT
#> [759] H 5 5 1 ACGT
#> [760] Y 13 13 1 ACGT
#> [761] * 44 44 1 ACGT
#> -------
#> seqinfo: 1 sequence from an unspecified genome; no seqlengths
#>
#> $human_1.gorilla_2
#> Automorphism object with 761 ranges and 8 metadata columns:
#> seqnames ranges strand | seq1 seq2 aa1
#> <Rle> <IRanges> <Rle> | <character> <character> <character>
#> [1] 1 1 + | ATG ATG M
#> [2] 1 2 + | GAT GAT D
#> [3] 1 3 + | TTA TTA L
#> [4] 1 4 + | TCT TCT S
#> [5] 1 5 + | GCT GCT A
#> ... ... ... ... . ... ... ...
#> [757] 1 757 + | CAC CAC H
#> [758] 1 758 + | AGC AGC S
#> [759] 1 759 + | CAC CAC H
#> [760] 1 760 + | TAC TAC Y
#> [761] 1 761 + | TGA TGA *
#> aa2 coord1 coord2 autm cube
#> <character> <numeric> <numeric> <numeric> <character>
#> [1] M 50 50 1 ACGT
#> [2] D 11 11 1 ACGT
#> [3] L 60 60 1 ACGT
#> [4] S 31 31 1 ACGT
#> [5] A 27 27 1 ACGT
#> ... ... ... ... ... ...
#> [757] H 5 5 1 ACGT
#> [758] S 33 33 1 ACGT
#> [759] H 5 5 1 ACGT
#> [760] Y 13 13 1 ACGT
#> [761] * 44 44 1 ACGT
#> -------
#> seqinfo: 1 sequence from an unspecified genome; no seqlengths
#>