Skip to content

Commit

Permalink
added correct protein column and correct sorting for expmass
Browse files Browse the repository at this point in the history
  • Loading branch information
“Karim committed Jan 30, 2024
1 parent 4bea22e commit 1e7fa93
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spectrum_fundamentals/metrics/percolator.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def add_percolator_metadata_columns(self):
self.metrics_val["ExpMass"] = (
self.metadata["CALCULATED_MASS"] + proton_mass * self.metadata["PRECURSOR_CHARGE"]
) / self.metadata["PRECURSOR_CHARGE"]
self.metrics_val["Proteins"] = self.metadata["MODIFIED_SEQUENCE"]
self.metrics_val["Proteins"] = self.metadata["PROTEINS"]

def apply_lda_and_get_indices_below_fdr(
self, initial_scoring_feature: str = "spectral_angle", fdr_cutoff: float = 0.01
Expand Down Expand Up @@ -379,7 +379,7 @@ def fdrs_to_qvals(fdrs: np.ndarray) -> np.ndarray:

def _reorder_columns_for_percolator(self):
all_columns = self.metrics_val.columns
first_columns = ["SpecId", "Label", "ScanNr", "filename", "CID", "ExpMass"]
first_columns = ["SpecId", "Label", "ScanNr", "filename", "ExpMass"]
last_columns = ["Peptide", "Proteins"]
mid_columns = list(set(all_columns) - set(first_columns) - set(last_columns))
new_columns = first_columns + sorted(mid_columns) + last_columns
Expand Down

0 comments on commit 1e7fa93

Please sign in to comment.