get_mutscore: Get Mutation Score from an AAindex or a Mutation/Distance...

get_mutscoreR Documentation

Get Mutation Score from an AAindex or a Mutation/Distance Matrix

Description

This function is applied to get the mutation or contact potential scores representing the similarity/distance between amino acids corresponding to substitution mutations. The scores are retrieved from a mutation matrix or a statistical protein contact potentials matrix from AAindex (ver.9.2).

Alternatively, the mutation scores can be estimated based on an user mutation matrix, for example, see aminoacid_dist and codon_dist_matrix.

Usage

get_mutscore(aa1, aa2, ...)

## S4 method for signature 'character,character'
get_mutscore(
  aa1,
  aa2,
  acc = NULL,
  aaindex = NULL,
  mutmat = NULL,
  alphabet = c("AA", "DNA"),
  num.cores = 1L,
  tasks = 0L,
  verbose = FALSE,
  ...
)

## S4 method for signature 'BaseSeq,missing'
get_mutscore(
  aa1,
  aa2,
  acc = NULL,
  aaindex = NULL,
  mutmat = NULL,
  alphabet = c("AA", "DNA"),
  stat = mean,
  numcores = 1L,
  num.cores = 1L,
  tasks = 0L,
  output = c("dist", "matrix", "vector"),
  na.rm = TRUE,
  verbose = TRUE,
  ...
)

## S4 method for signature 'DNAStringSet,missing'
get_mutscore(
  aa1,
  aa2,
  acc = NULL,
  aaindex = NULL,
  mutmat = NULL,
  alphabet = c("AA", "DNA"),
  stat = mean,
  num.cores = 1L,
  tasks = 0L,
  verbose = TRUE,
  output = c("dist", "matrix", "vector"),
  na.rm = TRUE,
  ...
)

## S4 method for signature 'DNAMultipleAlignment,missing'
get_mutscore(
  aa1,
  aa2,
  acc = NULL,
  aaindex = NULL,
  mutmat = NULL,
  alphabet = c("AA", "DNA"),
  stat = mean,
  num.cores = 1L,
  tasks = 0L,
  verbose = TRUE,
  output = c("dist", "matrix", "vector"),
  na.rm = TRUE,
  ...
)

Arguments

aa1, aa2

A simple character representing an amino acids or a character string of letter from the amino acid alphabet or base-triplets from the DNA/RNA alphabet. If aa1 is an object from any of the classes: BaseSeq, DNAStringSet, or DNAMultipleAlignment, then argument aa2 is not required.

...

Not in use.

acc

Accession id for a specified mutation or contact potential matrix.

aaindex

Database where the requested accession id is locate. The possible values are: "aaindex2" or "aaindex3".

mutmat

A mutation or any score matrix provided by the user.

alphabet

Whether the alphabet is from the 20 amino acid (AA) or four (DNA)/RNA base alphabet. This would prevent mistakes, i.e., the strings "ACG" would be a base-triplet on the DNA alphabet or simply the amino acid sequence of alanine, cysteine, and glutamic acid.

num.cores, tasks

Parameters for parallel computation using package BiocParallel-package: the number of cores to use, i.e. at most how many child processes will be run simultaneously (see bplapply and the number of tasks per job (only for Linux OS).

verbose

Optional. Only if num.cores > 1. If TRUE, prints the function log to stdout.

stat

Statistic that will be used to summarize the scores of the DNA sequences provided. Only if aa1 is an object from any of the classes: BaseSeq, DNAStringSet, or DNAMultipleAlignment.

numcores

An integer to setup the number of parallel workers via makeCluster.

output

Optional. Class of the returned object. Only if aa1 is an object from any of the classes: BaseSeq, DNAStringSet, or DNAMultipleAlignment.

na.rm

a logical evaluating to TRUE or FALSE indicating whether NA values should be stripped before the computation proceeds.

Details

If a score matrix is provided by the user, then it must be a symmetric matrix 20x20.

Value

A single numeric score or a numerical vector, or if aa1 is an object from any of the classes: BaseSeq, DNAStringSet, or DNAMultipleAlignment, then depending on the user selection the returned object will be:

  1. A lower diagonal numerical vector of the sequence pairwise scores.

  2. A dist-class object.

  3. A whole score matrix.

Author(s)

Robersy Sanchez https://genomaths.com

See Also

aa_mutmat, aaindex2 and aaindex3.

Examples

## A single amino acids substitution mutation
get_mutscore("A", "C", acc = "MIYS930101", aaindex = "aaindex2")

## A tri-peptide mutation
get_mutscore(aa1 = "ACG", aa2 = "ATG", acc = "MIYS930101",
            aaindex = "aaindex2", alphabet = "AA")

## A single base-triple mutation, i.e., a single amino acid substitution 
## mutation
get_mutscore(aa1 = "ACG", aa2 = "CTA", acc = "MIYS930101",
            aaindex = "aaindex2", alphabet = "DNA")

## Peptides can be also written as:
get_mutscore(aa1 = c("A","C","G"), aa2 = c("C","T","A"), 
            acc = "MIYS930101", aaindex = "aaindex2", alphabet = "AA")

genomaths/GenomAutomorphism documentation built on May 10, 2024, 12:11 a.m.