Learn R Programming

conMItion (version 0.2.1)

CMImat2mat: Normalized Conditional Mutual Information Between Two Matrices

Description

Computes the normalized conditional mutual information (CMI) between corresponding rows of two matrices, given a condition variable, normalized by their individual information content. CMI is calculated using the specified number of bins and spline order.

Usage

CMImat2mat(mat1, mat2, condi, bin = 6, sp_order = 2)

Value

A numeric vector representing the normalized conditional mutual information (CMI) between pairs of rows from `mat1` and `mat2`, conditioned on `condi`.

Arguments

mat1

A numeric matrix. For example, each row represents a gene and each column represents a sample.

mat2

Another numeric matrix to compare against. Must have the same dimensions as `mat1`.

condi

A numeric condition vector, matching the number of columns in `mat1`.

bin

An integer specifying the number of bins. Default is 6.

sp_order

An integer specifying the spline order. Must be less than `bin`. Default is 2.

Examples

Run this code
mat1 <- matrix(rnorm(10000), nrow = 100, ncol = 100)
mat2 <- matrix(rnorm(10000), nrow = 100, ncol = 100)
condi <- rnorm(100)
CMImat2mat(mat1, mat2, condi)

Run the code above in your browser using DataLab