Skip to content

Commit

Permalink
fixed pre-commit hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
mostafakalhor committed Oct 26, 2024
1 parent 4b8b4ff commit ee2aa82
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
16 changes: 9 additions & 7 deletions spectrum_fundamentals/metrics/percolator.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def __init__(
self.fdr_cutoff = fdr_cutoff
self.neutral_loss_flag = neutral_loss_flag
self.drop_miss_cleavage_flag = drop_miss_cleavage_flag

self.base_columns = [
"raw_file",
"scan_number",
Expand Down Expand Up @@ -329,8 +329,10 @@ def add_percolator_metadata_columns(self):
spec_id_cols = ["RAW_FILE", "SCAN_NUMBER", "MODIFIED_SEQUENCE_A", "MODIFIED_SEQUENCE_B", "PRECURSOR_CHARGE"]
modified_sequence_a = self.metadata["MODIFIED_SEQUENCE_A"].astype(str)
modified_sequence_b = self.metadata["MODIFIED_SEQUENCE_B"].astype(str)
self.metrics_val["Peptide"] = (modified_sequence_a + "_" + modified_sequence_b).apply(lambda x: "_." + x + "._")
self.metrics_val["Proteins"] = (modified_sequence_a + "_" + modified_sequence_b)
self.metrics_val["Peptide"] = (modified_sequence_a + "_" + modified_sequence_b).apply(
lambda x: "_." + x + "._"
)
self.metrics_val["Proteins"] = modified_sequence_a + "_" + modified_sequence_b
self.metrics_val["Label"] = self.target_decoy_labels
else:
spec_id_cols = ["RAW_FILE", "SCAN_NUMBER", "MODIFIED_SEQUENCE", "PRECURSOR_CHARGE"]
Expand Down Expand Up @@ -523,10 +525,10 @@ def calc(self): # noqa: C901
# self.metrics_val['spectral_angle_delta_score'] = Percolator.get_delta_score(self.metrics_val[['ScanNr',
# 'spectral_angle']], 'spectral_angle')
pass
#else:
# self.metrics_val["andromeda_delta_score"] = Percolator.get_delta_score(
# self.metrics_val[["ScanNr", "andromeda"]], "andromeda"
# )
# else:
# self.metrics_val["andromeda_delta_score"] = Percolator.get_delta_score(
# self.metrics_val[["ScanNr", "andromeda"]], "andromeda"
# )

self._reorder_columns_for_percolator()

Expand Down
5 changes: 2 additions & 3 deletions spectrum_fundamentals/metrics/similarity.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,6 @@ def _calc_additional_metrics(
true_intensities, pred_intensities, "max"
)
self.metrics_val[f"mse{key_suffix}"] = SimilarityMetrics.abs_diff(true_intensities, pred_intensities, "mse")


col_names_spectral_angle = [
f"spectral_angle_{amount}_charge{key_suffix}" for amount in ["single", "double", "triple"]
Expand Down Expand Up @@ -539,5 +538,5 @@ def _calc_additional_metrics(
)

self.metrics_val[f"modified_cosine{key_suffix}"] = SimilarityMetrics.modified_cosine(
true_intensities, pred_intensities, self.mz, self.mz
)
true_intensities, pred_intensities, self.mz, self.mz
)

0 comments on commit ee2aa82

Please sign in to comment.