|
OpenMS
2.5.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;
72 void storeProteinReliabilityColumn(
bool store);
73 void storePeptideReliabilityColumn(
bool store);
74 void storePSMReliabilityColumn(
bool store);
75 void storeSmallMoleculeReliabilityColumn(
bool store);
76 void storeProteinUriColumn(
bool store);
77 void storePeptideUriColumn(
bool store);
78 void storePSMUriColumn(
bool store);
79 void storeSmallMoleculeUriColumn(
bool store);
80 void storeProteinGoTerms(
bool store);
105 String generateMzTabProteinHeader_(
const MzTabProteinSectionRow& reference_row,
const Size n_best_search_engine_scores,
const std::vector<String>& optional_columns)
const;
109 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)
const;
113 String generateMzTabPSMHeader_(
Size n_search_engine_scores,
const std::vector<String>& optional_columns)
const;
117 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)
const;
121 String generateMzTabNucleicAcidHeader_(
Size search_ms_runs,
Size n_best_search_engine_scores,
Size n_search_engine_scores,
const std::vector<String>& optional_columns)
const;
125 String generateMzTabOligonucleotideHeader_(
Size search_ms_runs,
Size n_best_search_engine_scores,
Size n_search_engine_score,
const std::vector<String>& optional_columns)
const;
129 String generateMzTabOSMHeader_(
Size n_search_engine_scores,
const std::vector<String>& optional_columns)
const;
136 output.reserve(output.size() + rows.size() + 1);
137 for (
const auto& row : rows)
139 output.push_back(generateMzTabSectionRow_(row, optional_columns));
141 output.push_back(
String(
"\n"));
147 static void addOptionalColumnsToSectionRow_(
const std::vector<String>& column_names,
const std::vector<MzTabOptionalColumnEntry>& column_entries,
StringList& output);
150 static std::pair<int, int> extractIndexPairsFromBrackets_(
const String& s);
152 static void sortPSM_(std::vector<PeptideIdentification>::iterator begin, std::vector<PeptideIdentification>::iterator end);
154 static void keepFirstPSM_(std::vector<PeptideIdentification>::iterator begin, std::vector<PeptideIdentification>::iterator end);
157 static void partitionIntoRuns_(
const std::vector<PeptideIdentification>& pep_ids,
158 const std::vector<ProteinIdentification>& pro_ids,
159 std::map<
String, std::vector<PeptideIdentification> >& map_run_to_pepids,
160 std::map<
String, std::vector<ProteinIdentification> >& map_run_to_proids
165 static void createProteinToPeptideLinks_(
const std::map<
String, std::vector<PeptideIdentification> >& map_run_to_pepids, MapAccPepType& map_run_accession_to_pephits);
174 static String mapSearchEngineToCvParam_(
const String& openms_search_engine_name);
176 static String mapSearchEngineScoreToCvParam_(
const String& openms_search_engine_name,
double score,
String score_type);
178 static String extractNumPeptides_(
const String& common_identifier,
const String& protein_accession,
179 const MapAccPepType& map_run_accession_to_peptides);
182 static String extractNumPeptidesDistinct_(
String common_identifier,
String protein_accession,
183 const MapAccPepType& map_run_accession_to_peptides);
186 static String extractNumPeptidesUnambiguous_(
String common_identifier,
String protein_accession,
187 const MapAccPepType& map_run_accession_to_peptides);
189 static std::map<String, Size> extractNumberOfSubSamples_(
const std::map<
String, std::vector<ProteinIdentification> >& map_run_to_proids);
191 static void writePeptideHeader_(
SVOutStream& output, std::map<String, Size> n_sub_samples);
193 static void writeProteinHeader_(
SVOutStream& output, std::map<String, Size> n_sub_samples);
200 const MapAccPepType& map_run_accession_to_peptides,
201 const std::map<String, Size>& map_run_to_num_sub
PRT - Protein section (Table based)
Definition: MzTab.h:589
OpenMS identification format (.idXML)
Definition: FileTypes.h:66
Base class for TOPP applications.
Definition: TOPPBase.h:144
bool store_psm_reliability_
Definition: MzTabFile.h:88
File adapter for MzTab files.
Definition: MzTabFile.h:58
bool store_nucleic_acid_reliability_
Definition: MzTabFile.h:95
bool store_osm_reliability_
Definition: MzTabFile.h:97
A more convenient string class.
Definition: String.h:58
PEP - Peptide section (Table based)
Definition: MzTab.h:628
bool store_oligonucleotide_reliability_
Definition: MzTabFile.h:96
static MzTab exportFeatureMapToMzTab(const FeatureMap &feature_map, const String &filename)
bool store_protein_uri_
Definition: MzTabFile.h:90
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:855
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:71
bool store_peptide_uri_
Definition: MzTabFile.h:91
PSM - PSM section (Table based)
Definition: MzTab.h:665
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:101
bool store_oligonucleotide_uri_
Definition: MzTabFile.h:99
static MzTab exportConsensusMapToMzTab(const ConsensusMap &consensus_map, const String &filename, const bool first_run_inference_only, const bool export_unidentified_features, const bool export_unassigned_ids, const bool export_subfeatures, const bool export_empty_pep_ids=false, const String &title="ConsensusMap export from OpenMS")
export linked peptide features aka consensus map
bool store_psm_uri_
Definition: MzTabFile.h:92
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:739
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)
void generateMzTabSection_(const std::vector< SectionRow > &rows, const std::vector< String > &optional_columns, StringList &output) const
Generate an mzTab section comprising multiple rows of the same type.
Definition: MzTabFile.h:134
bool store_peptide_reliability_
Definition: MzTabFile.h:87
bool store_osm_uri_
Definition: MzTabFile.h:100
static MzTab exportIdentificationsToMzTab(const std::vector< ProteinIdentification > &prot_ids, const std::vector< PeptideIdentification > &peptide_ids, const String &filename, bool first_run_inference_only, std::map< std::pair< size_t, size_t >, size_t > &map_run_fileidx_2_msfileidx, std::map< String, size_t > &idrun_2_run_index, bool export_empty_pep_ids=false)
Export peptide and protein identifications to mzTab.
A container for consensus elements.
Definition: ConsensusMap.h:79
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:95
This class provides Input/Output functionality for feature maps.
Definition: FeatureXMLFile.h:68
OLI - Oligonucleotide section (table-based)
Definition: MzTab.h:774
OSM - OSM (oligonucleotide-spectrum match) section (table-based)
Definition: MzTab.h:809
SML Small molecule section (table based)
Definition: MzTab.h:709
bool store_protein_goterms_
Definition: MzTabFile.h:94
bool store_smallmolecule_reliability_
Definition: MzTabFile.h:89
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:98
bool store_smallmolecule_uri_
Definition: MzTabFile.h:93
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:61
Used to load and store idXML files.
Definition: IdXMLFile.h:63
bool store_protein_reliability_
Definition: MzTabFile.h:86
Representation of a peptide hit.
Definition: PeptideHit.h:54