Skip to contents

For the sake of saving memory, each Automorphism-class objects is stored in an AutomorphismList-class, which does not inherits from a GRanges-class.

Usage

getAutomorphisms(x, ...)

# S4 method for AutomorphismList
getAutomorphisms(x)

# S4 method for list
getAutomorphisms(x)

# S4 method for DataFrame_OR_data.frame
getAutomorphisms(x)

Arguments

x

An AutomorphismList-class.

...

Not in use.

Value

This function returns an AutomorphismList-class

object as a list of Automorphism-class objects, which inherits from GRanges-class objects.

An AutomorphismList-class

An Automorphism-class

Details

This function just transform each Automorphism-class object into an object from the same class but now inheriting from a GRanges-class.

Examples

## Load a dataset
data("autm", package = "GenomAutomorphism")
aut <- mcols(autm)
aut ## This a DataFrame object
#> DataFrame with 7100 rows and 8 columns
#>             seq1        seq2         aa1         aa2    coord1    coord2
#>      <character> <character> <character> <character> <numeric> <numeric>
#> 1            ATG         ATG           M           M        50        50
#> 2            GAG         GAG           E           E        10        10
#> 3            AGC         AGC           S           S        33        33
#> 4            CTT         CTT           L           L        55        55
#> 5            GTT         GTC           V           V        59        57
#> ...          ...         ...         ...         ...       ...       ...
#> 7096         CTT         CTT           L           L        55        55
#> 7097         GTT         GTT           V           V        59        59
#> 7098         AAT         AAC           N           N         3         1
#> 7099         AAC         AAC           N           N         1         1
#> 7100         TAA         TAA           *           *        12        12
#>           autm        cube
#>      <numeric> <character>
#> 1            1        ACGT
#> 2            1        ACGT
#> 3            1        ACGT
#> 4            1        ACGT
#> 5           27        ACGT
#> ...        ...         ...
#> 7096         1        ACGT
#> 7097         1        ACGT
#> 7098        43        ACGT
#> 7099         1        ACGT
#> 7100         1        ACGT

## The natural ranges for the sequence (from 1 to length(aut)) are added
getAutomorphisms(aut)
#> Automorphism object with 7100 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      + |         GAG         GAG           E
#>      [3]        1         3      + |         AGC         AGC           S
#>      [4]        1         4      + |         CTT         CTT           L
#>      [5]        1         5      + |         GTT         GTC           V
#>      ...      ...       ...    ... .         ...         ...         ...
#>   [7096]        1      7096      + |         CTT         CTT           L
#>   [7097]        1      7097      + |         GTT         GTT           V
#>   [7098]        1      7098      + |         AAT         AAC           N
#>   [7099]        1      7099      + |         AAC         AAC           N
#>   [7100]        1      7100      + |         TAA         TAA           *
#>                  aa2    coord1    coord2      autm        cube
#>          <character> <numeric> <numeric> <numeric> <character>
#>      [1]           M        50        50         1        ACGT
#>      [2]           E        10        10         1        ACGT
#>      [3]           S        33        33         1        ACGT
#>      [4]           L        55        55         1        ACGT
#>      [5]           V        59        57        27        ACGT
#>      ...         ...       ...       ...       ...         ...
#>   [7096]           L        55        55         1        ACGT
#>   [7097]           V        59        59         1        ACGT
#>   [7098]           N         3         1        43        ACGT
#>   [7099]           N         1         1         1        ACGT
#>   [7100]           *        12        12         1        ACGT
#>   -------
#>   seqinfo: 1 sequence from an unspecified genome; no seqlengths

## A list of automorphisms
aut <- list(aut, aut)
getAutomorphisms(aut)
#> AutomorphismList object of length: 2
#> names(0): 
#> ------- 
#> Automorphism object with 7100 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      + |         GAG         GAG           E
#>      [3]        1         3      + |         AGC         AGC           S
#>      [4]        1         4      + |         CTT         CTT           L
#>      [5]        1         5      + |         GTT         GTC           V
#>      ...      ...       ...    ... .         ...         ...         ...
#>   [7096]        1      7096      + |         CTT         CTT           L
#>   [7097]        1      7097      + |         GTT         GTT           V
#>   [7098]        1      7098      + |         AAT         AAC           N
#>   [7099]        1      7099      + |         AAC         AAC           N
#>   [7100]        1      7100      + |         TAA         TAA           *
#>                  aa2    coord1    coord2      autm        cube
#>          <character> <numeric> <numeric> <numeric> <character>
#>      [1]           M        50        50         1        ACGT
#>      [2]           E        10        10         1        ACGT
#>      [3]           S        33        33         1        ACGT
#>      [4]           L        55        55         1        ACGT
#>      [5]           V        59        57        27        ACGT
#>      ...         ...       ...       ...       ...         ...
#>   [7096]           L        55        55         1        ACGT
#>   [7097]           V        59        59         1        ACGT
#>   [7098]           N         3         1        43        ACGT
#>   [7099]           N         1         1         1        ACGT
#>   [7100]           *        12        12         1        ACGT
#>   -------
#>   seqinfo: 1 sequence from an unspecified genome; no seqlengths
#> ...
#> <-1 more Automorphism element(s)>
#> Two slots: 'DataList' & 'SeqRanges'
#> ------- 

## Automorphism-class inherits from 'GRanges-class'
aut <- as(autm, "GRanges")
as(aut, "Automorphism")
#> Automorphism object with 7100 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      + |         GAG         GAG           E
#>      [3]        1         3      + |         AGC         AGC           S
#>      [4]        1         4      + |         CTT         CTT           L
#>      [5]        1         5      + |         GTT         GTC           V
#>      ...      ...       ...    ... .         ...         ...         ...
#>   [7096]        1      7096      + |         CTT         CTT           L
#>   [7097]        1      7097      + |         GTT         GTT           V
#>   [7098]        1      7098      + |         AAT         AAC           N
#>   [7099]        1      7099      + |         AAC         AAC           N
#>   [7100]        1      7100      + |         TAA         TAA           *
#>                  aa2    coord1    coord2      autm        cube
#>          <character> <numeric> <numeric> <numeric> <character>
#>      [1]           M        50        50         1        ACGT
#>      [2]           E        10        10         1        ACGT
#>      [3]           S        33        33         1        ACGT
#>      [4]           L        55        55         1        ACGT
#>      [5]           V        59        57        27        ACGT
#>      ...         ...       ...       ...       ...         ...
#>   [7096]           L        55        55         1        ACGT
#>   [7097]           V        59        59         1        ACGT
#>   [7098]           N         3         1        43        ACGT
#>   [7099]           N         1         1         1        ACGT
#>   [7100]           *        12        12         1        ACGT
#>   -------
#>   seqinfo: 1 sequence from an unspecified genome; no seqlengths