libgunshotmatch 0.6.0__tar.gz → 0.7.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 libgunshotmatch might be problematic. Click here for more details.
- {libgunshotmatch-0.6.0 → libgunshotmatch-0.7.1}/PKG-INFO +2 -2
- {libgunshotmatch-0.6.0 → libgunshotmatch-0.7.1}/README.rst +1 -1
- {libgunshotmatch-0.6.0 → libgunshotmatch-0.7.1}/libgunshotmatch/__init__.py +1 -1
- {libgunshotmatch-0.6.0 → libgunshotmatch-0.7.1}/libgunshotmatch/consolidate/__init__.py +1 -1
- {libgunshotmatch-0.6.0 → libgunshotmatch-0.7.1}/libgunshotmatch/peak.py +9 -4
- {libgunshotmatch-0.6.0 → libgunshotmatch-0.7.1}/libgunshotmatch/utils.py +32 -2
- {libgunshotmatch-0.6.0 → libgunshotmatch-0.7.1}/pyproject.toml +1 -1
- {libgunshotmatch-0.6.0 → libgunshotmatch-0.7.1}/LICENSE +0 -0
- {libgunshotmatch-0.6.0 → libgunshotmatch-0.7.1}/libgunshotmatch/consolidate/_fields.py +0 -0
- {libgunshotmatch-0.6.0 → libgunshotmatch-0.7.1}/libgunshotmatch/consolidate/_spectra.py +0 -0
- {libgunshotmatch-0.6.0 → libgunshotmatch-0.7.1}/libgunshotmatch/datafile.py +0 -0
- {libgunshotmatch-0.6.0 → libgunshotmatch-0.7.1}/libgunshotmatch/gzip_util.py +0 -0
- {libgunshotmatch-0.6.0 → libgunshotmatch-0.7.1}/libgunshotmatch/method/__init__.py +0 -0
- {libgunshotmatch-0.6.0 → libgunshotmatch-0.7.1}/libgunshotmatch/method/_fields.py +0 -0
- {libgunshotmatch-0.6.0 → libgunshotmatch-0.7.1}/libgunshotmatch/project.py +0 -0
- {libgunshotmatch-0.6.0 → libgunshotmatch-0.7.1}/libgunshotmatch/py.typed +0 -0
- {libgunshotmatch-0.6.0 → libgunshotmatch-0.7.1}/libgunshotmatch/search.py +0 -0
- {libgunshotmatch-0.6.0 → libgunshotmatch-0.7.1}/requirements.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: libgunshotmatch
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.7.1
|
|
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.7.1
|
|
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.7.1
|
|
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.7.1"
|
|
33
33
|
__email__: str = "dominic@davis-foster.co.uk"
|
|
@@ -476,7 +476,7 @@ class ConsolidatedPeak:
|
|
|
476
476
|
return cls(
|
|
477
477
|
rt_list=d["rt_list"],
|
|
478
478
|
area_list=d["area_list"],
|
|
479
|
-
ms_list=d["ms_list"],
|
|
479
|
+
ms_list=[MassSpectrum.from_dict(msd) for msd in d["ms_list"]],
|
|
480
480
|
meta=d["meta"],
|
|
481
481
|
ms_comparison=d["ms_comparison"],
|
|
482
482
|
hits=hits,
|
|
@@ -422,15 +422,20 @@ def write_alignment(
|
|
|
422
422
|
)
|
|
423
423
|
|
|
424
424
|
rt_alignment = alignment.get_peak_alignment(require_all_expr=require_all_datafiles)
|
|
425
|
-
|
|
425
|
+
rt_alignment_filename = output_dir_p / f"{project_name}_alignment_rt.json"
|
|
426
|
+
rt_alignment_filename.write_clean(rt_alignment)
|
|
426
427
|
|
|
427
428
|
area_alignment = alignment.get_area_alignment(require_all_expr=require_all_datafiles)
|
|
428
|
-
|
|
429
|
+
area_alignment_filename = output_dir_p / f"{project_name}_alignment_area.json"
|
|
430
|
+
area_alignment_filename.write_clean(area_alignment)
|
|
429
431
|
|
|
430
432
|
ms_alignment = alignment.get_ms_alignment(require_all_expr=require_all_datafiles)
|
|
431
433
|
# ms_alignment.to_json(output_dir_p / 'alignment_ms.json')
|
|
432
|
-
|
|
433
|
-
|
|
434
|
+
alignment_ms_filename = (output_dir_p / f"{project_name}_alignment_ms.json")
|
|
435
|
+
alignment_ms_filename.dump_json(
|
|
436
|
+
ms_alignment.to_dict(),
|
|
437
|
+
json_library=sdjson, # type: ignore
|
|
438
|
+
)
|
|
434
439
|
|
|
435
440
|
|
|
436
441
|
def filter_aligned_peaks(
|
|
@@ -28,7 +28,7 @@ Utility functions.
|
|
|
28
28
|
|
|
29
29
|
# stdlib
|
|
30
30
|
from decimal import Decimal
|
|
31
|
-
from typing import Any, Iterable, List, Optional, Sequence, Type, TypeVar, Union
|
|
31
|
+
from typing import TYPE_CHECKING, Any, Iterable, List, Optional, Sequence, Tuple, Type, TypeVar, Union
|
|
32
32
|
|
|
33
33
|
# 3rd party
|
|
34
34
|
import numpy
|
|
@@ -37,7 +37,11 @@ from mathematical.utils import rounders
|
|
|
37
37
|
from pyms.Spectrum import MassSpectrum # type: ignore[import]
|
|
38
38
|
from scipy.stats import truncnorm # type: ignore[import]
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
if TYPE_CHECKING:
|
|
41
|
+
# this package
|
|
42
|
+
from libgunshotmatch.project import Project
|
|
43
|
+
|
|
44
|
+
__all__ = ("round_rt", "get_truncated_normal", "ms_comparison", "get_rt_range")
|
|
41
45
|
|
|
42
46
|
|
|
43
47
|
def round_rt(rt: Union[str, float, Decimal]) -> Decimal:
|
|
@@ -136,3 +140,29 @@ def _to_list(l: Iterable[str]) -> List[str]:
|
|
|
136
140
|
"""
|
|
137
141
|
|
|
138
142
|
return list(l)
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
def get_rt_range(project: "Project") -> Tuple[float, float]:
|
|
146
|
+
"""
|
|
147
|
+
Returns the minimum and maximum retention times (in minutes) across the repeats.
|
|
148
|
+
|
|
149
|
+
:param project:
|
|
150
|
+
|
|
151
|
+
:rtype:
|
|
152
|
+
|
|
153
|
+
,, versionadded:: 0.7.0
|
|
154
|
+
"""
|
|
155
|
+
|
|
156
|
+
# Get RT extremes from intensity matrix
|
|
157
|
+
min_rts, max_rts = [], []
|
|
158
|
+
for repeat in project.datafile_data.values():
|
|
159
|
+
im = repeat.datafile.intensity_matrix
|
|
160
|
+
assert im is not None
|
|
161
|
+
times = im.time_list
|
|
162
|
+
min_rts.append(times[0])
|
|
163
|
+
max_rts.append(times[-1])
|
|
164
|
+
|
|
165
|
+
min_rt = min(min_rts) / 60
|
|
166
|
+
max_rt = max(max_rts) / 60
|
|
167
|
+
|
|
168
|
+
return min_rt, max_rt
|
|
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
|