Skip to main content

phenocor

phenocor is a Python library for analyzing pairwise relationships between Human Phenotype Ontology (HPO) features in GA4GH Phenopacket cohorts.

It provides Pairwise association analysis, which measures associations between binary phenotype annotations using the phi coefficient and Fisher's exact test.


Installation

pip install phenocor

Features

  • Construction of phenotype matrices from GA4GH Phenopackets, with separate representation of observed, excluded, and unreported HPO annotations
  • Ontology-aware propagation of phenotype annotations
  • Pairwise phenotype association analysis using the phi coefficient, Fisher's exact test, and Benjamini–Hochberg correction, with exclusion of ancestor–descendant HPO term pairs
  • Tabular results and interactive heatmaps, including contingency counts, effective sample sizes, adjusted p-values, and publication provenance where available

Quickstart

from pathlib import Path
from google.protobuf.json_format import Parse
from phenopackets import Phenopacket
from phenocor import (
    PhenotypeDatasetBuilder,
    HPOCorrelationAnalyzer,
)

# Load phenopackets
phenopacket_dir = Path("path/to/your/fbn1_phenopackets/")

phenopackets = []
for file_path in sorted(phenopacket_dir.glob("*.json")):
    with open(file_path, "r", encoding="utf-8") as f:
        data: str = f.read()
        phenopacket: Phenopacket = Parse(data, Phenopacket())
        phenopackets.append(phenopacket)

# Build dataset
dataset = PhenotypeDatasetBuilder(phenopackets).build()

# Run correlation analysis
analyzer = HPOCorrelationAnalyzer(dataset)
results = analyzer.compute_correlation_matrix()
results.correlation_results.head()

For complete workflows, visualization options, and API details, see the Documentation.

Metadata

Release files for phenocor 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for phenocor 0.2.1
File Size Uploaded Provenance Actions
phenocor-0.2.1.tar.gz 21.5 kB Without provenance Details for phenocor-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for phenocor 0.2.1
File Interpreter ABI Platform Actions
phenocor-0.2.1-py3-none-any.whl Python 3 none any Details for phenocor-0.2.1-py3-none-any.whl

Total release size: 44.0 kB

Release files / phenocor-0.2.1.tar.gz

Download URL phenocor-0.2.1.tar.gz
Size 21.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c388c7ebc1873351004f709b77d1757281c5269a3145c90b344a4ae672679a6e
BLAKE2b-256 checksum
How to use checksums
6fb3c4848fbaf2587c2d9e87cca92a80080a8b3a7c26abcffc0adbad381372a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.20

Release files / phenocor-0.2.1-py3-none-any.whl

Download URL phenocor-0.2.1-py3-none-any.whl
Size 22.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a00a4f9fff2807b3934be510ef134b548065bc827bfb5249d29798c0ee312d32
BLAKE2b-256 checksum
How to use checksums
f6637d85e7bfe416cef8624ab53bd010ca247f531a9e2d49d20dd11097b15ced
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.20

Security for phenocor 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page