peppy-sage 0.1.3__cp311-abi3-macosx_10_12_x86_64.whl → 0.1.17__cp311-abi3-macosx_10_12_x86_64.whl
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.
peppy_sage/_peppy_sage.abi3.so
CHANGED
|
Binary file
|
peppy_sage/indexing.py
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
from typing import List, Optional, Tuple, Union
|
|
4
4
|
from .core import Peptide
|
|
5
5
|
from . import _rust
|
|
6
|
+
import polars as pl
|
|
6
7
|
|
|
7
8
|
ION_KIND_MAP = {
|
|
8
9
|
#"a": _rust.PyKind.A, #TODO other ion types
|
|
@@ -93,6 +94,58 @@ class IndexedDatabase:
|
|
|
93
94
|
|
|
94
95
|
return cls(inner)
|
|
95
96
|
|
|
97
|
+
|
|
98
|
+
@classmethod
|
|
99
|
+
def from_library(
|
|
100
|
+
cls,
|
|
101
|
+
library: pl.DataFrame,
|
|
102
|
+
ion_kinds: List[str],
|
|
103
|
+
bucket_size: int = 8192,
|
|
104
|
+
min_ion_index: int = 1,
|
|
105
|
+
generate_decoys: bool = False,
|
|
106
|
+
decoy_tag: str = "rev_",
|
|
107
|
+
peptide_min_mass: float = 500.0,
|
|
108
|
+
peptide_max_mass: float = 5000.0,
|
|
109
|
+
) -> "IndexedDatabase":
|
|
110
|
+
"""
|
|
111
|
+
Build an indexed database directly from a DIA-NN-style library.
|
|
112
|
+
|
|
113
|
+
Args:
|
|
114
|
+
library: Polars DataFrame with columns like:
|
|
115
|
+
- "StrippedPeptide", "ModifiedPeptide"
|
|
116
|
+
- "FragmentMz", "FragmentType", "FragmentCharge", "FragmentSeriesNumber"
|
|
117
|
+
- etc.
|
|
118
|
+
ion_kinds: List of ion types to include, e.g. ["b", "y"].
|
|
119
|
+
Other args mirror `from_peptides`.
|
|
120
|
+
"""
|
|
121
|
+
if not isinstance(library, pl.DataFrame):
|
|
122
|
+
raise TypeError(
|
|
123
|
+
f"`library` must be a polars.DataFrame, got {type(library)!r}"
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
try:
|
|
127
|
+
ion_enum_list = [ION_KIND_MAP[k.lower()]() for k in ion_kinds]
|
|
128
|
+
except KeyError as e:
|
|
129
|
+
raise ValueError(
|
|
130
|
+
f"Invalid ion kind: {e.args[0]}. Must be one of {list(ION_KIND_MAP)}"
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
# This call is where we keep things zero-copy: `library` is passed
|
|
134
|
+
# directly to Rust as a Polars / Arrow DataFrame (via pyo3-polars).
|
|
135
|
+
inner = _rust.PyIndexedDatabase.from_library_and_config(
|
|
136
|
+
library_df=library,
|
|
137
|
+
bucket_size=bucket_size,
|
|
138
|
+
ion_kinds=ion_enum_list,
|
|
139
|
+
min_ion_index=min_ion_index,
|
|
140
|
+
generate_decoys=generate_decoys,
|
|
141
|
+
decoy_tag=decoy_tag,
|
|
142
|
+
peptide_min_mass=peptide_min_mass,
|
|
143
|
+
peptide_max_mass=peptide_max_mass,
|
|
144
|
+
)
|
|
145
|
+
|
|
146
|
+
return cls(inner)
|
|
147
|
+
|
|
148
|
+
|
|
96
149
|
# -------------------------------------------------------------------------
|
|
97
150
|
# Properties
|
|
98
151
|
# -------------------------------------------------------------------------
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
peppy_sage/__init__.py,sha256=u5XtfUF6wqNAGMMfohjNAT7yQSFU5sgbQYVr_W1MTYI,1367
|
|
2
|
+
peppy_sage/_peppy_sage.abi3.so,sha256=lV_MnzVQdMcfNQmMjZhiy6WUKyQ2yIsNDSLRhGg8oS0,19578236
|
|
3
|
+
peppy_sage/core.py,sha256=ko0Mop95BY5hjXt6qll3G7AUhPMYAnGOSZ_p6tzqjD8,7549
|
|
4
|
+
peppy_sage/indexing.py,sha256=kCSMXhHO7cOKz_p4C2UOOGRV_DNY3pBzzR82wsmNwp0,6383
|
|
5
|
+
peppy_sage/scoring.py,sha256=NmSiNSV12L4quuAAXS-TLIuiLUXRmA7qE5Z8ArNZZbU,1904
|
|
6
|
+
peppy_sage-0.1.17.dist-info/METADATA,sha256=FGPG2n2lmzi_e62GEJC6sLpK13hYm9GaT-os5dSAqq4,304
|
|
7
|
+
peppy_sage-0.1.17.dist-info/WHEEL,sha256=kXxrpAlDxFfJk3NKudODw2af-hZi5kEF-I_4llGgByk,106
|
|
8
|
+
peppy_sage-0.1.17.dist-info/RECORD,,
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
peppy_sage-0.1.3.dist-info/METADATA,sha256=p4xp97UvxhRJwPh9SXbeVbcA5P3Ci4J5QNvXDvs82wc,303
|
|
2
|
-
peppy_sage-0.1.3.dist-info/WHEEL,sha256=Tem-dSV3bEd_-pxcoVPo1fIcIheHwwajFNE7UM4HeCk,106
|
|
3
|
-
peppy_sage/__init__.py,sha256=u5XtfUF6wqNAGMMfohjNAT7yQSFU5sgbQYVr_W1MTYI,1367
|
|
4
|
-
peppy_sage/_peppy_sage.abi3.so,sha256=A1kiHrmujFP0ozFGDmbJSCjsWXMAxBt-X8k9eBSk0go,1155724
|
|
5
|
-
peppy_sage/core.py,sha256=ko0Mop95BY5hjXt6qll3G7AUhPMYAnGOSZ_p6tzqjD8,7549
|
|
6
|
-
peppy_sage/indexing.py,sha256=4jV_kcx9bp8R-Ql18i9mPv4XIX1vFGrr84S9r2y8wXQ,4517
|
|
7
|
-
peppy_sage/scoring.py,sha256=NmSiNSV12L4quuAAXS-TLIuiLUXRmA7qE5Z8ArNZZbU,1904
|
|
8
|
-
peppy_sage-0.1.3.dist-info/RECORD,,
|