OpenMS
Loading...
Searching...
No Matches
TransitionPQPFile.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: George Rosenberger $
6// $Authors: George Rosenberger, Hannes Roest $
7// --------------------------------------------------------------------------
8
9#pragma once
10
13
14#include <optional>
15#include <string>
16
17namespace OpenMS
18{
19 class SqliteConnector;
20
194 class OPENMS_DLLAPI TransitionPQPFile :
195 public TransitionTSVFile
196 {
197
198private:
199
209
221 PQPSqlQueryInfo buildPQPSelectQuery_(SqliteConnector& conn, bool legacy_traml_id, bool stable_order) const;
222
230 void readPQPInput_(const char* filename, std::vector<TSVTransition>& transition_list, bool legacy_traml_id = false);
231
245 void streamPQPToLightTargetedExperiment_(const char* filename, OpenSwath::LightTargetedExperiment& exp, bool legacy_traml_id = false);
246
252 void writePQPOutput_(const char* filename, OpenMS::TargetedExperiment& targeted_exp);
253
254public:
255
257
259
263
270 void convertTargetedExperimentToPQP(const char* filename, OpenMS::TargetedExperiment& targeted_exp);
271
284 const char* filename,
285 const OpenSwath::LightTargetedExperiment& targeted_exp);
286
295 const char* filename,
296 const OpenSwath::LightTargetedExperiment& targeted_exp,
298
317 const std::string& filename,
318 const OpenSwath::LightTargetedExperiment& targeted_exp,
319 const std::optional<OpenSwathLibraryIDNormalizer::SourceIDMapping>& source_ids = std::nullopt);
320
328 void convertPQPToTargetedExperiment(const char* filename, OpenMS::TargetedExperiment& targeted_exp, bool legacy_traml_id = false);
329
339 void convertPQPToTargetedExperiment(const char* filename, OpenSwath::LightTargetedExperiment& targeted_exp, bool legacy_traml_id = false);
340
347 std::unordered_map<std::string, std::string> getPQPIDToTraMLIDMap(const char* filename, std::string tableName);
348
359 std::unordered_map<std::string, std::string> getPQPCurrentIDToTraMLIDMap(
360 const char* filename,
361 const std::string& tableName);
362
363 };
364}
Source-to-canonical precursor provenance captured during library loading.
Definition OpenSwathLibraryIDNormalizer.h:50
File adapter for Sqlite files.
Definition SqliteConnector.h:41
A description of a targeted experiment containing precursor and production ions.
Definition TargetedExperiment.h:40
This class supports reading and writing of PQP files.
Definition TransitionPQPFile.h:196
std::unordered_map< std::string, std::string > getPQPIDToTraMLIDMap(const char *filename, std::string tableName)
Creates an unordered map between the TRAML_ID and the persistent PQP ID.
std::string select_sql
The complete SQL SELECT query.
Definition TransitionPQPFile.h:203
~TransitionPQPFile() override
Destructor.
void convertPQPToTargetedExperiment(const char *filename, OpenMS::TargetedExperiment &targeted_exp, bool legacy_traml_id=false)
Read in a PQP file and construct a targeted experiment (TraML structure)
void writePQPOutput_(const char *filename, OpenMS::TargetedExperiment &targeted_exp)
Write a TargetedExperiment to a file.
bool compound_exists
Whether compound mappings exist.
Definition TransitionPQPFile.h:206
void convertPQPToTargetedExperiment(const char *filename, OpenSwath::LightTargetedExperiment &targeted_exp, bool legacy_traml_id=false)
Read in a PQP file and construct a targeted experiment (Light transition structure)
void appendLightTargetedExperimentToPQP(const std::string &filename, const OpenSwath::LightTargetedExperiment &targeted_exp, const std::optional< OpenSwathLibraryIDNormalizer::SourceIDMapping > &source_ids=std::nullopt)
Append a canonical LightTargetedExperiment batch to a PQP file.
void convertTargetedExperimentToPQP(const char *filename, OpenMS::TargetedExperiment &targeted_exp)
Write out a targeted experiment (TraML structure) into a PQP file.
void streamPQPToLightTargetedExperiment_(const char *filename, OpenSwath::LightTargetedExperiment &exp, bool legacy_traml_id=false)
Stream PQP directly to LightTargetedExperiment (memory-efficient)
std::unordered_map< std::string, std::string > getPQPCurrentIDToTraMLIDMap(const char *filename, const std::string &tableName)
Return persistent PQP IDs mapped to their source TRAML_ID values.
void convertLightTargetedExperimentToPQP(const char *filename, const OpenSwath::LightTargetedExperiment &targeted_exp, const OpenSwathLibraryIDNormalizer::SourceIDMapping *source_ids)
Write a canonical LightTargetedExperiment into a PQP file with optional source precursor provenance.
void convertLightTargetedExperimentToPQP(const char *filename, const OpenSwath::LightTargetedExperiment &targeted_exp)
Write a canonical LightTargetedExperiment into a PQP file.
bool peptidoforms_exists
Whether transition-to-peptide mappings exist.
Definition TransitionPQPFile.h:207
TransitionPQPFile()
Constructor.
bool drift_time_exists
Whether LIBRARY_DRIFT_TIME column exists.
Definition TransitionPQPFile.h:204
void readPQPInput_(const char *filename, std::vector< TSVTransition > &transition_list, bool legacy_traml_id=false)
Read PQP SQLite file.
bool gene_exists
Whether GENE table exists.
Definition TransitionPQPFile.h:205
PQPSqlQueryInfo buildPQPSelectQuery_(SqliteConnector &conn, bool legacy_traml_id, bool stable_order) const
Build the SQL query for reading PQP transitions.
Holds information about a PQP SQL query and optional column availability.
Definition TransitionPQPFile.h:202
Definition TransitionTSVFile.h:121
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
Definition TransitionExperiment.h:369