Learn R Programming

Bios2cor (version 1.2)

omes: OMES(Observed minus Expected Squared) function

Description

Calculates the difference between the observed and expected occurrences of each possible pair of amino acids (x, y) at positions i and j of the alignment

Usage

omes(align, fileHelix= NULL , diag= 0, fileCSV= NULL, gap_val= 0.8, z_score= TRUE)

Arguments

align

An object of class 'align' created by the import.msf or the import.fasta function from a sequence alignment

fileHelix

A string of characters that indicates the file containing the positions of the anchor residues in the sequence alignment. To be used for the analysis of GPCR sequences. Default is NULL.

diag

A numeric value indicating the score of the diagonal elements in the scoring matrix. Default is 0.

fileCSV

A string of characters indicating the name of the csv file where the output matrix will be saved. Default is NULL.

gap_val

Numeric value indicating the gap ratio at a given position for this position to be taken into account. This value must be between 0 and 0.8. Default is 0.8, which means that positions with more than 80 percent of gaps will not be taken into account.

z_score

A logical value to perform a Z-score normalisation of the covariation matrix (TRUE) or not (FALSE). Default is TRUE.

Value

A list of two elements : a matrix containing a correlation score for each pair of elements and, optionally, a matrix containing the Z-scores

Details

The OMES score at position [i,j] has been computed with the following formula :

$${OMES(i,j)} = \frac{1}{N(i,j)} \sum_{x,y}^{ }(N_{x,y}^{obs}(i,j)-N_{x,y}^{ex}(i,j))^2$$

with : \(N_{x,y}^{ex}(i,j) = p_{x}(i)p_{y}(j)N\)

where :

  • \(N_{x,y}^{obs}(i,j)\)is number of times that each (x,y) pair is observed at positions i and j

  • \(N_{x,y}^{ex}(i,j)\)is number of times that each (x,y) pair would be expected, based on the frequency of residues x and y at positions i and j

  • \(N(i,j)\)is the number of sequences in the alignment with non-gapped residues at positions i and j

  • \(p_{x}(i)\)is the frequency of amino acid x at position i

  • \(p_{y}(j)\)is the frequency of amino acid y at position j

References

Fodor AA and Aldrich RW. Influence of conservation on calculations of amino acid covariance in multiple sequence alignments. Proteins. 2004;56(2):211-21.

Examples

Run this code
# NOT RUN {
   msf <- system.file("msa/toy_align.msf", package = "Bios2cor")
  align <- import.msf(msf)

  #Creating OMES object
  #omes <- omes(align,fileHelix= NULL , diag= 0, fileCSV= NULL, gap_val= 0.8, z_score= TRUE)
  omes <- omes(align)
# }

Run the code above in your browser using DataLab