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.0

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.0
File Size Uploaded Provenance Actions
phenocor-0.2.0.tar.gz 21.4 kB Without provenance Details for phenocor-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 43.7 kB

Release files / phenocor-0.2.0.tar.gz

Download URL phenocor-0.2.0.tar.gz
Size 21.4 kB
Tags Source
SHA-256 checksum
How to use checksums
181adc1200c29a2aafd072a315a7b8b97252fa44212fd393dff670faa8920ca5
BLAKE2b-256 checksum
How to use checksums
c7d78a55d73582f4138898dfa87c58fcd666b4655998017dfdf6c8d4d50830bd
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.0-py3-none-any.whl

Download URL phenocor-0.2.0-py3-none-any.whl
Size 22.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
67e0205c4416d6bbab7026286bb0fb8a8e4d8ec3009f6fc70bd6f11ec476c47d
BLAKE2b-256 checksum
How to use checksums
1b4fa0b5209609ce5da4ed33cb173f0b86a95b82afe4c77959a275fd5bfe71ce
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.0

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.0 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