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

Method clearMetaDataArrays

src/openms/source/KERNEL/MSExperiment.cpp:446–465  ·  view source on GitHub ↗

@brief Clears the meta data arrays of all contained spectra (float, integer and string arrays) @return @em true if meta data arrays were present and removed. @em false otherwise. */

Source from the content-addressed store, hash-verified

444 @return @em true if meta data arrays were present and removed. @em false otherwise.
445 */
446 bool MSExperiment::clearMetaDataArrays()
447 {
448 bool meta_present = false;
449 for (Size i = 0; i < spectra_.size(); ++i)
450 {
451 if (!spectra_[i].getFloatDataArrays().empty()
452 || !spectra_[i].getIntegerDataArrays().empty()
453 || !spectra_[i].getStringDataArrays().empty())
454 {
455 meta_present = true;
456 }
457 spectra_[i].getStringDataArrays().clear();
458 spectra_[i].getStringDataArrays().shrink_to_fit();
459 spectra_[i].getIntegerDataArrays().clear();
460 spectra_[i].getIntegerDataArrays().shrink_to_fit();
461 spectra_[i].getFloatDataArrays().clear();
462 spectra_[i].getFloatDataArrays().shrink_to_fit();
463 }
464 return meta_present;
465 }
466
467 /// returns the meta information of this experiment (const access)
468 const ExperimentalSettings& MSExperiment::getExperimentalSettings() const

Callers 11

main_Method · 0.80
main_Method · 0.80
main_Method · 0.80
main_Method · 0.80
main_Method · 0.80
main_Method · 0.80
main_Method · 0.80
main_Method · 0.80
main_Method · 0.80

Calls 3

sizeMethod · 0.45
emptyMethod · 0.45
clearMethod · 0.45

Tested by 8

main_Method · 0.64
main_Method · 0.64
main_Method · 0.64
main_Method · 0.64
main_Method · 0.64
main_Method · 0.64
main_Method · 0.64
main_Method · 0.64