Learn R Programming

Bios2cor (version 1.2)

sigmoid_weighting: Sigmoid weighting for each position

Description

Given an entropy object (result of the entropy or of the rotamer_entropyfunction), creates a vector with a sigmoid 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

sigmoid_weighting(entropy, L= 10, inf_pt= 0.1, stability= TRUE)

Arguments

entropy

An object created by the entropy function

L

A value indicating the slope on the inflexion point. A value between 5 and 10 is recommanded. Default is 10

inf_pt

A value between 0 and 1 corresponding to the sigmoid curve inflexion point. Default is 0.1

stability

Logical value indicating whether sigmoid function favors low (TRUE) or high (FALSE) entropy values. Default is TRUE

Value

A numeric matrix that contains a weighting score for each position in the alignment based on sigmoid 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] = \left\{ \begin{array}{ll} \frac{1}{(1+e^(-L*( entropy[i]- inf_pt )))}, & "stability" = FALSE \\ \\ 1-(\frac{1}{(1+e^(-L*( entropy[i] - inf_pt)))}), & "stability" = TRUE \end{array} \right. $$ This option is useful to limit analysis to side chain dihedral angles with slow or fast moving angles (TRUE or FALSE stability option, respectively).

Examples

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

  #Creating ENTROPY object
  entropy <- entropy(align)
  
  filter <- sigmoid_weighting(entropy, L= 10, inf_pt= 0.1, stability= TRUE)
# }

Run the code above in your browser using DataLab