discotoolkit 1.1.3__tar.gz → 1.2.0__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.
Files changed (30) hide show
  1. discotoolkit-1.2.0/MANIFEST.in +2 -0
  2. discotoolkit-1.2.0/PKG-INFO +140 -0
  3. discotoolkit-1.2.0/README.md +110 -0
  4. {discotoolkit-1.1.3 → discotoolkit-1.2.0}/discotoolkit/CELLiD.py +270 -98
  5. {discotoolkit-1.1.3 → discotoolkit-1.2.0}/discotoolkit/DiscoClass.py +7 -7
  6. discotoolkit-1.2.0/discotoolkit/DownloadDiscoData.py +238 -0
  7. {discotoolkit-1.1.3 → discotoolkit-1.2.0}/discotoolkit/GeneSearch.py +4 -2
  8. {discotoolkit-1.1.3 → discotoolkit-1.2.0}/discotoolkit/GetMetadata.py +157 -76
  9. discotoolkit-1.2.0/discotoolkit/GlobalVariable.py +81 -0
  10. discotoolkit-1.2.0/discotoolkit/Utilities.py +74 -0
  11. {discotoolkit-1.1.3 → discotoolkit-1.2.0}/discotoolkit/__init__.py +2 -1
  12. discotoolkit-1.2.0/discotoolkit.egg-info/PKG-INFO +140 -0
  13. {discotoolkit-1.1.3 → discotoolkit-1.2.0}/discotoolkit.egg-info/SOURCES.txt +7 -1
  14. {discotoolkit-1.1.3 → discotoolkit-1.2.0}/discotoolkit.egg-info/requires.txt +4 -0
  15. discotoolkit-1.2.0/pyproject.toml +3 -0
  16. discotoolkit-1.2.0/requirements.txt +12 -0
  17. {discotoolkit-1.1.3 → discotoolkit-1.2.0}/setup.py +5 -6
  18. discotoolkit-1.2.0/tests/test_server_contract.py +160 -0
  19. discotoolkit-1.2.0/tests/test_settings.py +90 -0
  20. discotoolkit-1.2.0/tests/test_version.py +41 -0
  21. discotoolkit-1.1.3/MANIFEST.in +0 -1
  22. discotoolkit-1.1.3/PKG-INFO +0 -13
  23. discotoolkit-1.1.3/README.md +0 -72
  24. discotoolkit-1.1.3/discotoolkit/DownloadDiscoData.py +0 -144
  25. discotoolkit-1.1.3/discotoolkit/GlobalVariable.py +0 -25
  26. discotoolkit-1.1.3/discotoolkit.egg-info/PKG-INFO +0 -13
  27. {discotoolkit-1.1.3 → discotoolkit-1.2.0}/discotoolkit/CellMapper.py +0 -0
  28. {discotoolkit-1.1.3 → discotoolkit-1.2.0}/discotoolkit.egg-info/dependency_links.txt +0 -0
  29. {discotoolkit-1.1.3 → discotoolkit-1.2.0}/discotoolkit.egg-info/top_level.txt +0 -0
  30. {discotoolkit-1.1.3 → discotoolkit-1.2.0}/setup.cfg +0 -0
@@ -0,0 +1,2 @@
1
+ include README.md
2
+ include requirements.txt
@@ -0,0 +1,140 @@
1
+ Metadata-Version: 2.4
2
+ Name: discotoolkit
3
+ Version: 1.2.0
4
+ Summary: DISCOtoolkit is an python package that allows users to access data and use the tools provided by the DISCO database.
5
+ Home-page: https://disco.bii.a-star.edu.sg/
6
+ Author: Li Mengwei, Rom Uddamvathanak
7
+ Author-email: uddamvathanak_rom@immunol.a-star.edu.sg
8
+ Requires-Python: >=3.9
9
+ Description-Content-Type: text/markdown
10
+ Requires-Dist: pandas>=1.4.2
11
+ Requires-Dist: numpy>=1.21.6
12
+ Requires-Dist: scanpy>=1.9.3
13
+ Requires-Dist: scipy>=1.10.1
14
+ Requires-Dist: joblib>=1.1.0
15
+ Requires-Dist: pandarallel>=1.6.5
16
+ Requires-Dist: requests>=2.28.1
17
+ Requires-Dist: colorcet>=3.0.1
18
+ Requires-Dist: leidenalg
19
+ Requires-Dist: h5py>=3.8
20
+ Requires-Dist: matplotlib>=3.5
21
+ Requires-Dist: seaborn>=0.12
22
+ Dynamic: author
23
+ Dynamic: author-email
24
+ Dynamic: description
25
+ Dynamic: description-content-type
26
+ Dynamic: home-page
27
+ Dynamic: requires-dist
28
+ Dynamic: requires-python
29
+ Dynamic: summary
30
+
31
+ <!--
32
+ * @Descripttion:
33
+ * @version:
34
+ * @Author: Mengwei Li
35
+ * @Date: 2023-04-16 21:20:42
36
+ * @LastEditors: Mengwei Li
37
+ * @LastEditTime: 2023-04-16 21:22:03
38
+ -->
39
+ [![Documentation Status](https://readthedocs.org/projects/discotoolkit-py/badge/?version=latest)](https://discotoolkit-py.readthedocs.io/en/latest/?badge=latest) [![Downloads](https://static.pepy.tech/personalized-badge/discotoolkit?period=total&units=international_system&left_color=black&right_color=orange&left_text=Downloads)](https://pepy.tech/project/discotoolkit) [![PyPI version](https://img.shields.io/pypi/v/discotoolkit)](https://pypi.org/project/discotoolkit)
40
+
41
+ # DISCOtoolkit 1.2.0
42
+
43
+ DISCOtoolkit is a Python package for accessing the data and tools of the [DISCO database](https://disco.bii.a-star.edu.sg/) (DISCO v1). Read the documentation at [discotoolkit-py.readthedocs.io](https://discotoolkit-py.readthedocs.io/en/latest/).
44
+
45
+ - Filter and download DISCO data based on sample metadata and cell type information
46
+ - Gene search: a gene's expression across cell types and tissues
47
+ - CELLiD: cell type annotation
48
+ - scEnrichment: gene set enrichment using DISCO DEGs
49
+
50
+ > **DISCO v1 and v2.** The toolkit talks to **DISCO v1** by default. DISCO v2 has its own R package ([DISCOtoolkit](https://github.com/JinmiaoChenLab/DISCOtoolkit)); the Python package can still be pointed at a v2 server, see [Choosing a server](#choosing-a-server).
51
+
52
+ ## Quickstart (Google Colab)
53
+
54
+ [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/JinmiaoChenLab/DISCOtoolkit_py/blob/main/docs/quickstart_disco_v1.ipynb)
55
+
56
+ Installs, checks the server, filters, downloads and plots in about ten cells, with nothing to set up locally.
57
+
58
+ ## Installation
59
+
60
+ Python 3.9 or newer. In your current environment:
61
+
62
+ ```
63
+ pip install discotoolkit
64
+ ```
65
+
66
+ To try the latest development version straight from GitHub:
67
+
68
+ ```
69
+ pip install "git+https://github.com/JinmiaoChenLab/DISCOtoolkit_py.git"
70
+ ```
71
+
72
+ To work on the code, or to test changes before they are released, install from a local clone. `-e` links the install to the folder, so edits take effect without reinstalling:
73
+
74
+ ```
75
+ git clone https://github.com/JinmiaoChenLab/DISCOtoolkit_py.git
76
+ cd DISCOtoolkit_py
77
+ pip install -e .
78
+ ```
79
+
80
+ `pip install discotoolkit` and a local install give the same code when the versions match. The difference is the source: PyPI delivers a released, packaged copy, while a local install uses the files in your folder.
81
+
82
+ Dependencies (installed automatically): numpy, pandas, scanpy, scipy, joblib, pandarallel, requests, colorcet, leidenalg, h5py, matplotlib, seaborn.
83
+
84
+ We recommend a virtual environment, for example with miniconda:
85
+
86
+ ```
87
+ conda create --name disco python=3.10
88
+ conda activate disco
89
+ conda install ipykernel
90
+ python -m ipykernel install --user --name disco --display-name "disco"
91
+ python -m pip install -U discotoolkit
92
+ ```
93
+
94
+ ## Choosing a server
95
+
96
+ ```python
97
+ import discotoolkit as dt
98
+
99
+ dt.get_server() # 'https://disco.bii.a-star.edu.sg/disco_v3_api/' (DISCO v1, the default)
100
+ dt.set_server("v2") # DISCO v2
101
+ dt.set_server("https://my.server/disco_v3_api/") # any server with the same API
102
+ ```
103
+
104
+ or set the `DISCO_API_URL` environment variable before importing the package.
105
+
106
+ ## Testing
107
+
108
+ Two small test files need nothing beyond `requests`, so they run anywhere, including Colab:
109
+
110
+ ```
111
+ python tests/test_settings.py # offline: server selection logic
112
+ python tests/test_version.py # offline: setup.py and __init__.py agree on the version
113
+ python tests/test_server_contract.py # online: does the server answer everything the toolkit needs?
114
+ python tests/test_server_contract.py https://immunesinglecell.org/disco_v3_api/ # check another server
115
+ ```
116
+
117
+ GitHub Actions runs these, and installs the package on Python 3.9-3.12, on every push. Maintainers: see [RELEASING.md](RELEASING.md) for how a release is published.
118
+
119
+ `test_server_contract.py` checks status codes and the shape of each response (the columns and file types the toolkit reads). It only samples the large reference files, it does not download them.
120
+
121
+ ## Basic Usage
122
+ Example in Jupyter notebook.
123
+
124
+ <em>please select disco as the kernel for running the jupyter notebook</em>
125
+
126
+ ### [Quickstart for DISCO v1](https://github.com/JinmiaoChenLab/DISCOtoolkit_py/blob/main/docs/quickstart_disco_v1.ipynb)
127
+
128
+ ### [Filter and download DISCO data](https://github.com/JinmiaoChenLab/DISCOtoolkit_py/blob/main/docs/download_data.ipynb)
129
+
130
+ ### [Cell Type Annotation using CELLiD](https://github.com/JinmiaoChenLab/DISCOtoolkit_py/blob/main/docs/CELLiD_celltype_annotation.ipynb)
131
+
132
+ ### [scEnrichment](https://github.com/JinmiaoChenLab/DISCOtoolkit_py/blob/main/docs/scEnrichment.ipynb)
133
+
134
+ ## Citation
135
+ 1. [Li, Mengwei, et al. "DISCO: a database of Deeply Integrated human Single-Cell Omics data." Nucleic acids research 50.D1 (2022): D596-D602.](https://academic.oup.com/nar/article/50/D1/D596/6430491)
136
+ 2. [Mengwei Li, Kok Siong Ang, Brian Teo, Uddamvathanak Rom, Minh N Nguyen, Sebastian Maurer-Stroh, Jinmiao Chen. "Rediscovering publicly available single-cell data with the DISCO platform." Nucleic Acids Research (2024): gkae1108](https://academic.oup.com/nar/advance-article/doi/10.1093/nar/gkae1108/7899529)
137
+
138
+ ## Follow us on our social media!
139
+ - [HSCRM2](https://twitter.com/HSCRM2)
140
+ - [JinmiaoChenLab Github repo](https://github.com/JinmiaoChenLab)
@@ -0,0 +1,110 @@
1
+ <!--
2
+ * @Descripttion:
3
+ * @version:
4
+ * @Author: Mengwei Li
5
+ * @Date: 2023-04-16 21:20:42
6
+ * @LastEditors: Mengwei Li
7
+ * @LastEditTime: 2023-04-16 21:22:03
8
+ -->
9
+ [![Documentation Status](https://readthedocs.org/projects/discotoolkit-py/badge/?version=latest)](https://discotoolkit-py.readthedocs.io/en/latest/?badge=latest) [![Downloads](https://static.pepy.tech/personalized-badge/discotoolkit?period=total&units=international_system&left_color=black&right_color=orange&left_text=Downloads)](https://pepy.tech/project/discotoolkit) [![PyPI version](https://img.shields.io/pypi/v/discotoolkit)](https://pypi.org/project/discotoolkit)
10
+
11
+ # DISCOtoolkit 1.2.0
12
+
13
+ DISCOtoolkit is a Python package for accessing the data and tools of the [DISCO database](https://disco.bii.a-star.edu.sg/) (DISCO v1). Read the documentation at [discotoolkit-py.readthedocs.io](https://discotoolkit-py.readthedocs.io/en/latest/).
14
+
15
+ - Filter and download DISCO data based on sample metadata and cell type information
16
+ - Gene search: a gene's expression across cell types and tissues
17
+ - CELLiD: cell type annotation
18
+ - scEnrichment: gene set enrichment using DISCO DEGs
19
+
20
+ > **DISCO v1 and v2.** The toolkit talks to **DISCO v1** by default. DISCO v2 has its own R package ([DISCOtoolkit](https://github.com/JinmiaoChenLab/DISCOtoolkit)); the Python package can still be pointed at a v2 server, see [Choosing a server](#choosing-a-server).
21
+
22
+ ## Quickstart (Google Colab)
23
+
24
+ [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/JinmiaoChenLab/DISCOtoolkit_py/blob/main/docs/quickstart_disco_v1.ipynb)
25
+
26
+ Installs, checks the server, filters, downloads and plots in about ten cells, with nothing to set up locally.
27
+
28
+ ## Installation
29
+
30
+ Python 3.9 or newer. In your current environment:
31
+
32
+ ```
33
+ pip install discotoolkit
34
+ ```
35
+
36
+ To try the latest development version straight from GitHub:
37
+
38
+ ```
39
+ pip install "git+https://github.com/JinmiaoChenLab/DISCOtoolkit_py.git"
40
+ ```
41
+
42
+ To work on the code, or to test changes before they are released, install from a local clone. `-e` links the install to the folder, so edits take effect without reinstalling:
43
+
44
+ ```
45
+ git clone https://github.com/JinmiaoChenLab/DISCOtoolkit_py.git
46
+ cd DISCOtoolkit_py
47
+ pip install -e .
48
+ ```
49
+
50
+ `pip install discotoolkit` and a local install give the same code when the versions match. The difference is the source: PyPI delivers a released, packaged copy, while a local install uses the files in your folder.
51
+
52
+ Dependencies (installed automatically): numpy, pandas, scanpy, scipy, joblib, pandarallel, requests, colorcet, leidenalg, h5py, matplotlib, seaborn.
53
+
54
+ We recommend a virtual environment, for example with miniconda:
55
+
56
+ ```
57
+ conda create --name disco python=3.10
58
+ conda activate disco
59
+ conda install ipykernel
60
+ python -m ipykernel install --user --name disco --display-name "disco"
61
+ python -m pip install -U discotoolkit
62
+ ```
63
+
64
+ ## Choosing a server
65
+
66
+ ```python
67
+ import discotoolkit as dt
68
+
69
+ dt.get_server() # 'https://disco.bii.a-star.edu.sg/disco_v3_api/' (DISCO v1, the default)
70
+ dt.set_server("v2") # DISCO v2
71
+ dt.set_server("https://my.server/disco_v3_api/") # any server with the same API
72
+ ```
73
+
74
+ or set the `DISCO_API_URL` environment variable before importing the package.
75
+
76
+ ## Testing
77
+
78
+ Two small test files need nothing beyond `requests`, so they run anywhere, including Colab:
79
+
80
+ ```
81
+ python tests/test_settings.py # offline: server selection logic
82
+ python tests/test_version.py # offline: setup.py and __init__.py agree on the version
83
+ python tests/test_server_contract.py # online: does the server answer everything the toolkit needs?
84
+ python tests/test_server_contract.py https://immunesinglecell.org/disco_v3_api/ # check another server
85
+ ```
86
+
87
+ GitHub Actions runs these, and installs the package on Python 3.9-3.12, on every push. Maintainers: see [RELEASING.md](RELEASING.md) for how a release is published.
88
+
89
+ `test_server_contract.py` checks status codes and the shape of each response (the columns and file types the toolkit reads). It only samples the large reference files, it does not download them.
90
+
91
+ ## Basic Usage
92
+ Example in Jupyter notebook.
93
+
94
+ <em>please select disco as the kernel for running the jupyter notebook</em>
95
+
96
+ ### [Quickstart for DISCO v1](https://github.com/JinmiaoChenLab/DISCOtoolkit_py/blob/main/docs/quickstart_disco_v1.ipynb)
97
+
98
+ ### [Filter and download DISCO data](https://github.com/JinmiaoChenLab/DISCOtoolkit_py/blob/main/docs/download_data.ipynb)
99
+
100
+ ### [Cell Type Annotation using CELLiD](https://github.com/JinmiaoChenLab/DISCOtoolkit_py/blob/main/docs/CELLiD_celltype_annotation.ipynb)
101
+
102
+ ### [scEnrichment](https://github.com/JinmiaoChenLab/DISCOtoolkit_py/blob/main/docs/scEnrichment.ipynb)
103
+
104
+ ## Citation
105
+ 1. [Li, Mengwei, et al. "DISCO: a database of Deeply Integrated human Single-Cell Omics data." Nucleic acids research 50.D1 (2022): D596-D602.](https://academic.oup.com/nar/article/50/D1/D596/6430491)
106
+ 2. [Mengwei Li, Kok Siong Ang, Brian Teo, Uddamvathanak Rom, Minh N Nguyen, Sebastian Maurer-Stroh, Jinmiao Chen. "Rediscovering publicly available single-cell data with the DISCO platform." Nucleic Acids Research (2024): gkae1108](https://academic.oup.com/nar/advance-article/doi/10.1093/nar/gkae1108/7899529)
107
+
108
+ ## Follow us on our social media!
109
+ - [HSCRM2](https://twitter.com/HSCRM2)
110
+ - [JinmiaoChenLab Github repo](https://github.com/JinmiaoChenLab)