45 #include <boost/optional.hpp>
52 #pragma clang diagnostic push
53 #pragma clang diagnostic ignored "-Wnon-virtual-dtor"
82 void set(
const double& value);
86 String toCellString()
const;
88 void fromCellString(
const String& s);
115 void setNull(
bool b);
117 String toCellString()
const;
119 void fromCellString(
const String& s);
121 std::vector<MzTabDouble> get()
const;
123 void set(
const std::vector<MzTabDouble>& entries);
137 void set(
const Int& value);
141 String toCellString()
const;
143 void fromCellString(
const String& s);
147 void setNull(
bool b);
170 void setNull(
bool b);
172 String toCellString()
const;
174 void fromCellString(
const String& s);
176 std::vector<MzTabInteger> get()
const;
178 void set(
const std::vector<MzTabInteger>& entries);
192 void setNull(
bool b);
196 void set(
const bool& value);
200 String toCellString()
const;
202 void fromCellString(
const String& s);
218 void setNull(
bool b);
220 void set(
const String& value);
224 String toCellString()
const;
226 void fromCellString(
const String& s);
240 void setNull(
bool b);
242 void setCVLabel(
const String& CV_label);
244 void setAccession(
const String& accession);
246 void setName(
const String& name);
248 void setValue(
const String& value);
250 String getCVLabel()
const;
252 String getAccession()
const;
258 String toCellString()
const;
260 void fromCellString(
const String& s);
277 void setNull(
bool b);
279 String toCellString()
const;
281 void fromCellString(
const String& s);
283 std::vector<MzTabParameter> get()
const;
285 void set(
const std::vector<MzTabParameter>& parameters);
299 void setNull(
bool b);
302 void setSeparator(
char sep);
304 String toCellString()
const;
306 void fromCellString(
const String& s);
308 std::vector<MzTabString> get()
const;
310 void set(
const std::vector<MzTabString>& entries);
325 void setNull(
bool b);
328 void setPositionsAndParameters(
const std::vector<std::pair<Size, MzTabParameter> >& ppp);
330 std::vector<std::pair<Size, MzTabParameter> > getPositionsAndParameters()
const;
332 void setModificationIdentifier(
const MzTabString& mod_id);
336 String toCellString()
const;
338 void fromCellString(
const String& s);
351 void setNull(
bool b);
353 String toCellString()
const;
355 void fromCellString(
const String& s);
357 std::vector<MzTabModification> get()
const;
359 void set(
const std::vector<MzTabModification>& entries);
373 void setNull(
bool b);
375 void setMSFile(
Size index);
377 void setSpecRef(
const String& spec_ref);
379 String getSpecRef()
const;
381 Size getMSFile()
const;
383 void setSpecRefFile(
const String& spec_ref);
385 String toCellString()
const;
387 void fromCellString(
const String& s);
501 std::map<Size, MzTabString>
uri;
513 std::map<Size, MzTabMSRunMetaData>
ms_run;
517 std::map<Size, MzTabSampleMetaData>
sample;
519 std::map<Size, MzTabAssayMetaData>
assay;
523 std::map<Size, MzTabCVMetaData>
cv;
559 std::vector<MzTabOptionalColumnEntry>
opt_;
595 std::vector<MzTabOptionalColumnEntry>
opt_;
632 std::vector<MzTabOptionalColumnEntry>
opt_;
680 std::vector<MzTabOptionalColumnEntry>
opt_;
705 std::vector<MzTabOptionalColumnEntry>
opt_;
736 std::vector<MzTabOptionalColumnEntry>
opt_;
767 std::vector<MzTabOptionalColumnEntry>
opt_;
845 void setCommentRows(
const std::map<Size, String>& com);
847 void setEmptyRows(
const std::vector<Size>& empty);
849 const std::vector<Size>& getEmptyRows()
const;
851 const std::map<Size, String>& getCommentRows()
const;
854 std::vector<String> getProteinOptionalColumnNames()
const;
857 std::vector<String> getPeptideOptionalColumnNames()
const;
860 std::vector<String> getPSMOptionalColumnNames()
const;
863 std::vector<String> getSmallMoleculeOptionalColumnNames()
const;
871 static void addPepEvidenceToRows(
const std::vector<PeptideEvidence>& peptide_evidences,
MzTabPSMSectionRow& row);
874 std::vector<String> getNucleicAcidOptionalColumnNames()
const;
877 std::vector<String> getOligonucleotideOptionalColumnNames()
const;
879 static void addMetaInfoToOptionalColumns(
const std::set<String>& keys, std::vector<MzTabOptionalColumnEntry>& opt,
const String&
id,
const MetaInfoInterface& meta);
882 std::vector<String> getOSMOptionalColumnNames()
const;
884 static std::map<Size, MzTabModificationMetaData> generateMzTabStringFromModifications(
const std::vector<String>& mods);
886 static std::map<Size, MzTabModificationMetaData> generateMzTabStringFromVariableModifications(
const std::vector<String>& mods);
888 static std::map<Size, MzTabModificationMetaData> generateMzTabStringFromFixedModifications(
const std::vector<String>& mods);
904 static MzTab exportIdentificationsToMzTab(
905 const std::vector<ProteinIdentification>& prot_ids,
906 const std::vector<PeptideIdentification>& peptide_ids,
908 bool first_run_inference_only,
909 bool export_empty_pep_ids =
false,
910 const String& title =
"ID export from OpenMS");
917 static MzTabModificationList extractModificationList(
const PeptideHit& pep_hit,
const std::vector<String>& fixed_mods,
const std::vector<String>& localization_mods);
930 static MzTab exportConsensusMapToMzTab(
933 const bool first_run_inference_only,
934 const bool export_unidentified_features,
935 const bool export_unassigned_ids,
936 const bool export_subfeatures,
937 const bool export_empty_pep_ids =
false,
938 const String& title =
"ConsensusMap export from OpenMS");
944 const std::vector<const ProteinIdentification*>& prot_ids,
945 const std::vector<const PeptideIdentification*>& peptide_ids,
947 bool first_run_inference_only,
948 bool export_empty_pep_ids =
false,
949 const String& title =
"ID export from OpenMS");
953 const std::vector<String>& getProteinOptionalColumnNames()
const;
954 const std::vector<String>& getPeptideOptionalColumnNames()
const;
955 const std::vector<String>& getPSMOptionalColumnNames()
const;
984 size_t quant_study_variables_ = 0;
985 size_t n_study_variables_ = 0;
986 size_t PRT_STATE_ = 0;
987 size_t prt_run_id_ = 0;
988 size_t prt_hit_id_ = 0;
989 size_t prt_group_id_ = 0;
990 size_t prt_indistgroup_id_ = 0;
1008 const bool first_run_inference_only,
1009 const bool export_unidentified_features,
1010 const bool export_unassigned_ids,
1011 const bool export_subfeatures,
1012 const bool export_empty_pep_ids =
false,
1013 const String& title =
"ConsensusMap export from OpenMS");
1017 const std::vector<String>& getProteinOptionalColumnNames()
const;
1018 const std::vector<String>& getPeptideOptionalColumnNames()
const;
1019 const std::vector<String>& getPSMOptionalColumnNames()
const;
1049 size_t quant_study_variables_ = 0;
1050 size_t n_study_variables_ = 0;
1051 size_t PRT_STATE_ = 0;
1052 size_t prt_run_id_ = 0;
1053 size_t prt_hit_id_ = 0;
1054 size_t prt_group_id_ = 0;
1055 size_t prt_indistgroup_id_ = 0;
1071 static std::map<String, Size> mapIDRunIdentifier2IDRunIndex_(
const std::vector<const ProteinIdentification*>& prot_ids);
1073 static boost::optional<MzTabPSMSectionRow> PSMSectionRowFromPeptideID_(
1075 const std::vector<const ProteinIdentification*>& prot_id,
1076 std::map<String, size_t>& idrun_2_run_index,
1077 std::map<std::pair<size_t,size_t>,
size_t>& map_run_fileidx_2_msfileidx,
1078 std::map<
Size, std::vector<std::pair<String, String>>>& run_to_search_engines,
1082 const bool export_empty_pep_ids);
1088 const Size n_study_variables,
1089 const std::set<String>& consensus_feature_user_value_keys,
1090 const std::set<String>& peptide_hit_user_value_keys,
1091 const std::map<String, size_t>& idrun_2_run_index,
1092 const std::map<std::pair<size_t,size_t>,
size_t>& map_run_fileidx_2_msfileidx,
1093 const std::map< std::pair< String, unsigned >,
unsigned>& path_label_to_assay,
1094 const std::vector<String>& fixed_mods,
1095 bool export_subfeatures);
1099 const std::set<String>& feature_user_value_keys,
1100 const std::set<String>& peptide_hit_user_value_keys,
1101 const std::vector<String>& fixed_mods);
1107 const std::set<String>& protein_hit_user_value_keys);
1115 const std::vector<ProteinHit>& protein_hits,
1118 const std::map<
Size, std::set<Size>>& ind2prot,
1122 static void addMSRunMetaData_(
1123 const std::map<size_t, String>& msrunindex_2_msfilename,
1126 static void mapBetweenMSFileNameAndMSRunIndex_(
1127 const std::vector<const ProteinIdentification*>& prot_ids,
1129 std::map<String, size_t>& msfilename_2_msrunindex,
1130 std::map<size_t, String>& msrunindex_2_msfilename);
1137 static void getConsensusMapMetaValues_(
const ConsensusMap& consensus_map, std::set<String>& consensus_feature_user_value_keys, std::set<String>& peptide_hit_user_value_keys);
1139 static void getFeatureMapMetaValues_(
const FeatureMap& feature_map, std::set<String>& feature_user_value_keys, std::set<String>& peptide_hit_user_value_keys);
1141 static void getIdentificationMetaValues_(
1142 const std::vector<const ProteinIdentification*>& prot_ids,
1143 std::vector<const PeptideIdentification*>& peptide_ids_,
1144 std::set<String>& protein_hit_user_value_keys,
1145 std::set<String>& peptide_id_user_value_keys,
1146 std::set<String>& peptide_hit_user_value_keys);
1149 template <
class ForwardIterator>
1154 first->substitute(
' ',
'_');
1161 std::set<String> tmp_keys;
1162 auto first = keys.begin();
1163 while (first != keys.end())
1167 tmp_keys.insert(std::move(s));
1170 std::swap(keys, tmp_keys);
1174 static MzTabParameter getMSRunSpectrumIdentifierType_(
const std::vector<const PeptideIdentification*>& peptide_ids_);
1176 static void mapBetweenRunAndSearchEngines_(
1177 const std::vector<const ProteinIdentification*>& prot_ids,
1178 const std::vector<const PeptideIdentification*>& pep_ids,
1179 bool skip_first_run,
1180 std::map<std::tuple<String, String, String>, std::set<Size>>& search_engine_to_runs,
1181 std::map<
Size, std::vector<std::pair<String, String>>>& run_to_search_engines,
1182 std::map<
Size, std::vector<std::vector<std::pair<String, String>>>>& run_to_search_engines_settings,
1183 std::map<
String, std::vector<std::pair<String, String>>>& search_engine_to_settings);
1185 static std::map<Size, std::set<Size>> mapGroupsToProteins_(
1186 const std::vector<ProteinIdentification::ProteinGroup>& groups,
1187 const std::vector<ProteinHit>& proteins);
1189 static void addSearchMetaData_(
1190 const std::vector<const ProteinIdentification*>& prot_ids,
1191 const std::map<std::tuple<String, String, String>, std::set<Size>>& search_engine_to_runs,
1192 const std::map<
String, std::vector<std::pair<String,String>>>& search_engine_to_settings,
1194 bool first_run_inference_only);
1196 static void mapIDRunFileIndex2MSFileIndex_(
1197 const std::vector<const ProteinIdentification*>& prot_ids,
1198 const std::map<String, size_t>& msfilename_2_msrunindex,
1199 bool skip_first_run,
1200 std::map<std::pair<size_t, size_t>,
size_t>& map_run_fileidx_2_msfileidx);
1203 template <
typename SectionRows>
1207 std::vector<String> names;
1210 for (
typename SectionRows::const_iterator it = rows.begin(); it != rows.end(); ++it)
1212 for (
auto it_opt = it->opt_.cbegin(); it_opt != it->opt_.cend(); ++it_opt)
1214 if (
std::find(names.begin(), names.end(), it_opt->first) == names.end())
1216 names.push_back(it_opt->first);
1224 static void getSearchModifications_(
1225 const std::vector<const ProteinIdentification*>& prot_ids,
1234 static void checkSequenceUniqueness_(
const std::vector<PeptideIdentification>& curr_pep_ids);
1250 #pragma clang diagnostic pop