Skip to content

Commit

Permalink
align perc features with cit pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
WassimG committed Oct 10, 2024
1 parent 1c8f482 commit 53f5464
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion spectrum_fundamentals/metrics/percolator.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ def _reorder_columns_for_percolator(self):
new_columns = first_columns + sorted(mid_columns) + last_columns
self.metrics_val = self.metrics_val[new_columns]

def calc(self):
def calc(self): # noqa: C901
"""Adds percolator metadata and feature columns to metrics_val based on PSM metadata."""
self.add_common_features()
self.target_decoy_labels = self.metadata["REVERSE"].apply(Percolator.get_target_decoy_label).to_numpy()
Expand All @@ -464,6 +464,11 @@ def calc(self):
if self.neutral_loss_flag:
self.metrics_val["ANNOTATED_NL_COUNT"] = self.metadata["ANNOTATED_NL_COUNT"]
self.metrics_val["EXPECTED_NL_COUNT"] = self.metadata["EXPECTED_NL_COUNT"]
columns_to_remove = []
for col in self.metrics_val.columns:
if "vs_predicted" in col:
columns_to_remove.append(col)
self.metrics_val.drop(columns=columns_to_remove, inplace=True)
if self.drop_miss_cleavage_flag:
self.metrics_val.drop(columns=["missedCleavages", "KR"], inplace=True)
if self.xl:
Expand Down

0 comments on commit 53f5464

Please sign in to comment.