@@ -738,6 +738,9 @@ def process(
738
738
psm_proto_df .fragment_mass_error [
739
739
self .output_idx , : len (mass_error )
740
740
] = mass_error
741
+ psm_proto_df .fragment_position [
742
+ self .output_idx , : len (fragments .position )
743
+ ] = fragments .position
741
744
psm_proto_df .fragment_number [
742
745
self .output_idx , : len (fragments .number )
743
746
] = fragments .number
@@ -1270,6 +1273,7 @@ class OuptutPsmDF:
1270
1273
fragment_mass_error : nb .float32 [:, ::1 ]
1271
1274
fragment_correlation : nb .float32 [:, ::1 ]
1272
1275
1276
+ fragment_position : nb .uint8 [:, ::1 ]
1273
1277
fragment_number : nb .uint8 [:, ::1 ]
1274
1278
fragment_type : nb .uint8 [:, ::1 ]
1275
1279
fragment_charge : nb .uint8 [:, ::1 ]
@@ -1296,6 +1300,7 @@ def __init__(self, n_psm, top_k_fragments):
1296
1300
self .fragment_mass_error = np .zeros ((n_psm , top_k_fragments ), dtype = np .float32 )
1297
1301
self .fragment_correlation = np .zeros ((n_psm , top_k_fragments ), dtype = np .float32 )
1298
1302
1303
+ self .fragment_position = np .zeros ((n_psm , top_k_fragments ), dtype = np .uint8 )
1299
1304
self .fragment_number = np .zeros ((n_psm , top_k_fragments ), dtype = np .uint8 )
1300
1305
self .fragment_type = np .zeros ((n_psm , top_k_fragments ), dtype = np .uint8 )
1301
1306
self .fragment_charge = np .zeros ((n_psm , top_k_fragments ), dtype = np .uint8 )
@@ -1313,6 +1318,8 @@ def to_fragment_df(self):
1313
1318
self .fragment_intensity .flatten ()[mask ],
1314
1319
self .fragment_mass_error .flatten ()[mask ],
1315
1320
self .fragment_correlation .flatten ()[mask ],
1321
+
1322
+ self .fragment_position .flatten ()[mask ],
1316
1323
self .fragment_number .flatten ()[mask ],
1317
1324
self .fragment_type .flatten ()[mask ],
1318
1325
self .fragment_charge .flatten ()[mask ],
@@ -1727,13 +1734,20 @@ def collect_candidates(
1727
1734
] + utils .get_isotope_column_names (self .precursors_flat_df .columns )
1728
1735
1729
1736
precursor_df_columns += (
1730
- [self .rt_column ] if self .rt_column not in precursor_df_columns else []
1737
+ [self .rt_column ]
1738
+ if self .rt_column not in precursor_df_columns
1739
+ else []
1731
1740
)
1732
1741
precursor_df_columns += (
1733
1742
[self .mobility_column ]
1734
1743
if self .mobility_column not in precursor_df_columns
1735
1744
else []
1736
1745
)
1746
+ precursor_df_columns += (
1747
+ [self .precursor_mz_column ]
1748
+ if self .precursor_mz_column not in precursor_df_columns
1749
+ else []
1750
+ )
1737
1751
1738
1752
df = utils .merge_missing_columns (
1739
1753
df ,
@@ -1789,6 +1803,7 @@ def collect_fragments(
1789
1803
"intensity" ,
1790
1804
"mass_error" ,
1791
1805
"correlation" ,
1806
+ "position" ,
1792
1807
"number" ,
1793
1808
"type" ,
1794
1809
"charge" ,
0 commit comments