pelmesha 0.0.1.dev1__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.
@@ -0,0 +1,121 @@
1
+ # name: Publish Python ๐Ÿ distribution ๐Ÿ“ฆ to PyPI
2
+
3
+ # on:
4
+ # push:
5
+ # branches:
6
+ # - main
7
+
8
+ # jobs:
9
+ # build:
10
+ # name: Build distribution ๐Ÿ“ฆ
11
+ # runs-on: ubuntu-latest
12
+
13
+ # steps:
14
+ # - uses: actions/checkout@v4
15
+ # with:
16
+ # persist-credentials: false
17
+ # fetch-depth: 0
18
+ # - name: Set up Python
19
+ # uses: actions/setup-python@v5
20
+ # with:
21
+ # python-version: "3.x"
22
+
23
+ # - name: Install pypa/build
24
+ # run: >-
25
+ # python3 -m
26
+ # pip install
27
+ # build
28
+ # --user
29
+ # - name: Build a binary wheel and a source tarball
30
+ # run: python3 -m build
31
+ # - name: Store the distribution packages
32
+ # uses: actions/upload-artifact@v4
33
+ # with:
34
+ # name: python-package-distributions
35
+ # path: dist/
36
+ # publish-to-pypi:
37
+ # name: Publish Python ๐Ÿ distribution ๐Ÿ“ฆ to PyPI
38
+ # needs:
39
+ # - build
40
+ # runs-on: ubuntu-latest
41
+
42
+ # environment:
43
+ # name: pypi
44
+ # url: https://pypi.org/p/pelmesha
45
+
46
+ # permissions:
47
+ # id-token: write # IMPORTANT: mandatory for trusted publishing
48
+
49
+ # steps:
50
+ # - name: Download all the dists
51
+ # uses: actions/download-artifact@v4
52
+ # with:
53
+ # name: python-package-distributions
54
+ # path: dist/
55
+ # - name: Publish distribution ๐Ÿ“ฆ to PyPI
56
+ # uses: pypa/gh-action-pypi-publish@release/v1
57
+
58
+ # # steps:
59
+ # # - name: Download all the dists
60
+ # # uses: actions/download-artifact@v4
61
+ # # with:
62
+ # # name: python-package-distributions
63
+ # # path: dist/
64
+ # # - name: Publish distribution ๐Ÿ“ฆ to TestPyPI
65
+ # # uses: pypa/gh-action-pypi-publish@release/v1
66
+ # # with:
67
+ # # repository-url: https://test.pypi.org/legacy/
68
+ # # name: Publish Python ๐Ÿ distribution ๐Ÿ“ฆ to PyPI
69
+
70
+ on:
71
+ push:
72
+ branches:
73
+ - main
74
+
75
+ jobs:
76
+ build:
77
+ name: Build distribution ๐Ÿ“ฆ
78
+ runs-on: ubuntu-latest
79
+
80
+ steps:
81
+ - uses: actions/checkout@v4
82
+ with:
83
+ persist-credentials: false
84
+ - name: Set up Python
85
+ uses: actions/setup-python@v5
86
+ with:
87
+ python-version: "3.x"
88
+
89
+ - name: Install pypa/build
90
+ run: >-
91
+ python3 -m
92
+ pip install
93
+ build
94
+ --user
95
+ - name: Build a binary wheel and a source tarball
96
+ run: python3 -m build
97
+ - name: Store the distribution packages
98
+ uses: actions/upload-artifact@v4
99
+ with:
100
+ name: python-package-distributions
101
+ path: dist/
102
+ publish-to-pypi:
103
+ name: >-
104
+ Publish Python ๐Ÿ distribution ๐Ÿ“ฆ to PyPI
105
+ # if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
106
+ needs:
107
+ - build
108
+ runs-on: ubuntu-latest
109
+ environment:
110
+ name: pypi
111
+ url: https://pypi.org/p/pelmesha
112
+ permissions:
113
+ id-token: write # IMPORTANT: mandatory for trusted publishing
114
+ steps:
115
+ - name: Download all the dists
116
+ uses: actions/download-artifact@v4
117
+ with:
118
+ name: python-package-distributions
119
+ path: dist/
120
+ - name: Publish distribution ๐Ÿ“ฆ to PyPI
121
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,37 @@
1
+ Metadata-Version: 2.4
2
+ Name: pelmesha
3
+ Version: 0.0.1.dev1
4
+ Summary: A package for proccesing and aligning peaklist Mass-spectrometry imaging data from .imzml files
5
+ Author-email: Andrew Kuzin <Kuzya-90@bk.ru>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/Testudinata/pelmesha
8
+ Project-URL: Issues, https://github.com/Testudinata/pelmesha/issues
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Development Status :: 4 - Beta
12
+ Requires-Python: >=3.11
13
+ Description-Content-Type: text/markdown
14
+ License-File: LICENSE.txt
15
+ Dynamic: license-file
16
+
17
+ # Package pelmesha
18
+
19
+ `pelmesha` (Peak Extraction Library for Mass spectrometry Enhanced by Statistical High-throughputย Analysis) is a Python package that allows users to process Mass Spectrometry Imaging (MSI) data from imzml files. It provides several features, including:
20
+ 1) Conversion of raw imzml data to the hdf5 format (function `imzml2hdf5` from module `pspectra`)
21
+ 2) Processing of mass spectra (function `Raw2proc` from module `pspectra`)
22
+ 3) Creation of peaklists from the data (functions `proc2peaklist` and `Raw2peaklist` from module `pspectra`)
23
+ 4) Generation of a feature matrix from a single image's peaklist by grouping peaks (function `Pgrouping_KD` from module `pfeats`)
24
+ 5) Generation of a feature matrix for multiple images from the peaklists of each image (function `Roi_Pgrouping_KD` from module `pfeats`)
25
+
26
+ The processing of mass spectra includes several steps:
27
+ - **Data resampling** โ€” This process allows you to bring data to a uniform scale between points on the `mz` and to a single scale on the `mz`.
28
+ - **Alignment of spectra relative to reference peaks** using the [`msalign`](https://github.com/lukasz-migas/msalign) tool. It should be noted that `msalign` does a worse job with non-continuous and non-uniform data, so it is strongly recommended to perform a resampling process before using it. Also `msalign` is modified in this package for correct work with other steps.
29
+ - **Baseline correction** using the [pybaselines](https://pybaselines.readthedocs.io) package.
30
+ - **Smoothing** โ€” based on code snippets from the [mMass](https://github.com/xxao/mMass) library, which provide smoothing using the moving average, Gaussian, and Savitsky-Goley algorithms.
31
+ - **Peak-picking** โ€” peaks in the spectrum are searched and filtered.
32
+
33
+ In the mass spectra in the image, there is a slight difference in the peak values, even after alignment during processing. To further analyze these spectra, it will be necessary to group the peaks based on their relative positions and create a feature matrix as a result.
34
+
35
+ The `Pgrouping_KD` and `Roi_Pgrouping_KD` functions combine the wandering peak values from signals in mass spectra into a single `mz` value based on their kernel density estimation. This is achieved by determining the centers around which the peak values are located.
36
+
37
+ To ensure accurate results, high-quality bandwidth selection is required. This can be done manually or automatically. The probability density is estimated using the FFTKDE function from the [kdepy package](https://github.com/tommyod/KDEpy), which is extremely fast and uses Fourier transforms for calculation.
@@ -0,0 +1,12 @@
1
+ [[source]]
2
+ url = "https://pypi.org/simple"
3
+ verify_ssl = true
4
+ name = "pypi"
5
+
6
+ [packages]
7
+ requests = "*"
8
+
9
+ [dev-packages]
10
+
11
+ [requires]
12
+ python_version = "3.13"
@@ -0,0 +1,152 @@
1
+ {
2
+ "_meta": {
3
+ "hash": {
4
+ "sha256": "1841259a6294939b3dde91acf33c2e02af40cae97022c9b3da3f7f2bb07c77c5"
5
+ },
6
+ "pipfile-spec": 6,
7
+ "requires": {
8
+ "python_version": "3.13"
9
+ },
10
+ "sources": [
11
+ {
12
+ "name": "pypi",
13
+ "url": "https://pypi.org/simple",
14
+ "verify_ssl": true
15
+ }
16
+ ]
17
+ },
18
+ "default": {
19
+ "certifi": {
20
+ "hashes": [
21
+ "sha256:2e0c7ce7cb5d8f8634ca55d2ba7e6ec2689a2fd6537d8dec1296a477a4910057",
22
+ "sha256:d747aa5a8b9bbbb1bb8c22bb13e22bd1f18e9796defa16bab421f7f7a317323b"
23
+ ],
24
+ "markers": "python_version >= '3.7'",
25
+ "version": "==2025.6.15"
26
+ },
27
+ "charset-normalizer": {
28
+ "hashes": [
29
+ "sha256:005fa3432484527f9732ebd315da8da8001593e2cf46a3d817669f062c3d9ed4",
30
+ "sha256:046595208aae0120559a67693ecc65dd75d46f7bf687f159127046628178dc45",
31
+ "sha256:0c29de6a1a95f24b9a1aa7aefd27d2487263f00dfd55a77719b530788f75cff7",
32
+ "sha256:0c8c57f84ccfc871a48a47321cfa49ae1df56cd1d965a09abe84066f6853b9c0",
33
+ "sha256:0f5d9ed7f254402c9e7d35d2f5972c9bbea9040e99cd2861bd77dc68263277c7",
34
+ "sha256:18dd2e350387c87dabe711b86f83c9c78af772c748904d372ade190b5c7c9d4d",
35
+ "sha256:1b1bde144d98e446b056ef98e59c256e9294f6b74d7af6846bf5ffdafd687a7d",
36
+ "sha256:1c95a1e2902a8b722868587c0e1184ad5c55631de5afc0eb96bc4b0d738092c0",
37
+ "sha256:1cad5f45b3146325bb38d6855642f6fd609c3f7cad4dbaf75549bf3b904d3184",
38
+ "sha256:21b2899062867b0e1fde9b724f8aecb1af14f2778d69aacd1a5a1853a597a5db",
39
+ "sha256:24498ba8ed6c2e0b56d4acbf83f2d989720a93b41d712ebd4f4979660db4417b",
40
+ "sha256:25a23ea5c7edc53e0f29bae2c44fcb5a1aa10591aae107f2a2b2583a9c5cbc64",
41
+ "sha256:289200a18fa698949d2b39c671c2cc7a24d44096784e76614899a7ccf2574b7b",
42
+ "sha256:28a1005facc94196e1fb3e82a3d442a9d9110b8434fc1ded7a24a2983c9888d8",
43
+ "sha256:32fc0341d72e0f73f80acb0a2c94216bd704f4f0bce10aedea38f30502b271ff",
44
+ "sha256:36b31da18b8890a76ec181c3cf44326bf2c48e36d393ca1b72b3f484113ea344",
45
+ "sha256:3c21d4fca343c805a52c0c78edc01e3477f6dd1ad7c47653241cf2a206d4fc58",
46
+ "sha256:3fddb7e2c84ac87ac3a947cb4e66d143ca5863ef48e4a5ecb83bd48619e4634e",
47
+ "sha256:43e0933a0eff183ee85833f341ec567c0980dae57c464d8a508e1b2ceb336471",
48
+ "sha256:4a476b06fbcf359ad25d34a057b7219281286ae2477cc5ff5e3f70a246971148",
49
+ "sha256:4e594135de17ab3866138f496755f302b72157d115086d100c3f19370839dd3a",
50
+ "sha256:50bf98d5e563b83cc29471fa114366e6806bc06bc7a25fd59641e41445327836",
51
+ "sha256:5a9979887252a82fefd3d3ed2a8e3b937a7a809f65dcb1e068b090e165bbe99e",
52
+ "sha256:5baececa9ecba31eff645232d59845c07aa030f0c81ee70184a90d35099a0e63",
53
+ "sha256:5bf4545e3b962767e5c06fe1738f951f77d27967cb2caa64c28be7c4563e162c",
54
+ "sha256:6333b3aa5a12c26b2a4d4e7335a28f1475e0e5e17d69d55141ee3cab736f66d1",
55
+ "sha256:65c981bdbd3f57670af8b59777cbfae75364b483fa8a9f420f08094531d54a01",
56
+ "sha256:68a328e5f55ec37c57f19ebb1fdc56a248db2e3e9ad769919a58672958e8f366",
57
+ "sha256:6a0289e4589e8bdfef02a80478f1dfcb14f0ab696b5a00e1f4b8a14a307a3c58",
58
+ "sha256:6b66f92b17849b85cad91259efc341dce9c1af48e2173bf38a85c6329f1033e5",
59
+ "sha256:6c9379d65defcab82d07b2a9dfbfc2e95bc8fe0ebb1b176a3190230a3ef0e07c",
60
+ "sha256:6fc1f5b51fa4cecaa18f2bd7a003f3dd039dd615cd69a2afd6d3b19aed6775f2",
61
+ "sha256:70f7172939fdf8790425ba31915bfbe8335030f05b9913d7ae00a87d4395620a",
62
+ "sha256:721c76e84fe669be19c5791da68232ca2e05ba5185575086e384352e2c309597",
63
+ "sha256:7222ffd5e4de8e57e03ce2cef95a4c43c98fcb72ad86909abdfc2c17d227fc1b",
64
+ "sha256:75d10d37a47afee94919c4fab4c22b9bc2a8bf7d4f46f87363bcf0573f3ff4f5",
65
+ "sha256:76af085e67e56c8816c3ccf256ebd136def2ed9654525348cfa744b6802b69eb",
66
+ "sha256:770cab594ecf99ae64c236bc9ee3439c3f46be49796e265ce0cc8bc17b10294f",
67
+ "sha256:7a6ab32f7210554a96cd9e33abe3ddd86732beeafc7a28e9955cdf22ffadbab0",
68
+ "sha256:7c48ed483eb946e6c04ccbe02c6b4d1d48e51944b6db70f697e089c193404941",
69
+ "sha256:7f56930ab0abd1c45cd15be65cc741c28b1c9a34876ce8c17a2fa107810c0af0",
70
+ "sha256:8075c35cd58273fee266c58c0c9b670947c19df5fb98e7b66710e04ad4e9ff86",
71
+ "sha256:8272b73e1c5603666618805fe821edba66892e2870058c94c53147602eab29c7",
72
+ "sha256:82d8fd25b7f4675d0c47cf95b594d4e7b158aca33b76aa63d07186e13c0e0ab7",
73
+ "sha256:844da2b5728b5ce0e32d863af26f32b5ce61bc4273a9c720a9f3aa9df73b1455",
74
+ "sha256:8755483f3c00d6c9a77f490c17e6ab0c8729e39e6390328e42521ef175380ae6",
75
+ "sha256:915f3849a011c1f593ab99092f3cecfcb4d65d8feb4a64cf1bf2d22074dc0ec4",
76
+ "sha256:926ca93accd5d36ccdabd803392ddc3e03e6d4cd1cf17deff3b989ab8e9dbcf0",
77
+ "sha256:982bb1e8b4ffda883b3d0a521e23abcd6fd17418f6d2c4118d257a10199c0ce3",
78
+ "sha256:98f862da73774290f251b9df8d11161b6cf25b599a66baf087c1ffe340e9bfd1",
79
+ "sha256:9cbfacf36cb0ec2897ce0ebc5d08ca44213af24265bd56eca54bee7923c48fd6",
80
+ "sha256:a370b3e078e418187da8c3674eddb9d983ec09445c99a3a263c2011993522981",
81
+ "sha256:a955b438e62efdf7e0b7b52a64dc5c3396e2634baa62471768a64bc2adb73d5c",
82
+ "sha256:aa6af9e7d59f9c12b33ae4e9450619cf2488e2bbe9b44030905877f0b2324980",
83
+ "sha256:aa88ca0b1932e93f2d961bf3addbb2db902198dca337d88c89e1559e066e7645",
84
+ "sha256:aaeeb6a479c7667fbe1099af9617c83aaca22182d6cf8c53966491a0f1b7ffb7",
85
+ "sha256:aaf27faa992bfee0264dc1f03f4c75e9fcdda66a519db6b957a3f826e285cf12",
86
+ "sha256:b2680962a4848b3c4f155dc2ee64505a9c57186d0d56b43123b17ca3de18f0fa",
87
+ "sha256:b2d318c11350e10662026ad0eb71bb51c7812fc8590825304ae0bdd4ac283acd",
88
+ "sha256:b33de11b92e9f75a2b545d6e9b6f37e398d86c3e9e9653c4864eb7e89c5773ef",
89
+ "sha256:b3daeac64d5b371dea99714f08ffc2c208522ec6b06fbc7866a450dd446f5c0f",
90
+ "sha256:be1e352acbe3c78727a16a455126d9ff83ea2dfdcbc83148d2982305a04714c2",
91
+ "sha256:bee093bf902e1d8fc0ac143c88902c3dfc8941f7ea1d6a8dd2bcb786d33db03d",
92
+ "sha256:c72fbbe68c6f32f251bdc08b8611c7b3060612236e960ef848e0a517ddbe76c5",
93
+ "sha256:c9e36a97bee9b86ef9a1cf7bb96747eb7a15c2f22bdb5b516434b00f2a599f02",
94
+ "sha256:cddf7bd982eaa998934a91f69d182aec997c6c468898efe6679af88283b498d3",
95
+ "sha256:cf713fe9a71ef6fd5adf7a79670135081cd4431c2943864757f0fa3a65b1fafd",
96
+ "sha256:d11b54acf878eef558599658b0ffca78138c8c3655cf4f3a4a673c437e67732e",
97
+ "sha256:d41c4d287cfc69060fa91cae9683eacffad989f1a10811995fa309df656ec214",
98
+ "sha256:d524ba3f1581b35c03cb42beebab4a13e6cdad7b36246bd22541fa585a56cccd",
99
+ "sha256:daac4765328a919a805fa5e2720f3e94767abd632ae410a9062dff5412bae65a",
100
+ "sha256:db4c7bf0e07fc3b7d89ac2a5880a6a8062056801b83ff56d8464b70f65482b6c",
101
+ "sha256:dc7039885fa1baf9be153a0626e337aa7ec8bf96b0128605fb0d77788ddc1681",
102
+ "sha256:dccab8d5fa1ef9bfba0590ecf4d46df048d18ffe3eec01eeb73a42e0d9e7a8ba",
103
+ "sha256:dedb8adb91d11846ee08bec4c8236c8549ac721c245678282dcb06b221aab59f",
104
+ "sha256:e45ba65510e2647721e35323d6ef54c7974959f6081b58d4ef5d87c60c84919a",
105
+ "sha256:e53efc7c7cee4c1e70661e2e112ca46a575f90ed9ae3fef200f2a25e954f4b28",
106
+ "sha256:e635b87f01ebc977342e2697d05b56632f5f879a4f15955dfe8cef2448b51691",
107
+ "sha256:e70e990b2137b29dc5564715de1e12701815dacc1d056308e2b17e9095372a82",
108
+ "sha256:e8082b26888e2f8b36a042a58307d5b917ef2b1cacab921ad3323ef91901c71a",
109
+ "sha256:e8323a9b031aa0393768b87f04b4164a40037fb2a3c11ac06a03ffecd3618027",
110
+ "sha256:e92fca20c46e9f5e1bb485887d074918b13543b1c2a1185e69bb8d17ab6236a7",
111
+ "sha256:eb30abc20df9ab0814b5a2524f23d75dcf83cde762c161917a2b4b7b55b1e518",
112
+ "sha256:eba9904b0f38a143592d9fc0e19e2df0fa2e41c3c3745554761c5f6447eedabf",
113
+ "sha256:ef8de666d6179b009dce7bcb2ad4c4a779f113f12caf8dc77f0162c29d20490b",
114
+ "sha256:efd387a49825780ff861998cd959767800d54f8308936b21025326de4b5a42b9",
115
+ "sha256:f0aa37f3c979cf2546b73e8222bbfa3dc07a641585340179d768068e3455e544",
116
+ "sha256:f4074c5a429281bf056ddd4c5d3b740ebca4d43ffffe2ef4bf4d2d05114299da",
117
+ "sha256:f69a27e45c43520f5487f27627059b64aaf160415589230992cec34c5e18a509",
118
+ "sha256:fb707f3e15060adf5b7ada797624a6c6e0138e2a26baa089df64c68ee98e040f",
119
+ "sha256:fcbe676a55d7445b22c10967bceaaf0ee69407fbe0ece4d032b6eb8d4565982a",
120
+ "sha256:fdb20a30fe1175ecabed17cbf7812f7b804b8a315a25f24678bcdf120a90077f"
121
+ ],
122
+ "markers": "python_version >= '3.7'",
123
+ "version": "==3.4.2"
124
+ },
125
+ "idna": {
126
+ "hashes": [
127
+ "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9",
128
+ "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"
129
+ ],
130
+ "markers": "python_version >= '3.6'",
131
+ "version": "==3.10"
132
+ },
133
+ "requests": {
134
+ "hashes": [
135
+ "sha256:27babd3cda2a6d50b30443204ee89830707d396671944c998b5975b031ac2b2c",
136
+ "sha256:27d0316682c8a29834d3264820024b62a36942083d52caf2f14c0591336d3422"
137
+ ],
138
+ "index": "pypi",
139
+ "markers": "python_version >= '3.8'",
140
+ "version": "==2.32.4"
141
+ },
142
+ "urllib3": {
143
+ "hashes": [
144
+ "sha256:3fc47733c7e419d4bc3f6b3dc2b4f890bb743906a30d56ba4a5bfa4bbff92760",
145
+ "sha256:e6b01673c0fa6a13e374b50871808eb3bf7046c4b125b216f6bf1cc604cff0dc"
146
+ ],
147
+ "markers": "python_version >= '3.9'",
148
+ "version": "==2.5.0"
149
+ }
150
+ },
151
+ "develop": {}
152
+ }
@@ -0,0 +1,21 @@
1
+ # Package pelmesha
2
+
3
+ `pelmesha` (Peak Extraction Library for Mass spectrometry Enhanced by Statistical High-throughputย Analysis) is a Python package that allows users to process Mass Spectrometry Imaging (MSI) data from imzml files. It provides several features, including:
4
+ 1) Conversion of raw imzml data to the hdf5 format (function `imzml2hdf5` from module `pspectra`)
5
+ 2) Processing of mass spectra (function `Raw2proc` from module `pspectra`)
6
+ 3) Creation of peaklists from the data (functions `proc2peaklist` and `Raw2peaklist` from module `pspectra`)
7
+ 4) Generation of a feature matrix from a single image's peaklist by grouping peaks (function `Pgrouping_KD` from module `pfeats`)
8
+ 5) Generation of a feature matrix for multiple images from the peaklists of each image (function `Roi_Pgrouping_KD` from module `pfeats`)
9
+
10
+ The processing of mass spectra includes several steps:
11
+ - **Data resampling** โ€” This process allows you to bring data to a uniform scale between points on the `mz` and to a single scale on the `mz`.
12
+ - **Alignment of spectra relative to reference peaks** using the [`msalign`](https://github.com/lukasz-migas/msalign) tool. It should be noted that `msalign` does a worse job with non-continuous and non-uniform data, so it is strongly recommended to perform a resampling process before using it. Also `msalign` is modified in this package for correct work with other steps.
13
+ - **Baseline correction** using the [pybaselines](https://pybaselines.readthedocs.io) package.
14
+ - **Smoothing** โ€” based on code snippets from the [mMass](https://github.com/xxao/mMass) library, which provide smoothing using the moving average, Gaussian, and Savitsky-Goley algorithms.
15
+ - **Peak-picking** โ€” peaks in the spectrum are searched and filtered.
16
+
17
+ In the mass spectra in the image, there is a slight difference in the peak values, even after alignment during processing. To further analyze these spectra, it will be necessary to group the peaks based on their relative positions and create a feature matrix as a result.
18
+
19
+ The `Pgrouping_KD` and `Roi_Pgrouping_KD` functions combine the wandering peak values from signals in mass spectra into a single `mz` value based on their kernel density estimation. This is achieved by determining the centers around which the peak values are located.
20
+
21
+ To ensure accurate results, high-quality bandwidth selection is required. This can be done manually or automatically. The probability density is estimated using the FFTKDE function from the [kdepy package](https://github.com/tommyod/KDEpy), which is extremely fast and uses Fourier transforms for calculation.
@@ -0,0 +1,28 @@
1
+ [project]
2
+ name = "pelmesha"
3
+ #version = "0.0.2"
4
+ dynamic = ["version"]
5
+ authors = [
6
+ { name="Andrew Kuzin", email="Kuzya-90@bk.ru" },
7
+ ]
8
+ description = "A package for proccesing and aligning peaklist Mass-spectrometry imaging data from .imzml files"
9
+ readme = "README.md"
10
+ requires-python = ">=3.11"
11
+ classifiers = [
12
+ "Programming Language :: Python :: 3",
13
+ "Operating System :: OS Independent",
14
+ "Development Status :: 4 - Beta",
15
+ ]
16
+
17
+ license = "Apache-2.0"
18
+ license-files = ["LICEN[CS]E*"]
19
+ [build-system]
20
+ requires = ["setuptools>=72", "setuptools-scm>=8"]
21
+ build-backend = "setuptools.build_meta"
22
+ [project.urls]
23
+ Homepage = "https://github.com/Testudinata/pelmesha"
24
+ Issues = "https://github.com/Testudinata/pelmesha/issues"
25
+ [tool.setuptools_scm]
26
+ # version_file = "_version.py"
27
+ version_scheme = 'python-simplified-semver'
28
+ local_scheme = 'no-local-version'
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,8 @@
1
+ """
2
+ pelmesha
3
+
4
+ pelmesha is a Python library for loading, preprocessing, processing, storage and extracting peaklists of Mass Spectrometry Imaging (MSI) data.
5
+ """
6
+
7
+ __author__ = 'Andrey Kuzin'
8
+ __credits__ = 'Moscow Institue of Physics and Technology'