How monarch-initiative/phenol works
Project type and purpose
• This is a multi‑module Java library and CLI tool (“Phenol”) for loading, representing, and analyzing biological ontologies (HPO, MPO, GO, etc.) and phenotype annotations.
• It consists of five core Maven modules:
• phenol‑core: in‑memory ontology model, graph algorithms, similarity and score‐distribution utilities
• phenol‑io: file loaders/parsers for JSON, OBO, OBO‑Graph formats
• phenol‑annotations: domain‑specific loaders/parsers for HPO/MPO/Gene–disease annotations and temporal/metadata models
• phenol‑analysis: statistical and enrichment calculators (MGSA, hypergeometric tests, multiple test corrections)
• phenol‑cli: command‑line front end that ties all modules together for interactive or scripted use
File structure
• Top‑level: project root contains CI configs (GitHub workflows), Maven wrapper, docs/manual, and the multi‑module pom.xml.
• Each module lives in its own directory (pom.xml plus src/main/java and src/test/java).
• Packages within modules follow domain splits (e.g. org.monarchinitiative.phenol.graph, .io, .annotations, .analysis, .cli).
• Build and distribution helpers under contrib, documentation under docs and manual.
README for architectural clues
• README explicitly lists the modules, their responsibilities, and the recommended usage/dependencies.
• External Inputs/Outputs: JSON/OBO ontology files, annotation files, user CLI, external API clients
• Module Layer:
– phenol‑io (parsers/loaders)
– phenol‑core (ontology model & graph algorithms)
– phenol‑annotations (annotation domain logic)
– phenol‑analysis (statistics & enrichment algorithms)
– phenol‑cli (user‑facing commands)
• Infrastructure: Maven build, GitHub CI/CD, Javadoc/manual site, test suites
c. Architectural patterns & principles
• Layered (I/O → Model → Domain Logic → CLI)
• Modular Maven sub‑projects encapsulating cohesive responsibilities
• Dependency inversion: high‑level modules (analysis, CLI) depend only on well‑defined interfaces in lower modules
d. Technologies & frameworks
• Java 11+, Maven
• JSON/OBO parsing libs inside phenol‑io
• Graph algorithms implemented in phenol‑core
• Logback for logging (phenol‑cli resources)
• GitHub Actions for CI, ReadTheDocs/Sphinx for docs