Skip to main content

Identity Correlation Value to measure how identical two arrays X and Y are and how likely this similarity is by random chance.

Project description

icorr

Identity Correlation Value

This package contains all the components necessary for performing an identity correlation analysis. The identity correlation value (Icorr) is a scale-invariant measure of the total deviation from the identity line, with a slope of 1 and an origin intercept of 0 (Y = 1X+0). This is a special case of Pearson correlation, which instead quantifies any linear relationship.

The identity correlation value is derived from a linear transformation of the dissimilarity metric D (icorr = 1-2D). D is the average squared perpendicular distance of all data point pairs (x_i, y_i) to the identity line, which is normalized to the summed variance of X and Y. In the end, the Icorr value ranges between 1 (coherence), 0 (dis-coherence), and -1 (anti-coherence). Depending on the specific 2D configuration OMEGA, one can calculate a p-value for the null hypothesis icorr=0.

A detailed description of this approach can be found in the supplementary notes of Bayer et al. 2025, where it is used to measure kinase-substrate relationships in the experimental perturbation potency dimensions of kinase inhibitors. If you use identity correlation analysis in your work, please cite us.

Installation

We have registered this package on pypi. To install, it simply do:

$ pip install icorr

Example usage

import icorr

# some toy data x and y
x = np.random.normal(loc=0, scale=2, size=30)
y = np.random.normal(loc=0, scale=2, size=30)

icv = icorr.identity_correlation(x, y)
omega = icorr.omega(x,y)

# Calculate p values either by numerical (slow) or beta (fast) approximation
p_value = pvalues_numerical_approximation(icv, omega)
fdr_correction = pvalues_beta_approximation(icv, omega)

# Plot the x and y data in a coherence map
icorr.coherence_map(x, y)

# For FDR correction (Benjamini-Hochberg) of many p-values
p_values_adjusted = icorr.fdr_correction(p_values)

# sample and plot a random (H0) icorr distribution given a omega configuration.
random_icvs = icorr.random_sample(omega=(30,5,5,10))
plt.hist(random_icvs, bins=np.linspace(-1, 1, 101))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

icorr-0.0.1.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

icorr-0.0.1-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file icorr-0.0.1.tar.gz.

File metadata

  • Download URL: icorr-0.0.1.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.3 Linux/6.14.0-29-generic

File hashes

Hashes for icorr-0.0.1.tar.gz
Algorithm Hash digest
SHA256 86f9a06d54c4ca33ae98e4e58f0880ab7a714a214d8ac62d5d2397dca96a405c
MD5 692044984b79bfd22ee0d9dd6f844b5c
BLAKE2b-256 faffda7692a2945f20a991ed95f4fc6135af5a9235810184c0447af2d7a1da16

See more details on using hashes here.

File details

Details for the file icorr-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: icorr-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 11.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.3 Linux/6.14.0-29-generic

File hashes

Hashes for icorr-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f2fb5c8680bfb71eefdf60a947103e758ad6fc0eafe0fcd134be0ba2158fea6b
MD5 0dcad6947254815c4bde9ae177288b34
BLAKE2b-256 dfea624f5cd4bb26a33a6f69e99042325c88bb1738d84a847359216bbd487161

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page