Learn R Programming

Bios2cor (version 1.2)

gauss_weighting: Creation of a gaussian weighting filter for each element

Description

Given an entropy object (result of the entropy or of the rotamer_entropyfunction), creates a vector with a gaussian weighting of each element based on the entropy value. The vector will be used to give different weights to each element in the centered_pca function.

Usage

gauss_weighting(entropy, L= 0.1, lambda= 0)

Arguments

entropy

An object created by the entropy function

L

A value indicating the gaussian curve's width. It is recommanded to be between 0.05 and 0.2. (0.1 by default)

lambda

A value between 0 and 1 that will be added to the gaussian weighting score to avoid zero problems

Value

A numeric matrix that contains a weighting score for each position in the alignment based on gaussian function.

Details

The object returned by the entropy function contains an entropy score for each position. The weighting of each position is calculated as follows : $$weighting[i]= e^{\frac{-(entropy[i]-0.5)^2}{L}}$$

Then the lambda constant is applied as follow : $$weighting= lambda + (1-lambda) * weigthing$$

Examples

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

  #Creating ENTROPY object
  entropy <- entropy(align)
  
  filter <- gauss_weighting(entropy, L= 0.1, lambda= 1)
  
# }

Run the code above in your browser using DataLab