MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / writeMetadata

Method writeMetadata

src/openms/source/FORMAT/HANDLERS/CachedMzMLHandler.cpp:201–238  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

199 }
200
201 void CachedMzMLHandler::writeMetadata(MapType exp, const String& out_meta, bool addCacheMetaValue)
202 {
203 // delete the actual data for all spectra and chromatograms, leave only metadata
204 // TODO : remove copy
205 std::vector<MSChromatogram > chromatograms = exp.getChromatograms(); // copy
206 for (Size i = 0; i < exp.size(); i++)
207 {
208 exp[i].clear(false);
209 }
210 for (Size i = 0; i < exp.getChromatograms().size(); i++)
211 {
212 chromatograms[i].clear(false);
213 }
214 exp.setChromatograms(chromatograms);
215
216 if (addCacheMetaValue)
217 {
218 // set dataprocessing on each spectrum/chromatogram
219 boost::shared_ptr< DataProcessing > dp = boost::shared_ptr< DataProcessing >(new DataProcessing);
220 std::set<DataProcessing::ProcessingAction> actions;
221 actions.insert(DataProcessing::FORMAT_CONVERSION);
222 dp->setProcessingActions(actions);
223 dp->setMetaValue("cached_data", "true");
224 for (Size i=0; i<exp.size(); ++i)
225 {
226 exp[i].getDataProcessing().push_back(dp);
227 }
228 std::vector<MSChromatogram > l_chromatograms = exp.getChromatograms();
229 for (Size i=0; i<l_chromatograms.size(); ++i)
230 {
231 l_chromatograms[i].getDataProcessing().push_back(dp);
232 }
233 exp.setChromatograms(l_chromatograms);
234 }
235
236 // store the meta data using the regular MzMLFile
237 MzMLFile().store(out_meta, exp);
238 }
239
240 void CachedMzMLHandler::writeMetadata_x(const MapType& exp, const String& out_meta, const bool addCacheMetaValue)
241 {

Callers 5

main_Method · 0.80
main_Method · 0.80
doCacheFile_Method · 0.80
ensureMapsAreFilled_Function · 0.80

Calls 11

MzMLFileClass · 0.85
getChromatogramsMethod · 0.80
setChromatogramsMethod · 0.80
setProcessingActionsMethod · 0.80
sizeMethod · 0.45
clearMethod · 0.45
insertMethod · 0.45
setMetaValueMethod · 0.45
push_backMethod · 0.45
getDataProcessingMethod · 0.45
storeMethod · 0.45

Tested by

no test coverage detected