Learn R Programming

Bios2cor (version 1.2)

shuffle_all: Amino acids shuffle

Description

Given an alignment object, created by the import.fasta or import.msf function, shuffles all the residues from all the sequences to create a random multiple sequence alignment and calculates a correlation matrix with the selected method.

Usage

shuffle_all(
    align,
    method,
    fileHelix= NULL,
    gap_val= 0.8,
    z_score= TRUE,
    nb_iterations= 5
  )

Arguments

align

An object created by the import.msf or import.fasta function which requires an alignment file name

method

A string corresponding to selected correlation method. This should be one out of "OMES", "MIP","ELSC" and "MCBASC"

fileHelix

A file that contains the positions of the anchor residues in the sequence alignment. For use with GPCRs

gap_val

Authorized gap proportion per position. This value can be between 0 and 0.8 (0.8 by default), which means that positions with more than 80 percent of gaps will not be considered

z_score

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

nb_iterations

Number of times the alignment will be shuffled. Default is 5

Value

Returns a numeric matrix which is the averaged matrix obtained from re-itering "nb_iterations" times the computation of the correlation matrix from a random alignment with the same composition as the initial alignment

Details

Sequences from the initial alignment will be shuffled to yield a random alignment with the same average composition as the initial alignment. Ther correlation matrix of this random alignment will be calculated "nb_iterations" times, then averaged.

Examples

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

  #Shuffling alignment
  corr <- shuffle_all(align, method = "OMES", fileHelix= NULL, gap_val= 0.8, z_score= TRUE,
        nb_iterations= 3)
# }

Run the code above in your browser using DataLab