How lasugden/arhmm-cycle-tracking works
This is a hormone-cycle analysis pipeline: the organizer loads participant, cycle, and hormone exports, enriches and filters cycle data, trains or runs an HMM, and assembles cycle-level features for downstream analysis. Its HMM stages prepare hormone sequences, infer phases, and persist phase/log-probability outputs; separate modules support phase annotation, classification, and visual summaries. The README identifies the organizer as the entry point. Several organizer operations and downstream calls are in omitted excerpts, so only explicit calls or documented entry points are linked; dashed edges mark likely but unverified handoffs.
Main entry points: hormone_organizer.py Hormone organizer · run_HMM.py Cycle HMM runner · add_viterbi_phase.py Phase annotation · train_HMM.py HMM indexing
Components 22
Data ingestion
- Cycle reader
code/readers/cycles.py - Hormone reader
code/readers/hormones.py - Participant reader
code/readers/info.py - Cycle export
- Hormone export
- Participant export
- Mood reader
code/readers/mood.py - Symptom reader
code/readers/symptom.py
Cycle preparation
- Hormone organizer
code/hormone_organizer.py - PCOS labeling
code/add_pcos_label.py
HMM inference
- HMM indexing
code/train_HMM.py - HMM parameters
- Cycle HMM runner
code/run_HMM.py - Sequence interpolation
code/interpolate.py - HMM model
code/hmm.py - Phase outputs
Analysis outputs
- Phase annotation
code/add_viterbi_phase.py - Cycle alignment
code/alignment.py - Missingness extraction
code/extract_missingness.py - Group classifier
code/classify.py - Plot generation
code/make_plots.py
Other components
- Analyst
Connections 22
- Hormone organizer → Cycle reader: loads cycles
code/hormone_organizer.py - Hormone organizer → Hormone reader: loads hormones
code/hormone_organizer.py - Hormone organizer → Participant reader: loads participant data
code/hormone_organizer.py - Cycle reader → Cycle export: reads CSV
code/readers/cycles.py - Hormone reader → Hormone export: reads CSV
code/readers/hormones.py - Participant reader → Participant export: reads CSV
code/readers/info.py - Hormone organizer → PCOS labeling: adds PCOS labels
- Hormone organizer → HMM indexing: adds indexing
code/hormone_organizer.py - Hormone organizer → Cycle HMM runner: runs all cycles
code/hormone_organizer.py - Cycle HMM runner → HMM indexing: deduplicates and expands
code/run_HMM.py - Cycle HMM runner → Sequence interpolation: interpolates sequences
code/run_HMM.py - Cycle HMM runner → HMM model: infers phase paths
- HMM indexing → HMM parameters: writes emissions
code/train_HMM.py - HMM model → HMM parameters: reads parameters
code/hmm.py - Cycle HMM runner → Phase outputs: writes phase results
code/run_HMM.py - Hormone organizer → Phase annotation: adds phase features
code/hormone_organizer.py - Phase annotation → Phase outputs: reads phase outputs
code/add_viterbi_phase.py - Phase annotation → Cycle alignment: computes alignments
- Hormone organizer → Missingness extraction: extracts missingness
- Analyst → Hormone organizer: starts workflow
README.md - Analyst → Group classifier: evaluates groups
- Analyst → Plot generation: requests plots