|
OpenMS
2.6.0
|
Go to the documentation of this file.
44 #include <boost/math/special_functions/fpclassify.hpp>
66 typedef std::map<std::pair<String, String>, std::vector<PeptideHit> >
MapAccPepType;
69 void store(
const String& filename,
const MzTab& mz_tab)
const;
74 const std::vector<ProteinIdentification>& protein_identifications,
75 const std::vector<PeptideIdentification>& peptide_identifications,
76 bool first_run_inference_only,
77 bool export_empty_pep_ids =
false,
78 const String& title =
"ID export from OpenMS");
84 const bool first_run_inference_only,
85 const bool export_unidentified_features,
86 const bool export_unassigned_ids,
87 const bool export_subfeatures,
88 const bool export_empty_pep_ids =
false)
const;
91 void storeProteinReliabilityColumn(
bool store);
92 void storePeptideReliabilityColumn(
bool store);
93 void storePSMReliabilityColumn(
bool store);
94 void storeSmallMoleculeReliabilityColumn(
bool store);
95 void storeProteinUriColumn(
bool store);
96 void storePeptideUriColumn(
bool store);
97 void storePSMUriColumn(
bool store);
98 void storeSmallMoleculeUriColumn(
bool store);
99 void storeProteinGoTerms(
bool store);
127 const Size n_best_search_engine_scores,
128 const std::vector<String>& optional_columns,
130 size_t& n_columns)
const;
134 String generateMzTabPeptideHeader_(
Size search_ms_runs,
Size n_best_search_engine_scores,
Size n_search_engine_score,
Size assays,
Size study_variables,
const std::vector<String>& optional_columns,
size_t& n_columns)
const;
138 String generateMzTabPSMHeader_(
Size n_search_engine_scores,
const std::vector<String>& optional_columns,
size_t& n_columns)
const;
142 String generateMzTabSmallMoleculeHeader_(
Size search_ms_runs,
Size n_best_search_engine_scores,
Size n_search_engine_score,
Size assays,
Size study_variables,
const std::vector<String>& optional_columns,
size_t& n_columns)
const;
146 String generateMzTabNucleicAcidHeader_(
Size search_ms_runs,
Size n_best_search_engine_scores,
Size n_search_engine_scores,
const std::vector<String>& optional_columns,
size_t& n_columns)
const;
150 String generateMzTabOligonucleotideHeader_(
Size search_ms_runs,
Size n_best_search_engine_scores,
Size n_search_engine_score,
const std::vector<String>& optional_columns,
size_t& n_columns)
const;
154 String generateMzTabOSMHeader_(
Size n_search_engine_scores,
const std::vector<String>& optional_columns,
size_t& n_columns)
const;
161 output.reserve(output.size() + rows.size() + 1);
162 for (
const auto& row : rows)
164 size_t n_section_columns = 0;
165 output.push_back(generateMzTabSectionRow_(row, optional_columns, meta, n_section_columns));
166 if (n_header_columns != n_section_columns)
throw Exception::Postcondition(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION,
"Header and content differs in columns. Please report this bug to the OpenMS developers.");
173 static void addOptionalColumnsToSectionRow_(
const std::vector<String>& column_names,
const std::vector<MzTabOptionalColumnEntry>& column_entries,
StringList& output);
176 static std::pair<int, int> extractIndexPairsFromBrackets_(
const String& s);
178 static void sortPSM_(std::vector<PeptideIdentification>::iterator begin, std::vector<PeptideIdentification>::iterator end);
180 static void keepFirstPSM_(std::vector<PeptideIdentification>::iterator begin, std::vector<PeptideIdentification>::iterator end);
183 static void partitionIntoRuns_(
const std::vector<PeptideIdentification>& pep_ids,
184 const std::vector<ProteinIdentification>& pro_ids,
185 std::map<
String, std::vector<PeptideIdentification> >& map_run_to_pepids,
186 std::map<
String, std::vector<ProteinIdentification> >& map_run_to_proids
191 static void createProteinToPeptideLinks_(
const std::map<
String, std::vector<PeptideIdentification> >& map_run_to_pepids, MapAccPepType& map_run_accession_to_pephits);
200 static String mapSearchEngineToCvParam_(
const String& openms_search_engine_name);
202 static String mapSearchEngineScoreToCvParam_(
const String& openms_search_engine_name,
double score,
String score_type);
204 static String extractNumPeptides_(
const String& common_identifier,
const String& protein_accession,
205 const MapAccPepType& map_run_accession_to_peptides);
208 static String extractNumPeptidesDistinct_(
String common_identifier,
String protein_accession,
209 const MapAccPepType& map_run_accession_to_peptides);
212 static String extractNumPeptidesUnambiguous_(
String common_identifier,
String protein_accession,
213 const MapAccPepType& map_run_accession_to_peptides);
215 static std::map<String, Size> extractNumberOfSubSamples_(
const std::map<
String, std::vector<ProteinIdentification> >& map_run_to_proids);
217 static void writePeptideHeader_(
SVOutStream& output, std::map<String, Size> n_sub_samples);
219 static void writeProteinHeader_(
SVOutStream& output, std::map<String, Size> n_sub_samples);
226 const MapAccPepType& map_run_accession_to_peptides,
227 const std::map<String, Size>& map_run_to_num_sub
Postcondition failed exception.
Definition: Exception.h:180
PRT - Protein section (Table based)
Definition: MzTab.h:534
OpenMS identification format (.idXML)
Definition: FileTypes.h:66
Base class for TOPP applications.
Definition: TOPPBase.h:144
bool store_psm_reliability_
Definition: MzTabFile.h:107
File adapter for MzTab files.
Definition: MzTabFile.h:58
bool store_nucleic_acid_reliability_
Definition: MzTabFile.h:114
bool store_osm_reliability_
Definition: MzTabFile.h:116
A more convenient string class.
Definition: String.h:59
PEP - Peptide section (Table based)
Definition: MzTab.h:573
bool store_oligonucleotide_reliability_
Definition: MzTabFile.h:115
static MzTab exportFeatureMapToMzTab(const FeatureMap &feature_map, const String &filename)
bool store_protein_uri_
Definition: MzTabFile.h:109
OpenMS consensus map format (.consensusXML)
Definition: FileTypes.h:67
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
static bool contains(const std::vector< T > &container, const E &elem)
Checks whether the element elem is contained in the given container.
Definition: ListUtils.h:146
Data model of MzTab files. Please see the official MzTab specification at https://code....
Definition: MzTab.h:800
mzIdentML (HUPO PSI AnalysisXML followup format) (.mzid)
Definition: FileTypes.h:77
#define OPENMS_LOG_WARN
Macro if a warning, a piece of information which should be read by the user, should be logged.
Definition: LogStream.h:460
Representation of a protein identification run.
Definition: ProteinIdentification.h:70
bool store_peptide_uri_
Definition: MzTabFile.h:110
PSM - PSM section (Table based)
Definition: MzTab.h:610
void load(const String &filename, std::vector< ProteinIdentification > &protein_ids, std::vector< PeptideIdentification > &peptide_ids)
Loads the identifications of an idXML file without identifier.
bool store_nucleic_acid_goterms_
Definition: MzTabFile.h:120
bool store_oligonucleotide_uri_
Definition: MzTabFile.h:118
bool store_psm_uri_
Definition: MzTabFile.h:111
File adapter for MzIdentML files.
Definition: MzIdentMLFile.h:67
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
OpenMS feature file (.featureXML)
Definition: FileTypes.h:65
Stream class for writing to comma/tab/...-separated values files.
Definition: SVOutStream.h:54
void load(const String &filename, FeatureMap &feature_map)
loads the file with name filename into map and calls updateRanges().
NUC - Nucleic acid section (table-based)
Definition: MzTab.h:684
Type
Actual file types enum.
Definition: FileTypes.h:58
void store(const String &filename, const MzTab &mz_tab) const
static FileTypes::Type getType(const String &filename)
Tries to determine the file type (by name or content)
bool store_peptide_reliability_
Definition: MzTabFile.h:106
bool store_osm_uri_
Definition: MzTabFile.h:119
A container for consensus elements.
Definition: ConsensusMap.h:80
const std::vector< PeptideIdentification > & getUnassignedPeptideIdentifications() const
non-mutable access to the unassigned peptide identifications
std::vector< String > StringList
Vector of String.
Definition: ListUtils.h:70
void load(const String &filename, std::vector< ProteinIdentification > &poid, std::vector< PeptideIdentification > &peid)
Loads the identifications from a MzIdentML file.
void setProteinIdentifications(const std::vector< ProteinIdentification > &protein_identifications)
sets the protein identifications
int main(int argc, const char **argv)
Definition: INIFileEditor.cpp:73
A container for features.
Definition: FeatureMap.h:97
This class provides Input/Output functionality for feature maps.
Definition: FeatureXMLFile.h:68
OLI - Oligonucleotide section (table-based)
Definition: MzTab.h:719
OSM - OSM (oligonucleotide-spectrum match) section (table-based)
Definition: MzTab.h:754
void generateMzTabSection_(const std::vector< SectionRow > &rows, const std::vector< String > &optional_columns, const MzTabMetaData &meta, StringList &output, size_t n_header_columns) const
Generate an mzTab section comprising multiple rows of the same type and perform sanity check.
Definition: MzTabFile.h:159
SML Small molecule section (table based)
Definition: MzTab.h:654
bool store_protein_goterms_
Definition: MzTabFile.h:113
bool store_smallmolecule_reliability_
Definition: MzTabFile.h:108
const char * what() const noexcept override
Returns the error message of the exception.
std::map< std::pair< String, String >, std::vector< PeptideHit > > MapAccPepType
Definition: MzTabFile.h:66
bool store_nucleic_acid_uri_
Definition: MzTabFile.h:117
bool store_smallmolecule_uri_
Definition: MzTabFile.h:112
const std::vector< ProteinIdentification > & getProteinIdentifications() const
non-mutable access to the protein identifications
This class provides Input functionality for ConsensusMaps and Output functionality for alignments and...
Definition: ConsensusXMLFile.h:62
Used to load and store idXML files.
Definition: IdXMLFile.h:63
bool store_protein_reliability_
Definition: MzTabFile.h:105
Representation of a peptide hit.
Definition: PeptideHit.h:55