Learn R Programming

BioPhysConnectoR (version 1.6-10)

get.mie: Mutual Information

Description

The joint information content (mutual information) for an alignment is computed. Considering the gap problem there are four ways to compute it.

Usage

get.mie(aln, method = "ORMI", gapchar = NULL, nullmod = NULL, logMI = FALSE)

Arguments

aln
matrix of which the mutual information will be computed
method
method, that is used for the computation (see details)
gapchar
symbols of the input matrix that should be handled as gaps. These symbols are omitted in the computations (see details)
nullmod
integer specifying how many shuffle runs should be performed
logMI
boolean, if TRUE the log(MI) will be calculated, default is FALSE

Value

  • Return value is the MI matrix per default. If a null model should be computed the returned value is a list of matrices.
  • $miMI matrix
  • $nullmodelMI matrix of the null model
  • $nullsquarematrix of the averaged MI squared values for the null model
  • $nullvarmatrix of the variance of each MI value over the whole shuffle run for the null model

Details

Methods: The mutual information (MI) is computed as follows: $$I(X,Y)=\sum_{x\in X}\sum_{y\in Y} p(x,y)\cdot\log_2\left(\frac{p(x,y)}{p(x)\cdot p(y)}\right)$$

$$I(X,Y)=H(X)+H(Y)-H(X,Y)$$ [object Object],[object Object],[object Object],[object Object]

See Also

get.entropy, get.entropy2p, freq1p, freq2p

Examples

Run this code
seqa<-unlist(strsplit("PQITLWQRPLVTIKIGGQL",split=""))
seqb<-unlist(strsplit("PQITLWKRPLVTIRIGGQL",split=""))
seqc<-unlist(strsplit("PQITLWQRPLVTIKIGGQL",split=""))
a<-matrix(c(seqa,seqb,seqc),nrow=3,byrow=TRUE)
mi<-get.mie(a)
mi2<-get.mie(a, method = "SUMI", gapchar = "-")
mi_null<-get.mie(a,nullmod=100)
mi2_null<-get.mie(a, method = "SUMI", gapchar = "-",nullmod=100)

Run the code above in your browser using DataLab