ppkt2synergy is a Python library for analyzing correlations and synergy in GA4GH Phenopacket cohorts.
pip install ppkt2synergyThis package enables the identification of pairwise associations and higher-order interactions between phenotypic features, helping to uncover biologically meaningful patterns in rare disease data.
- Correlation analysis of HPO features (Spearman, Kendall, Phi)
- 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)
from ppkt2synergy import (
load_phenopackets_by_cohort,
PhenotypeDatasetBuilder,
HPOCorrelationAnalyzer,
CorrelationType,
)
from gpsea.model import VariantEffect
# Load phenopackets
phenopackets = load_phenopackets_by_cohort("FBN1")
# Build dataset
dataset = PhenotypeDatasetBuilder(phenopackets).build(
mane_tx_id="NM_000138.5",
variant_effect_type=VariantEffect.MISSENSE_VARIANT,
)
# Run correlation analysis
analyzer = HPOCorrelationAnalyzer(dataset)
analyzer.compute_correlation_matrix(
correlation_type=CorrelationType.SPEARMAN
)For a complete workflow and advanced options, see the documentation.