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

Method writeSoftware_

src/openms/source/FORMAT/HANDLERS/MzMLHandler.cpp:3615–3641  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3613 }
3614
3615 void MzMLHandler::writeSoftware_(std::ostream& os, const String& id, const Software& software, const Internal::MzMLValidator& validator)
3616 {
3617 os << "\t\t<software id=\"" << id << "\" version=\"" << software.getVersion() << "\" >\n";
3618 ControlledVocabulary::CVTerm so_term = getChildWithName_("MS:1000531", software.getName());
3619 if (so_term.id.empty())
3620 {
3621 so_term = getChildWithName_("MS:1000531", software.getName() + " software"); //act of desperation to find the right cv and keep compatible with older cv mzmls
3622 }
3623 if (so_term.id.empty())
3624 {
3625 so_term = getChildWithName_("MS:1000531", "TOPP " + software.getName()); //act of desperation to find the right cv and keep compatible with older cv mzmls
3626 }
3627 if (so_term.id == "MS:1000799")
3628 {
3629 os << "\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000799\" name=\"custom unreleased software tool\" value=\"\" />\n";
3630 }
3631 else if (!so_term.id.empty())
3632 {
3633 os << "\t\t\t<cvParam cvRef=\"MS\" accession=\"" << so_term.id << "\" name=\"" << writeXMLEscape(so_term.name) << "\" />\n";
3634 }
3635 else
3636 {
3637 os << "\t\t\t<cvParam cvRef=\"MS\" accession=\"MS:1000799\" name=\"custom unreleased software tool\" value=\"" << writeXMLEscape(software.getName()) << "\" />\n";
3638 }
3639 writeUserParam_(os, software, 3, "/mzML/Software/cvParam/@accession", validator);
3640 os << "\t\t</software>\n";
3641 }
3642
3643 void MzMLHandler::writeSourceFile_(std::ostream& os, const String& id, const SourceFile& source_file, const Internal::MzMLValidator& validator)
3644 {

Callers

nothing calls this directly

Calls 4

writeXMLEscapeFunction · 0.50
getVersionMethod · 0.45
getNameMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected