FeatureMap with associated identification data
| 141 | |
| 142 | // FeatureMap with associated identification data |
| 143 | MzTabM MzTabM::exportFeatureMapToMzTabM(const FeatureMap& feature_map) |
| 144 | { |
| 145 | MzTabM mztabm; |
| 146 | MzTabMMetaData m_meta_data; |
| 147 | |
| 148 | // extract identification data from FeatureMap |
| 149 | const IdentificationData& id_data = feature_map.getIdentificationData(); |
| 150 | |
| 151 | OPENMS_PRECONDITION(!id_data.empty(), |
| 152 | "The FeatureMap has to have a non empty IdentificationData object attached!") |
| 153 | |
| 154 | // extract MetaValues from FeatureMap |
| 155 | std::set<String> feature_user_value_keys; |
| 156 | std::set<String> observationmatch_user_value_keys; |
| 157 | std::set<String> compound_user_value_keys; |
| 158 | MzTabM::getFeatureMapMetaValues_(feature_map, feature_user_value_keys, observationmatch_user_value_keys, compound_user_value_keys); |
| 159 | |
| 160 | // #################################################### |
| 161 | // MzTabMetaData |
| 162 | // #################################################### |
| 163 | |
| 164 | std::regex reg_backslash{R"(\\)"}; |
| 165 | UInt64 local_id = feature_map.getUniqueId(); |
| 166 | // mz_tab_id (mandatory) |
| 167 | m_meta_data.mz_tab_id.set("local_id: " + String(local_id)); |
| 168 | |
| 169 | // title (not mandatory) |
| 170 | // description (not mandatory) |
| 171 | // sample_processing (not mandatory) |
| 172 | // instrument-name (not mandatory) |
| 173 | // instrument-source (not mandatory) |
| 174 | // instrument-analyzer (not mandatory) |
| 175 | // instrument-detector (not mandatory) |
| 176 | // meta_software.setting[0] (not mandatory) |
| 177 | |
| 178 | MzTabSoftwareMetaData meta_software; |
| 179 | ControlledVocabulary cv; |
| 180 | MzTabString reliability = MzTabString("2"); // initialize at 2 (should be valid for all tools - putatively annotated compound) |
| 181 | cv.loadFromOBO("PSI-MS", File::find("/CV/psi-ms.obo")); |
| 182 | for (const auto& software : id_data.getProcessingSoftwares()) |
| 183 | { |
| 184 | if (software.metaValueExists("reliability")) |
| 185 | { |
| 186 | reliability = MzTabString(std::string(software.getMetaValue("reliability"))); |
| 187 | } |
| 188 | MzTabParameter p_software; |
| 189 | ControlledVocabulary::CVTerm cvterm; |
| 190 | // add TOPP - all OpenMS Tools have TOPP attached in the PSI-OBO |
| 191 | std::string topp_tool = "TOPP " + software.getName(); |
| 192 | if (cv.hasTermWithName(topp_tool)) // asses CV-term based on tool name |
| 193 | { |
| 194 | cvterm = cv.getTermByName(topp_tool); |
| 195 | } |
| 196 | else |
| 197 | { |
| 198 | // use "analysis software" instead |
| 199 | OPENMS_LOG_WARN << "The tool: " << topp_tool << " is currently not registered in the PSI-OBO.\n"; |
| 200 | OPENMS_LOG_WARN << "'The general term 'analysis software' will be used instead.\n"; |