diff --git a/rustyms/src/identification/plgs.rs b/rustyms/src/identification/plgs.rs index 4fc42985..3552f59f 100644 --- a/rustyms/src/identification/plgs.rs +++ b/rustyms/src/identification/plgs.rs @@ -140,6 +140,16 @@ format_family!( } ); +impl From 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 { @@ -178,16 +188,6 @@ impl std::fmt::Display for PLGSCuration { } } -impl From 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,