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

1
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

Details

Methods: The mutual information (MI) is computed as follows:

I(X,Y)=sum_(x in X) sum_(y in Y) p(x,y) log_2(p(x,y)/(p(x) p(y)))

I(X,Y)=H(X)+H(Y)-H(X,Y)

ORMI

In the ORiginal MI gaps are treated simply as any other character.

SUMI

The SUbset MI omits for each pair of columns all the rows with at least one gap character for the computation.

DEMI

In the Delta Entropy MI the entropies for the columns are computed separately by leaving out any gap characters. The joint entropy also considers only rows without any gap character. DEMI follows as H(X)+H(Y)-H(X,Y).

ESMI

The Enhanced Sampling MI omits the gap characters and rows with gaps for the computation of the probabilities. The information content is computed via the probabilites.

The null model is computed by shuffling each column content and computing the resulting MI. Over all shuffle runs the MI values in each entry of the matrix is averaged. The averaged squared MI values and the variance is computed as well.

Value

Return value is the MI matrix per default.
If a null model should be computed the returned value is a list of matrices.

$mi

MI matrix

$nullmodel

MI matrix of the null model

$nullsquare

matrix of the averaged MI squared values for the null model

$nullvar

matrix of the variance of each MI value over the whole shuffle run for the null model

Author(s)

Franziska Hoffgaard

See Also

get.entropy, get.entropy2p, freq1p, freq2p

Examples

1
2
3
4
5
6
7
8
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)