Skip to content

P2GX/phenosign

Repository files navigation

phenosign

phenosign is a Python library for analyzing correlations and synergy in GA4GH Phenopacket cohorts.

Installation

pip install phenosign

Overview

This package enables the identification of pairwise associations and higher-order interactions between phenotypic features, helping to uncover biologically meaningful patterns in rare disease data.

Features

  • Correlation analysis of HPO features (Phi Coefficient)
  • Synergy analysis to detect non-additive interactions between phenotypic features with respect to a target variable (e.g., variant effects or disease)
  • Support for GA4GH phenopacket data
  • Structured dataset construction from phenotypic profiles
  • Visualization utilities (e.g., correlation heatmaps)

Quickstart

from pathlib import Path
import json
from phenosign import (
    PhenotypeDatasetBuilder,
    HPOCorrelationAnalyzer,
)

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

phenopackets = []
for file_path in 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.result_table.head()

For a complete workflow and advanced options, see the Documentation.

About

Phenopacket to Synergy and Correlation

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages