Skip to contents

Returns the Conserved or the Non-conserved Regions from a MSA.

Usage

conserved_regions(x, ...)

# S4 method for Automorphism
conserved_regions(
  x,
  conserved = TRUE,
  output = c("all_pairs", "unique_pairs", "unique")
)

# S4 method for AutomorphismList
conserved_regions(
  x,
  conserved = TRUE,
  output = c("all_pairs", "unique_pairs", "unique"),
  num.cores = multicoreWorkers(),
  tasks = 0L,
  verbose = FALSE
)

# S4 method for AutomorphismByCoef
conserved_regions(
  x,
  conserved = TRUE,
  output = c("all_pairs", "unique_pairs", "unique")
)

# S4 method for AutomorphismByCoefList
conserved_regions(
  x,
  conserved = TRUE,
  output = c("all_pairs", "unique_pairs", "unique")
)

Arguments

x

A Automorphism-class, a AutomorphismList-class, a AutomorphismByCoef or a AutomorphismByCoefList class object.

...

Not in use.

conserved

Logical, Whether to return the conserved or the non-conserved regions.

output

A character string. Type of output.

num.cores, tasks

Integers. Argument num.cores denotes the number of cores to use, i.e. at most how many child processes will be run simultaneously (see bplapply function from BiocParallel package). Argument tasks denotes the number of tasks per job. value must be a scalar integer >= 0L. In this documentation a job is defined as a single call to a function, such as bplapply. A task is the division of the \(X\) argument into chunks. When tasks == 0 (default), \(X\) is divided as evenly as possible over the number of workers (see MulticoreParam from BiocParallel package).

verbose

logic(1). If TRUE, enable progress bar.

Value

A AutomorphismByCoef class object containing the requested regions.

Examples

## Load dataset
data("autm", package = "GenomAutomorphism")
conserved_regions(autm[1:3])
#> AutomorphismByCoef object with 3 ranges and 7 metadata columns:
#>       seqnames    ranges strand |        seq1        seq2         aa1
#>          <Rle> <IRanges>  <Rle> | <character> <character> <character>
#>   [1]        1       1-3      + |         ATG         ATG           M
#>   [2]        1       1-3      + |         GAG         GAG           E
#>   [3]        1       1-3      + |         AGC         AGC           S
#>               aa2      autm    mut_type        cube
#>       <character> <numeric> <character> <character>
#>   [1]           M         1         HHH        ACGT
#>   [2]           E         1         HHH        ACGT
#>   [3]           S         1         HHH        ACGT
#>   -------
#>   seqinfo: 1 sequence from an unspecified genome; no seqlengths
## Load automorphism found COVID datatset
data("covid_autm", package = "GenomAutomorphism")

## Conserved regions in the first 100 codons
conserv <- conserved_regions(covid_autm[1:100], output = "unique")
conserv
#> GRanges object with 7 ranges and 2 metadata columns:
#>       seqnames    ranges strand |      autm        cube
#>          <Rle> <IRanges>  <Rle> | <numeric> <character>
#>   [1]        1      1-19      + |         1        ACGT
#>   [2]        1     21-44      + |         1        ACGT
#>   [3]        1     47-52      + |         1        ACGT
#>   [4]        1     54-60      + |         1        ACGT
#>   [5]        1     62-80      + |         1        ACGT
#>   [6]        1     83-91      + |         1        ACGT
#>   [7]        1    93-100      + |         1        ACGT
#>   -------
#>   seqinfo: 1 sequence from an unspecified genome; no seqlengths