Skip to content

Commit

Permalink
Normalised PLGS scores
Browse files Browse the repository at this point in the history
  • Loading branch information
douweschulte committed Dec 4, 2024
1 parent e1ec7f5 commit 152b13f
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions rustyms/src/identification/plgs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,16 @@ format_family!(
}
);

impl From<PLGSData> for IdentifiedPeptide {
fn from(value: PLGSData) -> Self {
Self {
score: Some(2.0 / (1.0 + 1.3_f64.powf(-value.peptide_score)) - 1.0),
local_confidence: None,
metadata: MetaData::PLGS(value),
}
}
}

/// PLGS curation categories
#[derive(Debug, Clone, Copy, PartialEq, Eq, Ord, Default, PartialOrd, Serialize, Deserialize)]
pub enum PLGSCuration {
Expand Down Expand Up @@ -178,16 +188,6 @@ impl std::fmt::Display for PLGSCuration {
}
}

impl From<PLGSData> for IdentifiedPeptide {
fn from(value: PLGSData) -> Self {
Self {
score: Some(value.peptide_score.clamp(-1.0, 1.0)),
local_confidence: None,
metadata: MetaData::PLGS(value),
}
}
}

/// An older version of a PLGS export
pub const VERSION_3_0: PLGSFormat = PLGSFormat {
version: PLGSVersion::V3_0,
Expand Down

0 comments on commit 152b13f

Please sign in to comment.