libgunshotmatch 0.10.1__tar.gz → 0.11.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.
Potentially problematic release.
This version of libgunshotmatch might be problematic. Click here for more details.
- {libgunshotmatch-0.10.1 → libgunshotmatch-0.11.0}/PKG-INFO +3 -3
- {libgunshotmatch-0.10.1 → libgunshotmatch-0.11.0}/README.rst +1 -1
- {libgunshotmatch-0.10.1 → libgunshotmatch-0.11.0}/libgunshotmatch/__init__.py +1 -1
- {libgunshotmatch-0.10.1 → libgunshotmatch-0.11.0}/libgunshotmatch/consolidate/__init__.py +30 -1
- {libgunshotmatch-0.10.1 → libgunshotmatch-0.11.0}/libgunshotmatch/peak.py +23 -0
- {libgunshotmatch-0.10.1 → libgunshotmatch-0.11.0}/pyproject.toml +14 -17
- {libgunshotmatch-0.10.1 → libgunshotmatch-0.11.0}/LICENSE +0 -0
- {libgunshotmatch-0.10.1 → libgunshotmatch-0.11.0}/libgunshotmatch/comparison/__init__.py +0 -0
- {libgunshotmatch-0.10.1 → libgunshotmatch-0.11.0}/libgunshotmatch/comparison/_utils.py +0 -0
- {libgunshotmatch-0.10.1 → libgunshotmatch-0.11.0}/libgunshotmatch/comparison/projects.py +0 -0
- {libgunshotmatch-0.10.1 → libgunshotmatch-0.11.0}/libgunshotmatch/comparison/unknowns.py +0 -0
- {libgunshotmatch-0.10.1 → libgunshotmatch-0.11.0}/libgunshotmatch/consolidate/_fields.py +0 -0
- {libgunshotmatch-0.10.1 → libgunshotmatch-0.11.0}/libgunshotmatch/consolidate/_spectra.py +0 -0
- {libgunshotmatch-0.10.1 → libgunshotmatch-0.11.0}/libgunshotmatch/datafile.py +0 -0
- {libgunshotmatch-0.10.1 → libgunshotmatch-0.11.0}/libgunshotmatch/gzip_util.py +0 -0
- {libgunshotmatch-0.10.1 → libgunshotmatch-0.11.0}/libgunshotmatch/method/__init__.py +0 -0
- {libgunshotmatch-0.10.1 → libgunshotmatch-0.11.0}/libgunshotmatch/method/_fields.py +0 -0
- {libgunshotmatch-0.10.1 → libgunshotmatch-0.11.0}/libgunshotmatch/project.py +0 -0
- {libgunshotmatch-0.10.1 → libgunshotmatch-0.11.0}/libgunshotmatch/py.typed +0 -0
- {libgunshotmatch-0.10.1 → libgunshotmatch-0.11.0}/libgunshotmatch/search.py +0 -0
- {libgunshotmatch-0.10.1 → libgunshotmatch-0.11.0}/libgunshotmatch/utils.py +0 -0
- {libgunshotmatch-0.10.1 → libgunshotmatch-0.11.0}/requirements.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: libgunshotmatch
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.11.0
|
|
4
4
|
Summary: Base library for GunShotMatch.
|
|
5
5
|
Author-email: Dominic Davis-Foster <dominic@davis-foster.co.uk>
|
|
6
6
|
License: MIT
|
|
@@ -135,7 +135,7 @@ libgunshotmatch
|
|
|
135
135
|
.. |language| image:: https://img.shields.io/github/languages/top/GunShotMatch/libgunshotmatch
|
|
136
136
|
:alt: GitHub top language
|
|
137
137
|
|
|
138
|
-
.. |commits-since| image:: https://img.shields.io/github/commits-since/GunShotMatch/libgunshotmatch/v0.
|
|
138
|
+
.. |commits-since| image:: https://img.shields.io/github/commits-since/GunShotMatch/libgunshotmatch/v0.11.0
|
|
139
139
|
:target: https://github.com/GunShotMatch/libgunshotmatch/pulse
|
|
140
140
|
:alt: GitHub commits since tagged version
|
|
141
141
|
|
|
@@ -91,7 +91,7 @@ libgunshotmatch
|
|
|
91
91
|
.. |language| image:: https://img.shields.io/github/languages/top/GunShotMatch/libgunshotmatch
|
|
92
92
|
:alt: GitHub top language
|
|
93
93
|
|
|
94
|
-
.. |commits-since| image:: https://img.shields.io/github/commits-since/GunShotMatch/libgunshotmatch/v0.
|
|
94
|
+
.. |commits-since| image:: https://img.shields.io/github/commits-since/GunShotMatch/libgunshotmatch/v0.11.0
|
|
95
95
|
:target: https://github.com/GunShotMatch/libgunshotmatch/pulse
|
|
96
96
|
:alt: GitHub commits since tagged version
|
|
97
97
|
|
|
@@ -29,5 +29,5 @@ Base library for GunShotMatch.
|
|
|
29
29
|
__author__: str = "Dominic Davis-Foster"
|
|
30
30
|
__copyright__: str = "2020-2023 Dominic Davis-Foster"
|
|
31
31
|
__license__: str = "MIT License"
|
|
32
|
-
__version__: str = "0.
|
|
32
|
+
__version__: str = "0.11.0"
|
|
33
33
|
__email__: str = "dominic@davis-foster.co.uk"
|
|
@@ -27,7 +27,7 @@ Functions for combining peak identifications across aligned peaks into a single
|
|
|
27
27
|
#
|
|
28
28
|
|
|
29
29
|
# stdlib
|
|
30
|
-
from collections import Counter
|
|
30
|
+
from collections import Counter, defaultdict
|
|
31
31
|
from fnmatch import fnmatch
|
|
32
32
|
from itertools import permutations
|
|
33
33
|
from multiprocessing import Pool
|
|
@@ -61,6 +61,7 @@ __all__ = (
|
|
|
61
61
|
"pairwise_ms_comparisons",
|
|
62
62
|
"ConsolidatedPeakFilter",
|
|
63
63
|
"InvertedFilter",
|
|
64
|
+
"combine_spectra",
|
|
64
65
|
)
|
|
65
66
|
|
|
66
67
|
|
|
@@ -804,3 +805,31 @@ class InvertedFilter(ConsolidatedPeakFilter):
|
|
|
804
805
|
filtered_consolidated_peaks.append(cp)
|
|
805
806
|
|
|
806
807
|
return filtered_consolidated_peaks
|
|
808
|
+
|
|
809
|
+
|
|
810
|
+
def combine_spectra(peak: ConsolidatedPeak) -> Tuple[List[int], List[float]]:
|
|
811
|
+
"""
|
|
812
|
+
Sum the intensities across all mass spectra in the given peak.
|
|
813
|
+
|
|
814
|
+
:param peak:
|
|
815
|
+
|
|
816
|
+
:returns: List of masses and list of corresponding intensities.
|
|
817
|
+
|
|
818
|
+
.. versionadded:: v0.11.0
|
|
819
|
+
"""
|
|
820
|
+
|
|
821
|
+
combined_ms_data: Dict[int, float] = defaultdict(float)
|
|
822
|
+
|
|
823
|
+
for ms in peak.ms_list:
|
|
824
|
+
if ms is not None:
|
|
825
|
+
for mass, intensity in zip(ms.mass_list, ms.intensity_list):
|
|
826
|
+
combined_ms_data[mass] += intensity
|
|
827
|
+
|
|
828
|
+
mass_list, intensity_list = [], []
|
|
829
|
+
for mass, intensity in combined_ms_data.items():
|
|
830
|
+
mass_list.append(mass)
|
|
831
|
+
intensity_list.append(intensity)
|
|
832
|
+
|
|
833
|
+
# mass_list, intensity_list = zip(*combined_ms_data.items())
|
|
834
|
+
|
|
835
|
+
return mass_list, intensity_list
|
|
@@ -55,6 +55,7 @@ __all__ = (
|
|
|
55
55
|
"filter_peaks",
|
|
56
56
|
"peak_from_dict",
|
|
57
57
|
"write_alignment",
|
|
58
|
+
"base_peak_mass",
|
|
58
59
|
)
|
|
59
60
|
|
|
60
61
|
|
|
@@ -531,3 +532,25 @@ def _to_peak_list(a_list: List[Peak]) -> PeakList:
|
|
|
531
532
|
return a_list
|
|
532
533
|
else:
|
|
533
534
|
return PeakList(a_list)
|
|
535
|
+
|
|
536
|
+
|
|
537
|
+
def base_peak_mass(peak: Peak) -> float:
|
|
538
|
+
"""
|
|
539
|
+
Returns the mass of the largest fragment in the peak's mass spectrum.
|
|
540
|
+
|
|
541
|
+
:param peak:
|
|
542
|
+
|
|
543
|
+
.. versionadded:: v0.11.0
|
|
544
|
+
"""
|
|
545
|
+
|
|
546
|
+
apex_mass_list = peak.mass_spectrum.mass_list
|
|
547
|
+
apex_mass_spec = peak.mass_spectrum.mass_spec
|
|
548
|
+
|
|
549
|
+
# Determine the intensity of the base peak in the mass spectrum
|
|
550
|
+
base_peak_intensity = max(apex_mass_spec)
|
|
551
|
+
|
|
552
|
+
# Determine the index of the base peak in the mass spectrum
|
|
553
|
+
base_peak_index = apex_mass_spec.index(base_peak_intensity)
|
|
554
|
+
|
|
555
|
+
# Finally, determine the mass of the base peak
|
|
556
|
+
return apex_mass_list[base_peak_index]
|
|
@@ -4,7 +4,7 @@ build-backend = "whey"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "libgunshotmatch"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.11.0"
|
|
8
8
|
description = "Base library for GunShotMatch."
|
|
9
9
|
readme = "README.rst"
|
|
10
10
|
keywords = []
|
|
@@ -42,14 +42,13 @@ classifiers = [
|
|
|
42
42
|
]
|
|
43
43
|
requires-python = ">=3.8"
|
|
44
44
|
|
|
45
|
+
[project.license]
|
|
46
|
+
file = "LICENSE"
|
|
47
|
+
|
|
45
48
|
[[project.authors]]
|
|
46
49
|
name = "Dominic Davis-Foster"
|
|
47
50
|
email = "dominic@davis-foster.co.uk"
|
|
48
51
|
|
|
49
|
-
|
|
50
|
-
[project.license]
|
|
51
|
-
file = "LICENSE"
|
|
52
|
-
|
|
53
52
|
[project.urls]
|
|
54
53
|
Homepage = "https://github.com/GunShotMatch/libgunshotmatch"
|
|
55
54
|
"Issue Tracker" = "https://github.com/GunShotMatch/libgunshotmatch/issues"
|
|
@@ -92,6 +91,16 @@ show_error_codes = true
|
|
|
92
91
|
[tool.snippet-fmt]
|
|
93
92
|
directives = [ "code-block",]
|
|
94
93
|
|
|
94
|
+
[tool.snippet-fmt.languages.python]
|
|
95
|
+
reformat = true
|
|
96
|
+
|
|
97
|
+
[tool.snippet-fmt.languages.TOML]
|
|
98
|
+
reformat = true
|
|
99
|
+
|
|
100
|
+
[tool.snippet-fmt.languages.ini]
|
|
101
|
+
|
|
102
|
+
[tool.snippet-fmt.languages.json]
|
|
103
|
+
|
|
95
104
|
[tool.sphinx-pyproject]
|
|
96
105
|
github_username = "GunShotMatch"
|
|
97
106
|
github_repository = "libgunshotmatch"
|
|
@@ -113,7 +122,6 @@ extensions = [
|
|
|
113
122
|
"sphinx.ext.mathjax",
|
|
114
123
|
"sphinxcontrib.extras_require",
|
|
115
124
|
"sphinx.ext.todo",
|
|
116
|
-
"sphinxemoji.sphinxemoji",
|
|
117
125
|
"notfound.extension",
|
|
118
126
|
"sphinx_copybutton",
|
|
119
127
|
"sphinxcontrib.default_values",
|
|
@@ -126,7 +134,6 @@ extensions = [
|
|
|
126
134
|
"remove_factory_defaults",
|
|
127
135
|
"sphinx_toolbox.more_autosummary.column_widths",
|
|
128
136
|
]
|
|
129
|
-
sphinxemoji_style = "twemoji"
|
|
130
137
|
gitstamp_fmt = "%d %b %Y"
|
|
131
138
|
templates_path = [ "_templates",]
|
|
132
139
|
html_static_path = [ "_static",]
|
|
@@ -192,13 +199,3 @@ include = false
|
|
|
192
199
|
[tool.dependency-dash."tests/requirements.txt"]
|
|
193
200
|
order = 20
|
|
194
201
|
include = false
|
|
195
|
-
|
|
196
|
-
[tool.snippet-fmt.languages.python]
|
|
197
|
-
reformat = true
|
|
198
|
-
|
|
199
|
-
[tool.snippet-fmt.languages.TOML]
|
|
200
|
-
reformat = true
|
|
201
|
-
|
|
202
|
-
[tool.snippet-fmt.languages.ini]
|
|
203
|
-
|
|
204
|
-
[tool.snippet-fmt.languages.json]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|