OpenMS
Loading...
Searching...
No Matches
OpenSwathLibraryIDNormalizer.h
Go to the documentation of this file.
1// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2// SPDX-License-Identifier: BSD-3-Clause
3//
4// --------------------------------------------------------------------------
5// $Maintainer: Justin Sing $
6// $Authors: Justin Sing $
7// --------------------------------------------------------------------------
8
9#pragma once
10
13
14#include <optional>
15#include <string>
16#include <unordered_map>
17
18namespace OpenMS
19{
38 class OPENMS_DLLAPI OpenSwathLibraryIDNormalizer
39 {
40 public:
50 {
52 std::unordered_map<std::string, std::string> precursor_source_to_canonical;
53
55 std::unordered_map<std::string, std::string> precursor_canonical_to_source;
56
60 std::unordered_map<std::string, std::string> transition_canonical_to_source;
61 };
62
88
104 const SourceIDMapping& source_ids,
105 const std::string& decoy_prefix);
106
118 static std::optional<std::string> canonicalTargetForDecoyPrecursor(
119 const std::string& decoy_ref,
120 const SourceIDMapping& source_ids,
121 const std::string& decoy_prefix);
122
130
143
155 };
156} // namespace OpenMS
Establish and validate canonical precursor/transition identifiers for OpenSWATH libraries.
Definition OpenSwathLibraryIDNormalizer.h:39
std::unordered_map< std::string, std::string > precursor_canonical_to_source
Canonical operational precursor ID -> original/source precursor ID.
Definition OpenSwathLibraryIDNormalizer.h:55
static std::optional< std::string > canonicalTargetForDecoyPrecursor(const std::string &decoy_ref, const SourceIDMapping &source_ids, const std::string &decoy_prefix)
Resolve the canonical target precursor paired with a source-prefix decoy.
static void validateCanonicalIDs(const OpenSwath::LightTargetedExperiment &exp)
Validate that a LightTargetedExperiment already uses canonical numeric IDs.
static bool hasCanonicalIDs(const OpenSwath::LightTargetedExperiment &exp)
Report whether a LightTargetedExperiment satisfies the canonical-ID invariant.
static bool hasCanonicalIDFormat(const OpenSwath::LightTargetedExperiment &exp) noexcept
Report whether all operational ID fields use canonical decimal syntax.
std::unordered_map< std::string, std::string > precursor_source_to_canonical
Original/source precursor ID -> canonical operational precursor ID.
Definition OpenSwathLibraryIDNormalizer.h:52
std::unordered_map< std::string, std::string > transition_canonical_to_source
Definition OpenSwathLibraryIDNormalizer.h:60
static SourceIDMapping normalizeSourceIDs(OpenSwath::LightTargetedExperiment &exp)
Replace arbitrary source precursor/transition identifiers with deterministic canonical IDs.
static void materializeDecoyPrefix(OpenSwath::LightTargetedExperiment &exp, const SourceIDMapping &source_ids, const std::string &decoy_prefix)
Materialize decoy flags from a configurable source precursor prefix.
Source-to-canonical precursor provenance captured during library loading.
Definition OpenSwathLibraryIDNormalizer.h:50
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
Definition TransitionExperiment.h:369