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

Method getAllSearchModifications

src/openms/source/CHEMISTRY/ModificationsDB.cpp:856–887  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

854 }
855
856 void ModificationsDB::getAllSearchModifications(vector<String>& modifications) const
857 {
858 modifications.clear();
859
860 #pragma omp critical(OpenMS_ModificationsDB)
861 {
862 for (auto const & m : mods_)
863 {
864 if (m->getUniModRecordId() > 0)
865 {
866 modifications.push_back(m->getFullId());
867 }
868 }
869 }
870
871 // sort by name (case INsensitive)
872 sort(modifications.begin(), modifications.end(), [&](const String& a, const String& b) {
873 size_t i(0);
874 while (i < a.size() && i < b.size())
875 {
876 if (tolower(a[i]) == tolower(b[i]))
877 {
878 ++i;
879 }
880 else
881 {
882 return tolower(a[i]) < tolower(b[i]);
883 }
884 }
885 return a.size() < b.size();
886 });
887 }
888
889 void ModificationsDB::writeTSV(String const& filename)
890 {

Callers 1

testModificationsDBFunction · 0.95

Calls 6

sortFunction · 0.85
clearMethod · 0.45
push_backMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45

Tested by 1

testModificationsDBFunction · 0.76