pyaging 0.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pyaging might be problematic. Click here for more details.

pyaging-0.0.1/LICENSE ADDED
@@ -0,0 +1,28 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2023, Lucas Paulo de Lima Camillo
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ 3. Neither the name of the copyright holder nor the names of its
16
+ contributors may be used to endorse or promote products derived from
17
+ this software without specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
pyaging-0.0.1/PKG-INFO ADDED
@@ -0,0 +1,72 @@
1
+ Metadata-Version: 2.1
2
+ Name: pyaging
3
+ Version: 0.0.1
4
+ Summary: A Python-based compendium of GPU-optimized aging clocks.
5
+ License: BSD
6
+ Author: Lucas Paulo de Lima Camillo
7
+ Author-email: lucas_camillo@alumni.brown.edu
8
+ Requires-Python: >=3.9,<4.0
9
+ Classifier: License :: Other/Proprietary License
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.9
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Provides-Extra: docs
16
+ Requires-Dist: anndata (>=0.10.0,<0.11.0)
17
+ Requires-Dist: numpy (>=1.26.0,<2.0.0)
18
+ Requires-Dist: pandas (>=2.0.0,<3.0.0)
19
+ Requires-Dist: pyBigWig (>=0.3.22,<0.4.0)
20
+ Requires-Dist: scikit-learn (>=1.3.0,<2.0.0)
21
+ Requires-Dist: torch (>=2.0.0,<3.0.0)
22
+ Project-URL: homepage, https://github.com/rsinghlab/pyaging
23
+ Project-URL: repository, https://github.com/rsinghlab/pyaging
24
+ Description-Content-Type: text/markdown
25
+
26
+ <p align="center">
27
+ <img height="160" src="docs/_static/logo.png" />
28
+ </p>
29
+
30
+ ##
31
+
32
+ [![test](https://github.com/rsinghlab/pyaging/actions/workflows/test.yml/badge.svg)](https://github.com/rsinghlab/pyaging/actions/workflows/test.yml)
33
+ [![build](https://github.com/rsinghlab/pyaging/actions/workflows/build.yml/badge.svg)](https://github.com/rsinghlab/pyaging/actions/workflows/build.yml)
34
+ [![publish](https://github.com/rsinghlab/pyaging/actions/workflows/publish.yml/badge.svg)](https://github.com/rsinghlab/pyaging/actions/workflows/publish.yml)
35
+ [![release](https://github.com/rsinghlab/pyaging/actions/workflows/release.yml/badge.svg)](https://github.com/rsinghlab/pyaging/actions/workflows/release.yml)
36
+ [![documentation](https://readthedocs.org/projects/pyaging/badge/?version=latest)](https://pyaging.readthedocs.io/en/latest/)
37
+ [![beta](https://img.shields.io/badge/status-beta-yellow)](https://github.com/rsinghlab/pyaging)
38
+ [![upload](https://img.shields.io/pypi/v/pyaging?logo=PyPI)](https://pypi.org/project/pyaging/)
39
+ [![download](https://static.pepy.tech/badge/pyaging)](https://pepy.tech/project/pyaging)
40
+ [![star](https://img.shields.io/github/stars/rsinghlab/pyaging?logo=GitHub&color=red)](https://github.com/rsinghlab/pyaging/stargazers)
41
+
42
+ ## 🐍 **pyaging**: a Python-based compendium of GPU-optimized aging clocks
43
+
44
+ `pyaging` is a cutting-edge Python package designed for the longevity research community, offering a comprehensive suite of GPU-optimized biological aging clocks.
45
+
46
+ [Installation](https://pyaging.readthedocs.io/en/latest/installation.html) - [Search, cite, and get metadata](https://pyaging.readthedocs.io/en/latest/tutorial_utils.html) - [Bulk DNA methylation](https://pyaging.readthedocs.io/en/latest/tutorial_dnam.html) - [Bulk histone mark ChIP-Seq](https://pyaging.readthedocs.io/en/latest/tutorial_histonemarkchipseq.html) - [Bulk ATAC-Seq](https://pyaging.readthedocs.io/en/latest/tutorial_atacseq.html) - [Bulk RNA-Seq](https://pyaging.readthedocs.io/en/latest/tutorial_rnaseq.html) - [API Reference](https://pyaging.readthedocs.io/en/latest/pyaging.html)
47
+
48
+ With a growing number of aging clocks, comparing and analyzing them can be challenging. `pyaging` simplifies this process, allowing researchers to input various molecular layers (DNA methylation, histone ChIP-Seq, ATAC-seq, transcriptomics, etc.) and quickly analyze them using multiple aging clocks, thanks to its GPU-backed infrastructure. This makes it an ideal tool for large datasets and multi-layered analysis.
49
+
50
+ ## 📝 To-Do List
51
+
52
+ - [X] Integrate `black` for PEP8 compliant code formatting
53
+ - [X] Improve and expand `readthedocs` documentation
54
+ - [X] Add option to specify download directory for datasets
55
+ - [X] Rename datasets to reflect source publications
56
+ - [X] Include mammalian array example datasets
57
+ - [X] Add feature to control logging verbosity
58
+ - [ ] Publish to PyPi
59
+ - [ ] Add percentage of missing features in anndata after age prediction for each clock
60
+ - [ ] Add table in readthedocs with all clock metadata
61
+ - [ ] Add and populate "Notes" tab in metadata
62
+ - [ ] Integrate scAge and scRNAseq clocks (and datasets)
63
+ - [ ] Incorporate murine DNA methylation and proteomic clocks (and datasets)
64
+ - [ ] Add PhenoAge based on blood chemistry analysis (and datasets)
65
+
66
+ ## ❓ Can't find an aging clock?
67
+
68
+ If you have recently developed an aging clock and would like it to be integrated into `pyaging`, please [email us](lucas_camillo@alumni.brown.edu). We aim to incorporate it within two weeks!
69
+
70
+ ## 💬 Community Discussion
71
+ For coding-related queries, feedback, and discussions, please visit our [GitHub Issues](https://github.com/rsinghlab/pyaging/issues) page.
72
+
@@ -0,0 +1,46 @@
1
+ <p align="center">
2
+ <img height="160" src="docs/_static/logo.png" />
3
+ </p>
4
+
5
+ ##
6
+
7
+ [![test](https://github.com/rsinghlab/pyaging/actions/workflows/test.yml/badge.svg)](https://github.com/rsinghlab/pyaging/actions/workflows/test.yml)
8
+ [![build](https://github.com/rsinghlab/pyaging/actions/workflows/build.yml/badge.svg)](https://github.com/rsinghlab/pyaging/actions/workflows/build.yml)
9
+ [![publish](https://github.com/rsinghlab/pyaging/actions/workflows/publish.yml/badge.svg)](https://github.com/rsinghlab/pyaging/actions/workflows/publish.yml)
10
+ [![release](https://github.com/rsinghlab/pyaging/actions/workflows/release.yml/badge.svg)](https://github.com/rsinghlab/pyaging/actions/workflows/release.yml)
11
+ [![documentation](https://readthedocs.org/projects/pyaging/badge/?version=latest)](https://pyaging.readthedocs.io/en/latest/)
12
+ [![beta](https://img.shields.io/badge/status-beta-yellow)](https://github.com/rsinghlab/pyaging)
13
+ [![upload](https://img.shields.io/pypi/v/pyaging?logo=PyPI)](https://pypi.org/project/pyaging/)
14
+ [![download](https://static.pepy.tech/badge/pyaging)](https://pepy.tech/project/pyaging)
15
+ [![star](https://img.shields.io/github/stars/rsinghlab/pyaging?logo=GitHub&color=red)](https://github.com/rsinghlab/pyaging/stargazers)
16
+
17
+ ## 🐍 **pyaging**: a Python-based compendium of GPU-optimized aging clocks
18
+
19
+ `pyaging` is a cutting-edge Python package designed for the longevity research community, offering a comprehensive suite of GPU-optimized biological aging clocks.
20
+
21
+ [Installation](https://pyaging.readthedocs.io/en/latest/installation.html) - [Search, cite, and get metadata](https://pyaging.readthedocs.io/en/latest/tutorial_utils.html) - [Bulk DNA methylation](https://pyaging.readthedocs.io/en/latest/tutorial_dnam.html) - [Bulk histone mark ChIP-Seq](https://pyaging.readthedocs.io/en/latest/tutorial_histonemarkchipseq.html) - [Bulk ATAC-Seq](https://pyaging.readthedocs.io/en/latest/tutorial_atacseq.html) - [Bulk RNA-Seq](https://pyaging.readthedocs.io/en/latest/tutorial_rnaseq.html) - [API Reference](https://pyaging.readthedocs.io/en/latest/pyaging.html)
22
+
23
+ With a growing number of aging clocks, comparing and analyzing them can be challenging. `pyaging` simplifies this process, allowing researchers to input various molecular layers (DNA methylation, histone ChIP-Seq, ATAC-seq, transcriptomics, etc.) and quickly analyze them using multiple aging clocks, thanks to its GPU-backed infrastructure. This makes it an ideal tool for large datasets and multi-layered analysis.
24
+
25
+ ## 📝 To-Do List
26
+
27
+ - [X] Integrate `black` for PEP8 compliant code formatting
28
+ - [X] Improve and expand `readthedocs` documentation
29
+ - [X] Add option to specify download directory for datasets
30
+ - [X] Rename datasets to reflect source publications
31
+ - [X] Include mammalian array example datasets
32
+ - [X] Add feature to control logging verbosity
33
+ - [ ] Publish to PyPi
34
+ - [ ] Add percentage of missing features in anndata after age prediction for each clock
35
+ - [ ] Add table in readthedocs with all clock metadata
36
+ - [ ] Add and populate "Notes" tab in metadata
37
+ - [ ] Integrate scAge and scRNAseq clocks (and datasets)
38
+ - [ ] Incorporate murine DNA methylation and proteomic clocks (and datasets)
39
+ - [ ] Add PhenoAge based on blood chemistry analysis (and datasets)
40
+
41
+ ## ❓ Can't find an aging clock?
42
+
43
+ If you have recently developed an aging clock and would like it to be integrated into `pyaging`, please [email us](lucas_camillo@alumni.brown.edu). We aim to incorporate it within two weeks!
44
+
45
+ ## 💬 Community Discussion
46
+ For coding-related queries, feedback, and discussions, please visit our [GitHub Issues](https://github.com/rsinghlab/pyaging/issues) page.
@@ -0,0 +1,10 @@
1
+ # pyaging/__init__.py
2
+
3
+ from . import logger
4
+ from . import data
5
+ from . import utils
6
+ from . import models
7
+ from . import preprocess as pp
8
+ from . import predict as pred
9
+
10
+ __version__ = "0.1.0"
@@ -0,0 +1,3 @@
1
+ # pyaging/data/__init__.py
2
+
3
+ from ._data import *
@@ -0,0 +1,75 @@
1
+ import os
2
+ import torch
3
+ import ntpath
4
+ import os
5
+ from urllib.request import urlretrieve
6
+ from functools import wraps
7
+ from ..utils import progress, download
8
+ from ..logger import LoggerManager, main_tqdm, silence_logger
9
+
10
+
11
+ def download_example_data(
12
+ data_type: str, dir: str = "pyaging_data", verbose: bool = True
13
+ ) -> None:
14
+ """
15
+ Downloads example datasets for various types of biological data used in aging studies.
16
+
17
+ This function facilitates the download of example datasets for different types of biological data,
18
+ including methylation, histone mark, RNA-seq, and ATAC-seq data. It is designed to provide quick
19
+ access to standard datasets for users to test and explore the functionalities of the pyaging package.
20
+
21
+ Parameters
22
+ ----------
23
+ data_type : str
24
+ The type of data to download. Valid options are 'methylation', 'histone_mark', 'rnaseq', and 'atac'.
25
+
26
+ dir : str
27
+ The directory to deposit the downloaded file. Defaults to "pyaging_data".
28
+
29
+ verbose: bool
30
+ Whether to log the output to console with the logger. Defaults to True.
31
+
32
+ Raises
33
+ ------
34
+ ValueError
35
+ If the specified data_type is not implemented, a ValueError is raised with a message suggesting
36
+ the user to request its implementation.
37
+
38
+ Notes
39
+ -----
40
+ The function maps the specified data_type to its corresponding URL and then calls the `download`
41
+ function to retrieve the dataset. The datasets are sourced from AWS S3
42
+ and are chosen to represent typical data formats and structures used in aging research.
43
+
44
+ The downloaded data can be used for various analyses, including testing the pyaging package's
45
+ functionalities, learning data processing techniques, or as a benchmark for custom analyses.
46
+
47
+ Examples
48
+ --------
49
+ >>> download_example_data("methylation")
50
+ # This will download the example methylation dataset to the local system.
51
+
52
+ """
53
+ logger = LoggerManager.gen_logger("download_example_data")
54
+ if not verbose:
55
+ silence_logger("download_example_data")
56
+ logger.first_info("Starting download_example_data function")
57
+
58
+ data_type_to_url = {
59
+ "GSE139307": "https://pyaging.s3.amazonaws.com/example_data/GSE139307.pkl",
60
+ "GSE223748": "https://pyaging.s3.amazonaws.com/example_data/GSE223748_subset.pkl",
61
+ "ENCFF386QWG": "https://pyaging.s3.amazonaws.com/example_data/ENCFF386QWG.bigWig",
62
+ "GSE65765": "https://pyaging.s3.amazonaws.com/example_data/GSE65765_CPM.pkl",
63
+ "atac_example": "https://pyaging.s3.amazonaws.com/example_data/atac_example.pkl",
64
+ }
65
+
66
+ if data_type not in list(data_type_to_url.keys()):
67
+ logger.error(
68
+ f"Example data {data_type} has not yet been implemented in pyaging.",
69
+ indent_level=2,
70
+ )
71
+
72
+ url = data_type_to_url[data_type]
73
+ download(url, dir, logger, indent_level=1)
74
+
75
+ logger.done()
@@ -0,0 +1,3 @@
1
+ # pyaging/logger/__init__.py
2
+
3
+ from ._logger import *