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

Method doCacheFile_

src/openms/source/FORMAT/SwathFile.cpp:279–295  ·  view source on GitHub ↗

Cache a file to disk

Source from the content-addressed store, hash-verified

277
278 /// Cache a file to disk
279 OpenSwath::SpectrumAccessPtr SwathFile::doCacheFile_(const String& in, const String& tmp, const String& tmp_fname,
280 const boost::shared_ptr<PeakMap >& experiment_metadata)
281 {
282 String cached_file = tmp + tmp_fname + ".cached";
283 String meta_file = tmp + tmp_fname;
284
285 // Create new consumer, transform infile, write out metadata
286 {
287 MSDataCachedConsumer cachedConsumer(cached_file, true);
288 MzMLFile().transform(in, &cachedConsumer, *experiment_metadata.get());
289 Internal::CachedMzMLHandler().writeMetadata(*experiment_metadata.get(), meta_file, true);
290 } // ensure that filestream gets closed
291
292 boost::shared_ptr<PeakMap > exp(new PeakMap);
293 MzMLFile().load(meta_file, *exp.get());
294 return SimpleOpenMSSpectraFactory::getSpectrumAccessOpenMSPtr(exp);
295 }
296
297 /// Only read the meta data from a file and use it to populate exp_meta
298 boost::shared_ptr< PeakMap > SwathFile::populateMetaData_(const String& file)

Callers

nothing calls this directly

Calls 5

MzMLFileClass · 0.85
writeMetadataMethod · 0.80
transformMethod · 0.45
getMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected