Skip to content

Conversation

@marcbal77
Copy link
Member

@marcbal77 marcbal77 commented Nov 16, 2025

Summary

  • Implements MiAge (Mitotic Age) clock from Youn & Wang (2018)
  • Uses optimization-based approach to calculate mitotic age from DNA methylation
  • 268 CpG sites with site-specific parameters extracted from MethylCIPHER
  • Registers MiAgeModel in ModelGallery for proper integration
  • All tests passing

Fixes and closes PR #134

alexiszxcv and others added 3 commits November 15, 2025 19:35
- Fix syntax error in model definition (= to :)
- Replace MiAgeNonlinearClock with proper MiAgeModel implementation
- Implement correct optimization-based approach using scipy
- Formula: minimize sum((c + b^(n-1) * d - beta)^2) for each sample
- Correct MiAge_parameters.csv with actual CpG IDs (not CpG_1, CpG_2)
- Remove unnecessary files (MiAge.csv, MiAge_coefficients.csv)
- Add expected test outputs from MethylCIPHER reference data
- Update model metadata (year: 2018, proper DOI, output label)

Based on Youn & Wang (2018) and MethylCIPHER reference implementation.
- Add MiAgeModel to model_gallery.py imports and model_builders registry
- Update expected_model_outputs/MiAge.csv with all 10 test samples
- Fixes model registration error preventing MiAge clock usage
- Tests passing

Updates PR bio-learn#134
@marcbal77 marcbal77 force-pushed the feature/add-miage-clock branch from 5e20ac0 to 7959698 Compare November 16, 2025 04:22
Copy link
Member

@sarudak sarudak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good just a couple issues

"file": "MiAge.csv",
},
},
"OrganAgeChronological": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These items are all duplicates of above.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dear lord, that copy paste method was busy the other day

float
Estimated mitotic age (number of cell divisions)
"""
from scipy.optimize import minimize_scalar
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Imports should be at top of file

- Remove duplicate ModelGallery entries that were overwriting existing clocks
@marcbal77
Copy link
Member Author

removed duplicates and put imports at top

@marcbal77 marcbal77 self-assigned this Dec 7, 2025
@marcbal77 marcbal77 added duplicate This issue or pull request already exists enhancement New feature or request labels Dec 7, 2025
Copy link
Member

@sarudak sarudak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@marcbal77 marcbal77 merged commit 1ddd6a5 into bio-learn:master Dec 18, 2025
1 check passed
@marcbal77 marcbal77 deleted the feature/add-miage-clock branch December 18, 2025 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

duplicate This issue or pull request already exists enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants