{"id":13759717,"url":"https://github.com/rsinghlab/AltumAge","last_synced_at":"2025-05-10T09:33:45.066Z","repository":{"id":47187892,"uuid":"345667118","full_name":"rsinghlab/AltumAge","owner":"rsinghlab","description":null,"archived":false,"fork":false,"pushed_at":"2024-02-23T10:45:34.000Z","size":102521,"stargazers_count":26,"open_issues_count":1,"forks_count":9,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-05-14T00:07:42.645Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rsinghlab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-08T13:33:11.000Z","updated_at":"2024-08-03T13:03:50.069Z","dependencies_parsed_at":"2024-08-03T13:13:51.304Z","dependency_job_id":null,"html_url":"https://github.com/rsinghlab/AltumAge","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsinghlab%2FAltumAge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsinghlab%2FAltumAge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsinghlab%2FAltumAge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsinghlab%2FAltumAge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rsinghlab","download_url":"https://codeload.github.com/rsinghlab/AltumAge/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224941168,"owners_count":17395833,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T13:00:58.206Z","updated_at":"2025-05-10T09:33:45.057Z","avatar_url":"https://github.com/rsinghlab.png","language":"Jupyter Notebook","funding_links":[],"categories":["Code"],"sub_categories":[],"readme":"# AltumAge\n\nAltumAge is a pan-tissue DNA methylation epigenetic clock based on deep learning. For the link to our paper published in npj Aging, please click [here](https://www.nature.com/articles/s41514-022-00085-y).\n\n## [New] AltumAge is available on pyaging\n\nThe easiest way to use AltumAge with your methylation data is through [pyaging](https://github.com/rsinghlab/pyaging), our newly-released aging clock package. It is available on PyPi and can easily be installed via ```pip install pyaging```. The tutorial for DNA methylation age prediction is available [here](https://pyaging.readthedocs.io/).\n\n## Usage\n\nIn order to use AltumAge for age prediction, please follow the steps in example.ipynb. The example file also contains simple instructions to use Horvath's 2013 model for ease of comparison.\n\nThe main instructions to use AltumAge are as follows:\n\n#### (1) Load required python packages:\n\nThe following packages must be installed. As of note, the model was trained with ```tensorflow``` 2.5.0, so beware of possible compatibility issues with other versions.\n\n```python\nimport tensorflow as tf\nimport numpy as np\nimport pandas as pd\nfrom sklearn import linear_model, preprocessing\n```\n\n#### (2) Load list of CpGs, methylation data, scaler, and AltumAge model:\n\nFrom your Illumina 27k, 450k or EPIC array data, select the 20318 CpG sites from the file \"CpGsites.csv\" in the correct order.\n\n```python\ncpgs = np.array(pd.read_pickle('example_dependencies/multi_platform_cpgs.pkl'))\n```\n\nLoad the BMIQCalibration-normalized methylation data. It is crucial that the methylation beta values are normalized according to BMIQCalibration in R from \"Horvath, S. DNA methylation age of human tissues and cell types.\" Genome Biol 14, 3156 (2013). [https://doi.org/10.1186/gb-2013-14-10-r115](https://doi.org/10.1186/gb-2013-14-10-r115). Moreover, reading the pickled example data only works in python version \u003e= 3.8.\n\n```python\ndata = pd.read_pickle('example_dependencies/example_data.pkl')\nreal_age = data.age\nmethylation_data = data[cpgs]\n```\n\nLoad the scaler, which transforms the distribution of beta values of each CpG site to mean = 0 and variance = 1.\n\n```python\nscaler = pd.read_pickle('example_dependencies/scaler.pkl')\n```\n\nFinally, load ```AltumAge```:\n\n```python\nAltumAge = tf.keras.models.load_model('example_dependencies/AltumAge.h5')\n```\n\n#### (3) Scale the methylation data:\n\nScale the beta values of each CpG with sklearn robust scaler.\n\n```python\nmethylation_data_scaled = scaler.transform(methylation_data)\n```\n\n#### (4) Age prediction:\n\nFinally, to predict age, simply use the following. The ```.flatten()``` command might be needed to transform the output into a 1D array.\n\n```python\npred_age_AltumAge = AltumAge.predict(methylation_data_scaled).flatten()\n```\n\nVoilà!\n\n\n## PyTorch compatibility\n\nAltumAge's h5 tensorflow model has also been converted to the latest PyTorch 2.1 version. To use, just ```torch.load``` the AltumAge.pt file under the dependencies folder. Follow all of the preprocessing steps and just use the loaded model as usual. \n\n\n## Supplementary Results\n\nThe summary files are CSVs containing detailed information regarding the performance of AltumAge and Horvath's 2013 model by data set in the test set.\n\n## Data availability\n\nTo access the raw data and metadata from Array Express and Gene Expression Omnibus (GEO) or the organized, non-normalized methylation data, please access our Google Drive [here](https://drive.google.com/drive/folders/1RH2JYmhOmsScaj_WMQfVwYjubkNTh5Oq?usp=sharing_eip\u0026ts=60c67fb4).\n\n## Citation\n\nTo cite our study, please use the following:\n\nde Lima Camillo, L.P., Lapierre, L.R. \u0026 Singh, R. A pan-tissue DNA-methylation epigenetic clock based on deep learning. npj Aging 8, 4 (2022). [https://doi.org/10.1038/s41514-022-00085-y](https://doi.org/10.1038/s41514-022-00085-y)\n\nBibTex citation:\n```\n@article {de_Lima_Camillo_AltumAge,\n\tauthor = {de Lima Camillo, Lucas Paulo and Lapierre, Louis R and Singh, Ritambhara},\n\ttitle = {A pan-tissue DNA-methylation epigenetic clock based on deep learning},\n\tyear = {2022},\n\tdoi = {10.1038/s41514-022-00085-y},\n\tpublisher = {Springer Nature},\n\tURL = {https://doi.org/10.1038/s41514-022-00085-y},\n\teprint = {https://www.nature.com/articles/s41514-022-00085-y.pdf},\n\tjournal = {npj Aging}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frsinghlab%2FAltumAge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frsinghlab%2FAltumAge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frsinghlab%2FAltumAge/lists"}