| Title: | Conditional Mutual Information Estimation for Multi-Omics Data |
|---|---|
| Description: | The biases introduced in association measures, particularly mutual information, are influenced by factors such as tumor purity, mutation burden, and hypermethylation. This package provides the estimation of conditional mutual information (CMI) and its statistical significance with a focus on its application to multi-omics data. Utilizing B-spline functions (inspired by Daub et al. (2004) <doi:10.1186/1471-2105-5-118>), the package offers tools to estimate the association between heterogeneous multi- omics data, while removing the effects of confounding factors. This helps to unravel complex biological interactions. In addition, it includes methods to evaluate the statistical significance of these associations, providing a robust framework for multi-omics data integration and analysis. This package is ideal for researchers in computational biology, bioinformatics, and systems biology seeking a comprehensive tool for understanding interdependencies in omics data. |
| Authors: | Gaojianyong Wang [aut, cre] |
| Maintainer: | Gaojianyong Wang <[email protected]> |
| License: | GPL-2 |
| Version: | 0.3.1 |
| Built: | 2026-05-26 18:40:29 UTC |
| Source: | https://github.com/cran/conMItion |
Computes the normalized conditional mutual information (CMI) between the same rows of two matrices, given two condition variables, normalized by their individual information content. CMI is calculated using the specified number of bins and spline order.
CMIBiCondimat2mat(mat1, mat2, condi1, condi2, bin = NULL, sp_order = NULL)CMIBiCondimat2mat(mat1, mat2, condi1, condi2, bin = NULL, sp_order = NULL)
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'. |
condi1 |
A numeric condition vector, matching the number of columns in 'mat1'. |
condi2 |
Another numeric condition vector, matching the number of columns in 'mat1'. |
bin |
An integer specifying the number of bins. Default is NULL. |
sp_order |
An integer specifying the spline order. Must be less than 'bin'. Default is NULL. |
A numeric vector representing the normalized conditional mutual information (CMI) between pairs of rows from 'mat1' and 'mat2', conditioned on 'condi1' and 'condi2'.
mat1 <- matrix(rnorm(10000), nrow = 100, ncol = 100) mat2 <- matrix(rnorm(10000), nrow = 100, ncol = 100) condi1 <- rnorm(100) condi2 <- rnorm(100) CMIBiCondimat2mat(mat1, mat2, condi1, condi2)mat1 <- matrix(rnorm(10000), nrow = 100, ncol = 100) mat2 <- matrix(rnorm(10000), nrow = 100, ncol = 100) condi1 <- rnorm(100) condi2 <- rnorm(100) CMIBiCondimat2mat(mat1, mat2, condi1, condi2)
Computes the normalized conditional mutual information (CMI) between each row of first matrix and each row of second matrix, given two condition variables, normalized by their individual information content. CMI is calculated using the specified number of bins and spline order.
CMIBiCondimat2matAll(mat1, mat2, condi1, condi2, bin = NULL, sp_order = NULL)CMIBiCondimat2matAll(mat1, mat2, condi1, condi2, bin = NULL, sp_order = NULL)
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 columns as 'mat1'. |
condi1 |
A numeric condition vector, matching the number of columns in 'mat1'. |
condi2 |
Another numeric condition vector, matching the number of columns in 'mat1'. |
bin |
An integer specifying the number of bins. Default is NULL. |
sp_order |
An integer specifying the spline order. Must be less than 'bin'. Default is NULL. |
A matrix where each element corresponds to the normalized conditional mutual information (CMI) between each row of 'mat1' and each row of 'mat2', conditioned on 'condi1' and 'condi2'.
mat1 <- matrix(rnorm(1000), nrow = 10, ncol = 100) mat2 <- matrix(rnorm(20000), nrow = 200, ncol = 100) condi1 <- rnorm(100) condi2 <- rnorm(100) CMIBiCondimat2matAll(mat1, mat2, condi1, condi2)mat1 <- matrix(rnorm(1000), nrow = 10, ncol = 100) mat2 <- matrix(rnorm(20000), nrow = 200, ncol = 100) condi1 <- rnorm(100) condi2 <- rnorm(100) CMIBiCondimat2matAll(mat1, mat2, condi1, condi2)
Computes the normalized conditional mutual information (CMI) between vectors sampled from two matrices, conditioned on two vectors, normalized by the individual information content. The sampling is done multiple times to generate a distribution.
CMIBiCondimat2matPermu( mat1, mat2, condi1, condi2, bin = NULL, sp_order = NULL, bulkIdx = 0, permutationTimes = 1000, seedNum = 99999999 )CMIBiCondimat2matPermu( mat1, mat2, condi1, condi2, bin = NULL, sp_order = NULL, bulkIdx = 0, permutationTimes = 1000, seedNum = 99999999 )
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'. |
condi1 |
A numeric condition vector, matching the number of columns in 'mat1'. |
condi2 |
Another numeric condition vector, matching the number of columns in 'mat'. |
bin |
An integer specifying the number of bins. Default is NULL. |
sp_order |
An integer specifying the spline order. Must be less than 'bin'. Default is NULL. |
bulkIdx |
Index to divide the task when processing many permutations. Default is 0. |
permutationTimes |
Number of permutations for sampling. Default is 1000. |
seedNum |
Seed for random number generation. Default is 99999999. |
A numeric vector of normalized conditional mutual information (CMI) values for each permutation.
mat1 <- matrix(rnorm(10000), nrow = 100, ncol = 100) mat2 <- matrix(rnorm(10000), nrow = 100, ncol = 100) condi1 <- rnorm(100) condi2 <- rnorm(100) CMIBiCondimat2matPermu(mat1, mat2, condi1, condi2)mat1 <- matrix(rnorm(10000), nrow = 100, ncol = 100) mat2 <- matrix(rnorm(10000), nrow = 100, ncol = 100) condi1 <- rnorm(100) condi2 <- rnorm(100) CMIBiCondimat2matPermu(mat1, mat2, condi1, condi2)
Computes the normalized conditional mutual information (CMI) between each row of a matrix and a vector, given two condition vectors, normalized by the mutual information of the vector with itself using the specified bins and spline order.
CMIBiCondimat2vec(mat, vec, condi1, condi2, bin = NULL, sp_order = NULL)CMIBiCondimat2vec(mat, vec, condi1, condi2, bin = NULL, sp_order = NULL)
mat |
A numeric matrix. For example, each row represents a gene and each column represents a sample. |
vec |
A numeric vector, with length equal to the number of columns in 'mat'. |
condi1 |
A numeric condition vector, matching the number of columns in 'mat'. |
condi2 |
Another numeric condition vector, matching the number of columns in 'mat'. |
bin |
An integer specifying the number of bins. Default is NULL. |
sp_order |
An integer specifying the spline order. Must be less than 'bin'. Default is NULL. |
A numeric vector representing the normalized conditional mutual information (CMI) between each row of 'mat' and 'vec', given 'condi1' and 'condi2'.
mat <- matrix(rnorm(10000), nrow = 100, ncol = 100) vec <- rnorm(100) condi1 <- rnorm(100) condi2 <- rnorm(100) CMIBiCondimat2vec(mat, vec, condi1, condi2)mat <- matrix(rnorm(10000), nrow = 100, ncol = 100) vec <- rnorm(100) condi1 <- rnorm(100) condi2 <- rnorm(100) CMIBiCondimat2vec(mat, vec, condi1, condi2)
Computes the conditional mutual information (CMI) between a random vector sampled from a matrix and a vector, conditioned on two vectors, normalized by the mutual information of the vector with itself. The sampling is done multiple times to generate a distribution.
CMIBiCondimat2vecPermu( mat, vec, condi1, condi2, bin = NULL, sp_order = NULL, bulkIdx = 0, permutationTimes = 1000, seedNum = 99999999 )CMIBiCondimat2vecPermu( mat, vec, condi1, condi2, bin = NULL, sp_order = NULL, bulkIdx = 0, permutationTimes = 1000, seedNum = 99999999 )
mat |
A numeric matrix. For example, each row represents a gene and each column represents a sample. |
vec |
A numeric vector, with length equal to the number of columns in 'mat'. |
condi1 |
A numeric condition vector, matching the number of columns in 'mat'. |
condi2 |
Another numeric condition vector, matching the number of columns in 'mat'. |
bin |
An integer specifying the number of bins. Default is NULL. |
sp_order |
An integer specifying the spline order. Must be less than 'bin'. Default is NULL. |
bulkIdx |
Index to divide the task when processing many permutations. Default is 0. |
permutationTimes |
Number of permutations for sampling. Default is 1000. |
seedNum |
Seed for random number generation. Default is 99999999. |
A numeric vector of normalized conditional mutual information (CMI) values for each permutation.
mat <- matrix(rnorm(10000), nrow = 100, ncol = 100) vec <- rnorm(100) condi1 <- rnorm(100) condi2 <- rnorm(100) CMIBiCondimat2vecPermu(mat, vec, condi1, condi2)mat <- matrix(rnorm(10000), nrow = 100, ncol = 100) vec <- rnorm(100) condi1 <- rnorm(100) condi2 <- rnorm(100) CMIBiCondimat2vecPermu(mat, vec, condi1, condi2)
Computes the normalized conditional mutual information (CMI) between the same 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.
CMImat2mat(mat1, mat2, condi, bin = NULL, sp_order = NULL)CMImat2mat(mat1, mat2, condi, bin = NULL, sp_order = NULL)
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 NULL. |
sp_order |
An integer specifying the spline order. Must be less than 'bin'. Default is NULL. |
A numeric vector representing the normalized conditional mutual information (CMI) between pairs of rows from 'mat1' and 'mat2', conditioned on 'condi'.
mat1 <- matrix(rnorm(10000), nrow = 100, ncol = 100) mat2 <- matrix(rnorm(10000), nrow = 100, ncol = 100) condi <- rnorm(100) CMImat2mat(mat1, mat2, condi)mat1 <- matrix(rnorm(10000), nrow = 100, ncol = 100) mat2 <- matrix(rnorm(10000), nrow = 100, ncol = 100) condi <- rnorm(100) CMImat2mat(mat1, mat2, condi)
Computes the normalized conditional mutual information (CMI) between each row of first matrix and each row of second matrix, given a condition variable, normalized by their individual information content. CMI is calculated using the specified number of bins and spline order.
CMImat2matAll(mat1, mat2, condi, bin = NULL, sp_order = NULL)CMImat2matAll(mat1, mat2, condi, bin = NULL, sp_order = NULL)
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 columns as 'mat1'. |
condi |
A numeric condition vector, matching the number of columns in 'mat1'. |
bin |
An integer specifying the number of bins. Default is NULL. |
sp_order |
An integer specifying the spline order. Must be less than 'bin'. Default is NULL. |
A matrix where each element corresponds to the normalized conditional mutual information (CMI) between each row of 'mat1' and each row of 'mat2', conditioned on 'condi'.
mat1 <- matrix(rnorm(1000), nrow = 10, ncol = 100) mat2 <- matrix(rnorm(20000), nrow = 200, ncol = 100) condi <- rnorm(100) CMImat2matAll(mat1, mat2, condi)mat1 <- matrix(rnorm(1000), nrow = 10, ncol = 100) mat2 <- matrix(rnorm(20000), nrow = 200, ncol = 100) condi <- rnorm(100) CMImat2matAll(mat1, mat2, condi)
Computes the normalized conditional mutual information (CMI) between vectors sampled from two matrices, conditioned on another vector, normalized by the individual information content. The sampling is done multiple times to generate a distribution.
CMImat2matPermu( mat1, mat2, condi, bin = NULL, sp_order = NULL, bulkIdx = 0, permutationTimes = 1000, seedNum = 99999999 )CMImat2matPermu( mat1, mat2, condi, bin = NULL, sp_order = NULL, bulkIdx = 0, permutationTimes = 1000, seedNum = 99999999 )
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 NULL. |
sp_order |
An integer specifying the spline order. Must be less than 'bin'. Default is NULL. |
bulkIdx |
Index to divide the task when processing many permutations. Default is 0. |
permutationTimes |
Number of permutations for sampling. Default is 1000. |
seedNum |
Seed for random number generation. Default is 99999999. |
A numeric vector of normalized conditional mutual information (CMI) values for each permutation.
mat1 <- matrix(rnorm(10000), nrow = 100, ncol = 100) mat2 <- matrix(rnorm(10000), nrow = 100, ncol = 100) condi <- rnorm(100) CMImat2matPermu(mat1, mat2, condi)mat1 <- matrix(rnorm(10000), nrow = 100, ncol = 100) mat2 <- matrix(rnorm(10000), nrow = 100, ncol = 100) condi <- rnorm(100) CMImat2matPermu(mat1, mat2, condi)
Computes the normalized conditional mutual information (CMI) between each row of a matrix and a vector, given a third condition vector, normalized by the mutual information of the vector with itself using the specified bins and spline order.
CMImat2vec(mat, vec, condi, bin = NULL, sp_order = NULL)CMImat2vec(mat, vec, condi, bin = NULL, sp_order = NULL)
mat |
A numeric matrix. For example, each row represents a gene and each column represents a sample. |
vec |
A numeric vector, with length equal to the number of columns in 'mat'. |
condi |
A numeric condition vector, matching the number of columns in 'mat'. |
bin |
An integer specifying the number of bins. Default is NULL. |
sp_order |
An integer specifying the spline order. Must be less than 'bin'. Default is NULL. |
A numeric vector representing the normalized conditional mutual information (CMI) between each row of 'mat' and 'vec', given 'condi'.
mat <- matrix(rnorm(10000), nrow = 100, ncol = 100) vec <- rnorm(100) condi <- rnorm(100) CMImat2vec(mat, vec, condi)mat <- matrix(rnorm(10000), nrow = 100, ncol = 100) vec <- rnorm(100) condi <- rnorm(100) CMImat2vec(mat, vec, condi)
Computes the conditional mutual information (CMI) between a random vector sampled from a matrix and a vector, conditioned on a third vector, normalized by the mutual information of the vector with itself. The sampling is done multiple times to generate a distribution.
CMImat2vecPermu( mat, vec, condi, bin = NULL, sp_order = NULL, bulkIdx = 0, permutationTimes = 1000, seedNum = 99999999 )CMImat2vecPermu( mat, vec, condi, bin = NULL, sp_order = NULL, bulkIdx = 0, permutationTimes = 1000, seedNum = 99999999 )
mat |
A numeric matrix. For example, each row represents a gene and each column represents a sample. |
vec |
A numeric vector, with length equal to the number of columns in 'mat'. |
condi |
A numeric condition vector, matching the number of columns in 'mat'. |
bin |
An integer specifying the number of bins. Default is NULL. |
sp_order |
An integer specifying the spline order. Must be less than 'bin'. Default is NULL. |
bulkIdx |
Index to divide the task when processing many permutations. Default is 0. |
permutationTimes |
Number of permutations for sampling. Default is 1000. |
seedNum |
Seed for random number generation. Default is 99999999. |
A numeric vector of normalized conditional mutual information (CMI) values for each permutation.
mat <- matrix(rnorm(10000), nrow = 100, ncol = 100) vec <- rnorm(100) condi <- rnorm(100) CMImat2vecPermu(mat, vec, condi)mat <- matrix(rnorm(10000), nrow = 100, ncol = 100) vec <- rnorm(100) condi <- rnorm(100) CMImat2vecPermu(mat, vec, condi)
Computes the correlation between a randomly sampled vector from a matrix and a given vector. The sampling is done multiple times to generate a distribution.
CORmat2vecPermu( mat, vec, cor_type = "pearson", bulkIdx = 0, permutationTimes = 1000, seedNum = 99999999 )CORmat2vecPermu( mat, vec, cor_type = "pearson", bulkIdx = 0, permutationTimes = 1000, seedNum = 99999999 )
mat |
A numeric matrix. For example, each row represents a gene and each column represents a sample. |
vec |
A numeric vector, with length equal to the number of columns in 'mat'. |
cor_type |
Type of correlation to calculate: "Pearson", "Kendall", or "Spearman". Default is "Pearson". |
bulkIdx |
Index to divide the task when processing many permutations. Default is 0. |
permutationTimes |
Number of permutations for sampling. Default is 1000. |
seedNum |
Seed for random number generation. Default is 99999999. |
A numeric vector of correlation values for each permutation.
mat <- matrix(rnorm(10000), nrow = 100, ncol = 100) vec <- rnorm(100) CORmat2vecPermu(mat, vec)mat <- matrix(rnorm(10000), nrow = 100, ncol = 100) vec <- rnorm(100) CORmat2vecPermu(mat, vec)
Computes the conditional mutual information I(x_1; x_2 | x_3) using the specified number of bins and spline order.
getCMI(x_1, x_2, x_3, bin = NULL, sp_order = NULL)getCMI(x_1, x_2, x_3, bin = NULL, sp_order = NULL)
x_1 |
A numeric vector for the first variable. |
x_2 |
A numeric vector for the second variable. Must match 'x_1' length. |
x_3 |
A numeric vector for the condition variable. Must match 'x_1' length. |
bin |
An integer specifying the number of bins. Default is NULL. |
sp_order |
An integer specifying the spline order. Must be less than 'bin'. Default is NULL. |
A numeric value representing the conditional mutual information (CMI).
x_1 <- rnorm(100) x_2 <- rnorm(100) x_3 <- rnorm(100) getCMI(x_1, x_2, x_3)x_1 <- rnorm(100) x_2 <- rnorm(100) x_3 <- rnorm(100) getCMI(x_1, x_2, x_3)
Computes conditional mutual information I(x_1; x_2 | x_3, x_4) using the specified number of bins and spline order.
getCMIBiCondi(x_1, x_2, x_3, x_4, bin = NULL, sp_order = NULL)getCMIBiCondi(x_1, x_2, x_3, x_4, bin = NULL, sp_order = NULL)
x_1 |
A numeric vector for the first variable. |
x_2 |
A numeric vector for the second variable. Must match 'x_1' length. |
x_3 |
A numeric vector for the first condition variable. Must match 'x_1' length. |
x_4 |
A numeric vector for the second condition variable. Must match 'x_1' length. |
bin |
An integer specifying the number of bins. Default is NULL. |
sp_order |
An integer specifying the spline order. Must be less than 'bin'. Default is NULL. |
A numeric value representing the bivariate conditional mutual information (CMI).
x_1 <- rnorm(100) x_2 <- rnorm(100) x_3 <- rnorm(100) x_4 <- rnorm(100) getCMIBiCondi(x_1, x_2, x_3, x_4)x_1 <- rnorm(100) x_2 <- rnorm(100) x_3 <- rnorm(100) x_4 <- rnorm(100) getCMIBiCondi(x_1, x_2, x_3, x_4)
This function calculates the univariate entropy of a numeric vector using the specified number of bins and spline order.
getEntropy(x_1, bin = NULL, sp_order = NULL)getEntropy(x_1, bin = NULL, sp_order = NULL)
x_1 |
A numeric vector for the only variable. |
bin |
An integer specifying the number of bins. Default is NULL. |
sp_order |
An integer specifying the spline order. Must be less than 'bin'. Default is NULL. |
A numeric value representing the entropy of the vector.
x_1 <- rnorm(100) getEntropy(x_1)x_1 <- rnorm(100) getEntropy(x_1)
Computes the joint entropy of two numeric vectors using the specified number of bins and spline order.
getEntropyBi(x_1, x_2, bin = NULL, sp_order = NULL)getEntropyBi(x_1, x_2, bin = NULL, sp_order = NULL)
x_1 |
A numeric vector for the first variable. |
x_2 |
A numeric vector for the second variable. Must be the same length as 'x_1'. |
bin |
An integer specifying the number of bins. Default is NULL. |
sp_order |
An integer specifying the spline order. Must be less than 'bin'. Default is NULL. |
A numeric value representing the joint entropy of the two vectors.
x_1 <- rnorm(100) x_2 <- rnorm(100) getEntropyBi(x_1, x_2)x_1 <- rnorm(100) x_2 <- rnorm(100) getEntropyBi(x_1, x_2)
Computes the joint entropy of four numeric vectors using the specified number of bins and spline order.
getEntropyQuadri(x_1, x_2, x_3, x_4, bin = NULL, sp_order = NULL)getEntropyQuadri(x_1, x_2, x_3, x_4, bin = NULL, sp_order = NULL)
x_1 |
A numeric vector for the first variable. |
x_2 |
A numeric vector for the second variable. Must be the same length as 'x_1'. |
x_3 |
A numeric vector for the third variable. Must be the same length as 'x_1'. |
x_4 |
A numeric vector for the fourth variable. Must be the same length as 'x_1'. |
bin |
An integer specifying the number of bins. Default is NULL. |
sp_order |
An integer specifying the spline order. Must be less than 'bin'. Default is NULL. |
A numeric value representing the joint entropy of the four vectors.
x_1 <- rnorm(100) x_2 <- rnorm(100) x_3 <- rnorm(100) x_4 <- rnorm(100) getEntropyQuadri(x_1, x_2, x_3, x_4)x_1 <- rnorm(100) x_2 <- rnorm(100) x_3 <- rnorm(100) x_4 <- rnorm(100) getEntropyQuadri(x_1, x_2, x_3, x_4)
Computes the joint entropy of three numeric vectors using the specified number of bins and spline order.
getEntropyTri(x_1, x_2, x_3, bin = NULL, sp_order = NULL)getEntropyTri(x_1, x_2, x_3, bin = NULL, sp_order = NULL)
x_1 |
A numeric vector for the first variable. |
x_2 |
A numeric vector for the second variable. Must be the same length as 'x_1'. |
x_3 |
A numeric vector for the third variable. Must be the same length as 'x_1'. |
bin |
An integer specifying the number of bins. Default is NULL. |
sp_order |
An integer specifying the spline order. Must be less than 'bin'. Default is NULL. |
A numeric value representing the joint entropy of the three vectors.
x_1 <- rnorm(100) x_2 <- rnorm(100) x_3 <- rnorm(100) getEntropyTri(x_1, x_2, x_3)x_1 <- rnorm(100) x_2 <- rnorm(100) x_3 <- rnorm(100) getEntropyTri(x_1, x_2, x_3)
Computes the mutual information (MI) between two numeric vectors using the specified number of bins and spline order.
getMI(x_1, x_2, bin = NULL, sp_order = NULL)getMI(x_1, x_2, bin = NULL, sp_order = NULL)
x_1 |
A numeric vector representing the first variable. |
x_2 |
A numeric vector representing the second variable. Must be the same length as 'x_1'. |
bin |
An integer specifying the number of bins. Default is NULL. |
sp_order |
An integer specifying the spline order. Must be less than 'bin'. Default is NULL. |
A numeric value representing the mutual information (MI).
x_1 <- rnorm(100) x_2 <- rnorm(100) getMI(x_1, x_2)x_1 <- rnorm(100) x_2 <- rnorm(100) getMI(x_1, x_2)
Computes the joint mutual information I(x_1, x_2; x_3) using the specified number of bins and spline order.
getMIBi(x_1, x_2, x_3, bin = NULL, sp_order = NULL)getMIBi(x_1, x_2, x_3, bin = NULL, sp_order = NULL)
x_1 |
A numeric vector for the first variable. |
x_2 |
A numeric vector for the second variable. Must match the length of 'x_1'. |
x_3 |
A numeric vector for the third variable. Must match the length of 'x_1'. |
bin |
An integer specifying the number of bins. Default is NULL. |
sp_order |
An integer specifying the spline order. Must be less than 'bin'. Default is NULL. |
A numeric value representing joint mutual information (MI).
x_1 <- rnorm(100) x_2 <- rnorm(100) x_3 <- rnorm(100) getMIBi(x_1, x_2, x_3)x_1 <- rnorm(100) x_2 <- rnorm(100) x_3 <- rnorm(100) getMIBi(x_1, x_2, x_3)
Computes the P-value for a given numeric value 'x' based on its position within a sorted distribution. This function utilizes a binary search approach for efficient computation.
getPValue(x, sorted_Distri)getPValue(x, sorted_Distri)
x |
A numeric value for which the P-value is to be calculated. |
sorted_Distri |
A numeric vector representing a sorted distribution. This distribution must be sorted in ascending order. |
A numeric value indicating the P-value, representing the proportion of values in 'sorted_Distri' that are greater than or equal to 'x'.
x <- rnorm(1) sorted_dist <- sort(rnorm(100)) getPValue(x, sorted_dist)x <- rnorm(1) sorted_dist <- sort(rnorm(100)) getPValue(x, sorted_dist)
Computes the normalized mutual information (MI) between the same rows of two matrices normalized by their individual information content, using the specified number of bins and spline order.
MImat2mat(mat1, mat2, bin = NULL, sp_order = NULL)MImat2mat(mat1, mat2, bin = NULL, sp_order = NULL)
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'. |
bin |
An integer specifying the number of bins. Default is NULL. |
sp_order |
An integer specifying the spline order. Must be less than 'bin'. Default is NULL. |
A numeric vector where each element corresponds to the normalized mutual information (MI) between respective rows of 'mat1' and 'mat2'.
mat1 <- matrix(rnorm(10000), nrow = 100, ncol = 100) mat2 <- matrix(rnorm(10000), nrow = 100, ncol = 100) MImat2mat(mat1, mat2)mat1 <- matrix(rnorm(10000), nrow = 100, ncol = 100) mat2 <- matrix(rnorm(10000), nrow = 100, ncol = 100) MImat2mat(mat1, mat2)
Computes the normalized mutual information (MI) between each row of first matrix and each row of second matrix, normalized by their individual information content, using the specified number of bins and spline order.
MImat2matAll(mat1, mat2, bin = NULL, sp_order = NULL)MImat2matAll(mat1, mat2, bin = NULL, sp_order = NULL)
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 columns as 'mat1'. |
bin |
An integer specifying the number of bins. Default is NULL. |
sp_order |
An integer specifying the spline order. Must be less than 'bin'. Default is NULL. |
A matrix where each element corresponds to the normalized mutual information (MI) between respective rows of 'mat1' and 'mat2'.
mat1 <- matrix(rnorm(1000), nrow = 10, ncol = 100) mat2 <- matrix(rnorm(2000), nrow = 200, ncol = 100) MImat2matAll(mat1, mat2)mat1 <- matrix(rnorm(1000), nrow = 10, ncol = 100) mat2 <- matrix(rnorm(2000), nrow = 200, ncol = 100) MImat2matAll(mat1, mat2)
Computes the normalized mutual information (MI) between vectors sampled from two matrices normalized by the individual information content. The sampling is done multiple times to generate a distribution.
MImat2matPermu( mat1, mat2, bin = NULL, sp_order = NULL, bulkIdx = 0, permutationTimes = 1000, seedNum = 99999999 )MImat2matPermu( mat1, mat2, bin = NULL, sp_order = NULL, bulkIdx = 0, permutationTimes = 1000, seedNum = 99999999 )
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'. |
bin |
An integer specifying the number of bins. Default is NULL. |
sp_order |
An integer specifying the spline order. Must be less than 'bin'. Default is NULL. |
bulkIdx |
Index to divide the task when processing many permutations. Default is 0. |
permutationTimes |
Number of permutations for sampling. Default is 1000. |
seedNum |
Seed for random number generation. Default is 99999999. |
A numeric vector of normalized mutual information (MI) values for each permutation.
mat1 <- matrix(rnorm(10000), nrow = 100, ncol = 100) mat2 <- matrix(rnorm(10000), nrow = 100, ncol = 100) MImat2matPermu(mat1, mat2)mat1 <- matrix(rnorm(10000), nrow = 100, ncol = 100) mat2 <- matrix(rnorm(10000), nrow = 100, ncol = 100) MImat2matPermu(mat1, mat2)
Computes the normalized mutual information (MI) between each row of a matrix and a numeric vector normalized by the mutual information of the vector with itself using the specified number of bins and spline order.
MImat2vec(mat, vec, bin = NULL, sp_order = NULL)MImat2vec(mat, vec, bin = NULL, sp_order = NULL)
mat |
A numeric matrix. For example, each row represents a gene and each column represents a sample. |
vec |
A numeric vector, with length equal to the number of columns in 'mat'. |
bin |
An integer specifying the number of bins. Default is NULL. |
sp_order |
An integer specifying the spline order. Must be less than 'bin'. Default is NULL. |
A numeric vector representing the normalized mutual information (MI) between each row of 'mat' and 'vec'.
mat <- matrix(rnorm(10000), nrow = 100, ncol = 100) vec <- rnorm(100) MImat2vec(mat, vec)mat <- matrix(rnorm(10000), nrow = 100, ncol = 100) vec <- rnorm(100) MImat2vec(mat, vec)
Computes the mutual information (MI) between a random vector sampled from a matrix and a vector, normalized by the mutual information of the vector with itself. The sampling is done multiple times to generate a distribution.
MImat2vecPermu( mat, vec, bin = NULL, sp_order = NULL, bulkIdx = 0, permutationTimes = 1000, seedNum = 99999999 )MImat2vecPermu( mat, vec, bin = NULL, sp_order = NULL, bulkIdx = 0, permutationTimes = 1000, seedNum = 99999999 )
mat |
A numeric matrix. For example, each row represents a gene and each column represents a sample. |
vec |
A numeric vector, with length equal to the number of columns in 'mat'. |
bin |
An integer specifying the number of bins. Default is NULL. |
sp_order |
An integer specifying the spline order. Must be less than 'bin'. Default is NULL. |
bulkIdx |
Index to divide the task when processing many permutations. Default is 0. |
permutationTimes |
Number of permutations for sampling. Default is 1000. |
seedNum |
Seed for random number generation. Default is 99999999. |
A numeric vector of normalized mutual information (MI) values for each permutation.
mat <- matrix(rnorm(10000), nrow = 100, ncol = 100) vec <- rnorm(100) MImat2vecPermu(mat, vec)mat <- matrix(rnorm(10000), nrow = 100, ncol = 100) vec <- rnorm(100) MImat2vecPermu(mat, vec)