Skip to main content

Compute the irreproducible discovery rate (IDR) for a given dataset.

Project description

pipeline status coverage report

IDR: To identify which part of the signal is reproducible between $n$ samples, we can model the data as a mixture of two $n$ dimensional distributions. The copula framework allows us to decompose each of these two multidimensional distribution as the product of their marginal distribution on each dimension and a copula to model the dependency structure between the marginals. By imposing, one of these copula to be the independence copula, we can then compute the probability of each observation to be reproducible across samples.

Installation

pip install midr

or for the latest development version:

pip install uv
uv pip install git+https://gitbio.ens-lyon.fr/LBMC/physbio/idrpy

Usage

Command line

midr --help
*  --csv_input      TEXT                                  csv file with data, observation as rows and dimensions as columns [required]
*  --csv_output     TEXT                                  csv file with data, and two additional columns for IDR and FDR [required]
--ecdf           [adjustedDistributionalTransform|distributionalTransform|linear] (default: adjustedDistributionalTransform) choise of eCDF method, to handle ties, linear use the data order, distributional transform randomize ties between upper and lower non-tie values, adjusted distributional transform randomize while keeping ties closer together than their are to the upper and lower values
--copula         [empiricalBeta|archmixture|gaussian]  (default: empiricalBeta) copula model to use
--pseudo_data                                          use pseudo data (prior to consider higher values more reproducible)
--gpu                                                  run on GPU if available
--no_header                                            do not use header in csable header parsing in csv input file
--help                                                 Show this message and exit.

Example

midr --csv_input data/input.csv --csv_output results/output.csv

with data/input.csv containing:

V1,V2
0.9250749250749251,0.9040959040959041
0.13586413586413587,0.11288711288711288
0.9820179820179821,0.975024975024975
0.7772227772227772,0.7842157842157842
0.6463536463536463,0.6053946053946054
0.8851148851148851,0.8861138861138861
0.17382617382617382,0.18081918081918083
0.6563436563436563,0.6123876123876124
0.03196803196803197,0.030969030969030968

and results/output.csv containing:

V1,V2,idr,fdr
0.9250749250749251,0.9040959040959041,2.8943635779323093e-11,3.413164596618289e-11
0.13586413586413587,0.11288711288711288,1.0884731099315595e-11,2.6764499871550515e-11
0.9820179820179821,0.975024975024975,3.788097008249572e-12,2.6764499871550515e-11
0.7772227772227772,0.7842157842157842,1.2833902510801593e-11,2.6764499871550515e-11
0.6463536463536463,0.6053946053946054,1.8825313694123784e-11,2.6970363458630062e-11
0.8851148851148851,0.8861138861138861,1.0859802750229041e-11,2.6764499871550515e-11
0.17382617382617382,0.18081918081918083,9.586860680232651e-12,2.6764499871550515e-11
0.6563436563436563,0.6123876123876124,2.2037240785360618e-11,2.8731735052621405e-11
0.03196803196803197,0.030969030969030968,4.258939258330211e-12,2.6764499871550515e-11

Python Example

You can also use the Python API:

import torch
import polars as pl
import midr

data = torch.from_numpy(pl.read_csv("data/input.csv").to_numpy())
idr, fdr = midr.compute_idr(data, copula="archmmixture", pseudo_data=True)
ecdf_data = midr.ecdf(data).detach().numpy()

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

midr-2.0.1.tar.gz (16.0 kB view details)

Uploaded Source

Built Distribution

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

midr-2.0.1-py3-none-any.whl (16.5 kB view details)

Uploaded Python 3

File details

Details for the file midr-2.0.1.tar.gz.

File metadata

  • Download URL: midr-2.0.1.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for midr-2.0.1.tar.gz
Algorithm Hash digest
SHA256 9fe4d3f7470001a48c50b57a46bc7c7e47418a38e19488f6c2a73e1adbb5398e
MD5 45d5246a1b145c9ee340558d6c340ab9
BLAKE2b-256 ab4e72633efeb4e4c0385415940db26432f826bd623e92e0b3f720ddfaec4bbb

See more details on using hashes here.

File details

Details for the file midr-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: midr-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 16.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for midr-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a08cde4e4a6a9ab0dfb67fc8d307b978230ed9f1ea24022377a44c3dd2e08e1b
MD5 10cd6c6cd77ca9018d826dd3ea8405ba
BLAKE2b-256 5182a4296663fbab36095f161e690a38f292055382f2e4fdc23e5a8ba2991a71

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