libgunshotmatch 0.11.0__tar.gz → 0.11.2__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.11.0 → libgunshotmatch-0.11.2}/PKG-INFO +2 -2
- {libgunshotmatch-0.11.0 → libgunshotmatch-0.11.2}/README.rst +1 -1
- {libgunshotmatch-0.11.0 → libgunshotmatch-0.11.2}/libgunshotmatch/__init__.py +1 -1
- {libgunshotmatch-0.11.0 → libgunshotmatch-0.11.2}/libgunshotmatch/comparison/projects.py +6 -3
- {libgunshotmatch-0.11.0 → libgunshotmatch-0.11.2}/libgunshotmatch/consolidate/__init__.py +8 -1
- {libgunshotmatch-0.11.0 → libgunshotmatch-0.11.2}/libgunshotmatch/peak.py +4 -0
- {libgunshotmatch-0.11.0 → libgunshotmatch-0.11.2}/libgunshotmatch/project.py +6 -5
- {libgunshotmatch-0.11.0 → libgunshotmatch-0.11.2}/libgunshotmatch/utils.py +6 -2
- {libgunshotmatch-0.11.0 → libgunshotmatch-0.11.2}/pyproject.toml +1 -1
- {libgunshotmatch-0.11.0 → libgunshotmatch-0.11.2}/LICENSE +0 -0
- {libgunshotmatch-0.11.0 → libgunshotmatch-0.11.2}/libgunshotmatch/comparison/__init__.py +0 -0
- {libgunshotmatch-0.11.0 → libgunshotmatch-0.11.2}/libgunshotmatch/comparison/_utils.py +0 -0
- {libgunshotmatch-0.11.0 → libgunshotmatch-0.11.2}/libgunshotmatch/comparison/unknowns.py +0 -0
- {libgunshotmatch-0.11.0 → libgunshotmatch-0.11.2}/libgunshotmatch/consolidate/_fields.py +0 -0
- {libgunshotmatch-0.11.0 → libgunshotmatch-0.11.2}/libgunshotmatch/consolidate/_spectra.py +0 -0
- {libgunshotmatch-0.11.0 → libgunshotmatch-0.11.2}/libgunshotmatch/datafile.py +0 -0
- {libgunshotmatch-0.11.0 → libgunshotmatch-0.11.2}/libgunshotmatch/gzip_util.py +0 -0
- {libgunshotmatch-0.11.0 → libgunshotmatch-0.11.2}/libgunshotmatch/method/__init__.py +0 -0
- {libgunshotmatch-0.11.0 → libgunshotmatch-0.11.2}/libgunshotmatch/method/_fields.py +0 -0
- {libgunshotmatch-0.11.0 → libgunshotmatch-0.11.2}/libgunshotmatch/py.typed +0 -0
- {libgunshotmatch-0.11.0 → libgunshotmatch-0.11.2}/libgunshotmatch/search.py +0 -0
- {libgunshotmatch-0.11.0 → libgunshotmatch-0.11.2}/requirements.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: libgunshotmatch
|
|
3
|
-
Version: 0.11.
|
|
3
|
+
Version: 0.11.2
|
|
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.11.
|
|
138
|
+
.. |commits-since| image:: https://img.shields.io/github/commits-since/GunShotMatch/libgunshotmatch/v0.11.2
|
|
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.11.
|
|
94
|
+
.. |commits-since| image:: https://img.shields.io/github/commits-since/GunShotMatch/libgunshotmatch/v0.11.2
|
|
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.11.
|
|
32
|
+
__version__: str = "0.11.2"
|
|
33
33
|
__email__: str = "dominic@davis-foster.co.uk"
|
|
@@ -52,15 +52,18 @@ def filter_alignment_to_consolidate(project: Project) -> Alignment:
|
|
|
52
52
|
|
|
53
53
|
# Sort expr_code and peakpos into order from datafile_data
|
|
54
54
|
desired_order = list(project.datafile_data)[::-1]
|
|
55
|
-
sort_map = [
|
|
55
|
+
sort_map = [project.alignment.expr_code.index(code) for code in desired_order]
|
|
56
56
|
expr_code = [project.alignment.expr_code[idx] for idx in sort_map]
|
|
57
57
|
peakpos = [project.alignment.peakpos[idx] for idx in sort_map]
|
|
58
|
+
assert desired_order == expr_code
|
|
58
59
|
|
|
59
|
-
consolidated_peak_retention_times = [
|
|
60
|
+
consolidated_peak_retention_times = []
|
|
61
|
+
for cp in project.consolidated_peaks:
|
|
62
|
+
consolidated_peak_retention_times.append([None if numpy.isnan(rt) else rt for rt in cp.rt_list])
|
|
60
63
|
|
|
61
64
|
aligned_peaks_surviving_consolidate = []
|
|
62
65
|
for aligned_peaks in zip(*peakpos):
|
|
63
|
-
aprt = [p.rt for p in reversed(aligned_peaks)]
|
|
66
|
+
aprt = [None if p is None else p.rt for p in reversed(aligned_peaks)]
|
|
64
67
|
if aprt in consolidated_peak_retention_times:
|
|
65
68
|
aligned_peaks_surviving_consolidate.append(aligned_peaks)
|
|
66
69
|
|
|
@@ -477,10 +477,17 @@ class ConsolidatedPeak:
|
|
|
477
477
|
for hit in d["hits"]:
|
|
478
478
|
hits.append(ConsolidatedSearchResult.from_dict(hit))
|
|
479
479
|
|
|
480
|
+
ms_list: MutableSequence[Optional[MassSpectrum]] = []
|
|
481
|
+
for msd in d["ms_list"]:
|
|
482
|
+
if msd is None:
|
|
483
|
+
ms_list.append(None)
|
|
484
|
+
else:
|
|
485
|
+
ms_list.append(MassSpectrum.from_dict(msd))
|
|
486
|
+
|
|
480
487
|
return cls(
|
|
481
488
|
rt_list=d["rt_list"],
|
|
482
489
|
area_list=d["area_list"],
|
|
483
|
-
ms_list=
|
|
490
|
+
ms_list=ms_list,
|
|
484
491
|
meta=d["meta"],
|
|
485
492
|
ms_comparison=d["ms_comparison"],
|
|
486
493
|
hits=hits,
|
|
@@ -28,7 +28,7 @@ Represents a collection of repeat analyses.
|
|
|
28
28
|
|
|
29
29
|
# stdlib
|
|
30
30
|
import os
|
|
31
|
-
from typing import Any, Dict, List, Mapping, Optional, Type
|
|
31
|
+
from typing import Any, Dict, List, Mapping, MutableSequence, Optional, Type
|
|
32
32
|
|
|
33
33
|
# 3rd party
|
|
34
34
|
import attr
|
|
@@ -131,14 +131,15 @@ class Project:
|
|
|
131
131
|
"""
|
|
132
132
|
|
|
133
133
|
alignment_as_dict = d["alignment"]
|
|
134
|
-
alignment_peaks: List[
|
|
134
|
+
alignment_peaks: List[MutableSequence[Optional[Peak]]] = []
|
|
135
135
|
for row in alignment_as_dict["peaks"]:
|
|
136
136
|
alignment_peaks.append([])
|
|
137
137
|
for peak in row:
|
|
138
138
|
# print(peak)
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
139
|
+
if peak is None:
|
|
140
|
+
alignment_peaks[-1].append(None)
|
|
141
|
+
else:
|
|
142
|
+
alignment_peaks[-1].append(peak_from_dict(peak))
|
|
142
143
|
|
|
143
144
|
alignment = create_alignment(
|
|
144
145
|
alignment_peaks,
|
|
@@ -171,7 +171,11 @@ def get_rt_range(project: "Project") -> Tuple[float, float]:
|
|
|
171
171
|
return min_rt, max_rt
|
|
172
172
|
|
|
173
173
|
|
|
174
|
-
def create_alignment(
|
|
174
|
+
def create_alignment(
|
|
175
|
+
peakpos: Sequence[Sequence[Optional[Peak]]],
|
|
176
|
+
expr_code: List[str],
|
|
177
|
+
similarity: float = 0,
|
|
178
|
+
) -> Alignment:
|
|
175
179
|
"""
|
|
176
180
|
Create a new :class:`pyms.DPA.Alignment.Alignment` object.
|
|
177
181
|
|
|
@@ -185,7 +189,7 @@ def create_alignment(peakpos: Sequence[Sequence[Peak]], expr_code: List[str], si
|
|
|
185
189
|
"""
|
|
186
190
|
|
|
187
191
|
alignment = Alignment(None)
|
|
188
|
-
alignment.peakpos = [list(p) for p in peakpos]
|
|
192
|
+
alignment.peakpos = [list(p) for p in peakpos] # type: ignore[arg-type]
|
|
189
193
|
alignment.peakalgt = numpy.transpose(alignment.peakpos).tolist() # type: ignore[arg-type]
|
|
190
194
|
alignment.expr_code = expr_code
|
|
191
195
|
alignment.similarity = similarity
|
|
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
|