Class Architecture#
PANORAMA is built on top of PPanGGOLiN: every core domain object in PANORAMA extends a corresponding PPanGGOLiN class rather than reimplementing it from scratch. This page maps the full class hierarchy, explains what each class adds, and shows how the pieces fit together.
Inheritance overview#
PPanGGOLiN PANORAMA extension
ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ppanggolin.pangenome.Pangenome β panorama.pangenomes.Pangenome
ppanggolin.geneFamily.GeneFamily β panorama.geneFamily.GeneFamily
ppanggolin.region.Region β panorama.region.Region
ppanggolin.region.Spot β panorama.region.Spot
ppanggolin.region.Module β panorama.region.Module
ppanggolin.region.GeneContext β panorama.region.GeneContext
ppanggolin.metadata.MetaFeatures β panorama.systems.system.SystemUnit
ppanggolin.metadata.MetaFeatures β panorama.systems.system.System
panorama.pangenomes.Pangenome β panorama.pangenomes.Pangenomes (container)
panorama.geneFamily.GeneFamily β panorama.geneFamily.Akin (cross-pangenome link)
Pangenome layer#
Pangenome (panorama.pangenomes)#
Extends ppanggolin.pangenome.Pangenome.
PPanGGOLiNβs Pangenome already manages organisms, contigs, genes, gene families, RGPs, spots, and modules. PANORAMAβs
subclass panorama.pangenomes.Pangenome adds the systems layer on top:
Addition |
Purpose |
|---|---|
|
Index detected |
|
Track which annotation sources have been run |
|
Validates that the file is HDF5 and reads PANORAMA-specific status fields via |
|
Extends PPanGGOLiNβs status dict with a |
The constructor takes a name (used throughout outputs) and an optional taxid.
Pangenomes (panorama.pangenomes)#
A plain PANORAMA class (no PPanGGOLiN parent) that acts as the multi-pangenome container
used by every comparative workflow: panorama.pangenomes.Pangenomes.
Feature |
Details |
|---|---|
Storage |
Dict of |
Thread safety |
Accepts a shared |
Loading |
Delegates per-pangenome loading to |
Input |
Populated from a TSV file via |
Gene family layer#
GeneFamily (panorama.geneFamily)#
Extends ppanggolin.geneFamily.GeneFamily.
Adds HMM-annotation state and cross-pangenome linkage on top of PPanGGOLiNβs graph-node representation: {py:class}
panorama.geneFamily.GeneFamily.
Addition |
Purpose |
|---|---|
|
Store the pyHMMER |
|
Index the |
|
Link to an |
Akin (panorama.geneFamily)#
A pure PANORAMA class (no PPanGGOLiN parent) that groups GeneFamily objects
from different pangenomes that have been determined to be functionally equivalent (by alignment or clustering). It
is the data structure behind cross-pangenome family comparison:
panorama.geneFamily.Akin.
Region layer#
All four classes in panorama.region extend the matching PPanGGOLiN region class. At present they are thin
subclasses β their main purpose is to allow PANORAMA to inject additional attributes without patching PPanGGOLiN objects
directly.
PANORAMA class |
Extends |
Key additions |
|---|---|---|
|
None β placeholder for future PANORAMA-specific state |
|
|
|
|
|
Tracks associated |
|
|
Minimal extension used during system detection |
ConservedSpots (panorama.region)#
A pure PANORAMA class (panorama.region.ConservedSpots) that groups Spot
objects from different pangenomes that occupy the same conserved genomic locus. It is the output of
panorama compare_spots.
Systems layer#
The systems layer is entirely PANORAMA-specific β PPanGGOLiN has no equivalent.
Model definitions (panorama.systems.models)#
These classes parse and validate model JSON files before detection runs.
Class |
Role |
|---|---|
Top-level container; maps |
|
One system definition: name, quorum rules ( |
|
One functional unit within a model: presence type ( |
|
A named HMM/profile entry inside a |
Model and FuncUnit
share behaviour via two private mixin bases (_BasicFeatures, _ModFuFeatures); {py:class}
FuncUnit <panorama.systems.models.FuncUnit> and Family
share a third (_FuFamFeatures).
Detected objects (panorama.systems.system)#
These classes hold the results of running detection against a pangenome.
Class |
Extends |
Role |
|---|---|---|
|
One detected functional unit: links a |
|
|
One detected system: groups |
|
β |
Groups |
Both SystemUnit and System
extend PPanGGOLiNβs MetaFeatures, which provides the generic metadata key/value store used for TSV and HDF5
serialisation.
How the layers connect#
Pangenomes
ββ Pangenome (one per input .h5 file)
ββ GeneFamily (extends ppanggolin GeneFamily)
β ββ Akin (links equivalent families across pangenomes)
ββ Region / Spot / Module (extend ppanggolin region classes)
β ββ ConservedSpots (groups Spots across pangenomes)
ββ System (PANORAMA-only)
ββ SystemUnit (one per satisfied FuncUnit)
ββ GeneFamily (the families that fill the unit)
Models (parsed before detection, not stored in Pangenome)
ββ Model
ββ FuncUnit
ββ Family
A System is created when the detection algorithm (in {py:mod}
panorama.systems.detection) finds that a set of gene families in a genomic window satisfies the quorum rules of a {py:
class}Model <panorama.systems.models.Model>. Each satisfied FuncUnit
becomes a SystemUnit; the {py:class}
SystemUnit <panorama.systems.system.SystemUnit> objects are collected into a {py:class}
System <panorama.systems.system.System> which is then attached to the {py:class}
Pangenome <panorama.pangenomes.Pangenome>.
Key PPanGGOLiN touchpoints#
PPanGGOLiN symbol |
Where PANORAMA uses it |
|---|---|
|
Base of |
|
Base of |
|
Bases of the four classes in |
|
Base of |
|
Called by |
|
HDF5 read/write helpers extended by |
Note
There is a known circular-import risk between pangenomes.py and systems/system.py.
If you need to import one from the other, use a function-local import rather than a
top-level one. tests/conftest.py documents the current workaround.