{"id":37066379,"url":"https://github.com/heart-gen/py-qvalue","last_synced_at":"2026-01-14T07:47:21.083Z","repository":{"id":290420725,"uuid":"974394432","full_name":"heart-gen/py-qvalue","owner":"heart-gen","description":"Python port of R statistical methods","archived":false,"fork":false,"pushed_at":"2025-10-30T13:25:36.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-30T15:29:21.110Z","etag":null,"topics":["qvalue","software"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/py-qvalue/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/heart-gen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-04-28T17:54:38.000Z","updated_at":"2025-10-30T13:25:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"bf91a706-8b23-43be-9b33-d47477858459","html_url":"https://github.com/heart-gen/py-qvalue","commit_stats":null,"previous_names":["heart-gen/py-qvalue"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/heart-gen/py-qvalue","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heart-gen%2Fpy-qvalue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heart-gen%2Fpy-qvalue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heart-gen%2Fpy-qvalue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heart-gen%2Fpy-qvalue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heart-gen","download_url":"https://codeload.github.com/heart-gen/py-qvalue/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heart-gen%2Fpy-qvalue/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28413492,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T05:26:33.345Z","status":"ssl_error","status_checked_at":"2026-01-14T05:21:57.251Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["qvalue","software"],"created_at":"2026-01-14T07:47:20.576Z","updated_at":"2026-01-14T07:47:21.060Z","avatar_url":"https://github.com/heart-gen.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# py-qvalue\n\nA Python package for estimating q-values and controlling the False Discovery\nRate (FDR), based on the functionalities of the renowned R package `qvalue`.\n\n## Overview\n\n`py-qvalue` brings key methods from the R `qvalue` package to the Python\necosystem. It is designed for researchers and analysts who perform multiple\nhypothesis testing and need robust ways to estimate the proportion of true null\nhypotheses ($\\pi_0$), calculate q-values, and estimate local false discovery\nrates (lfdr).\n\nThis package currently provides Python implementations of the core `qvalue` and\n`pi0est` functions, along with the necessary `lfdr` calculation, allowing for\nstraightforward FDR control within your Python workflows.\n\n## Installation\n\nYou can install `py-qvalue` using pip:\n\n```bash\npip install py-qvalue\n```\n\n## Quick Start\n\nA basic example demonstrating how to use `py-qvalue` to calculate\nq-values from a set of p-values:\n\n```python\nimport numpy as np\nfrom py_qvalue import qvalue\n\n# Parameters\nn_tests = 1000\neffect_size = 0.3\nnull_proportion = 0.9\n\n# Generate null (uniform) and signal (skewed low) components\nn_null = int(n_tests * null_proportion)\nn_signal = n_tests - n_null\n\nnull_p = np.random.uniform(0, 1, n_null)\nsignal_p = np.random.beta(1, 15, n_signal)  # Stronger signal = more left skew\n\n# Combine and shuffle\np_values = np.concatenate([null_p, signal_p])\nnp.random.shuffle(p_values)\n\n# Calculate q-values\nqvalue_results = qvalue(p_values)\n\n# Access the q-values\nq_values = qvalue_results['qvalues']\nprint(\"P-values:\", p_values[0:10]) # Just the first ten\nprint(\"Q-values:\", q_values[0:10])\n\n# Access the estimated proportion of true null hypotheses (pi0)\npi0_estimate = qvalue_results['pi0']\nprint(\"Estimated pi0:\", pi0_estimate)\n\n# Get significant results at a specific FDR level (e.g., 10%)\nresults_at_fdr = qvalue(p_values, fdr_level=0.10)\nsignificant_mask = results_at_fdr['significant']\nprint(\"Significant at 10% FDR:\", significant_mask)\n```\n\n## Implemented Functions\n\nAs a port of `qvalue`, we use the same core functions includes:\n\n* `qvalue(p, fdr_level=None, pfdr=False, lfdr_out=True, pi0=None, **kwargs)`:\n  Estimates q-values and related FDR quantities from a set of p-values.\n* `pi0est(p, lambda_=None, pi0_method=\"smoother\", smooth_df=3, smooth_log_pi0=False, **kwargs)`:\n  Estimates the proportion of true null hypotheses ($\\pi_0$).\n* `lfdr(p, pi0, trunc=True, monotone=True, transf=\"probit\", adj=1.5, eps=1e-8, **kwargs)`:\n  Estimates local false discovery rates (lfdr).\n\nUsers can import `qvalue` and `pi0est` from this package.\n\n``` python\nfrom py_qvalue import pi0est, qvalue\n```\n\n## Relationship to the R `qvalue` Package\n\nThis package is a Python port inspired by and aiming to replicate the\nfunctionality of the original `qvalue` package for R, developed by John D.\nStorey and colleagues. The R `qvalue` package is a widely cited and respected\ntool for false discovery rate control in multiple hypothesis testing.\n\nFor more information on the statistical methods and the original R\nimplementation, please refer to:\n\n* The original R `qvalue` [package documentation and resources](https://bioconductor.org/packages/release/bioc/html/qvalue.html).\n* Relevant publications by John D. Storey and Robert Tibshirani on false discovery rates and q-values.\n  - [Statistical significance for genomewide studies](https://www.pnas.org/doi/abs/10.1073/pnas.1530509100)\n  - [A direct approach to false discovery rates](https://academic.oup.com/jrsssb/article-abstract/64/3/479/7098513)\n  - [The positive false discovery rate: a Bayesian interpretation and the q-value](https://projecteuclid.org/journals/annals-of-statistics/volume-31/issue-6/The-positive-false-discovery-rate--a-Bayesian-interpretation-and/10.1214/aos/1074290335.full)\n\n## Contributing\n\nWe welcome contributions to `py-qvalue`! If you find a bug, have a feature\nrequest, or want to contribute code, please feel free to open an issue or submit\na pull request on the GitHub repository.\n\n## License\n\nThis project is licensed under the GPL v3 License. See the `LICENSE` file for\ndetails.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheart-gen%2Fpy-qvalue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheart-gen%2Fpy-qvalue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheart-gen%2Fpy-qvalue/lists"}