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

Method load

src/openms/source/FORMAT/PepNovoOutfile.cpp:34–309  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32 }
33
34 void
35 PepNovoOutfile::load(
36 const std::string & result_filename,
37 vector<PeptideIdentification> & peptide_identifications,
38 ProteinIdentification & protein_identification,
39 const double & score_threshold,
40 const IndexPosMappingType & index_to_precursor,
41 const map<String, String> & pnovo_modkey_to_mod_id
42 )
43 {
44 // generally used variables
45 StringList substrings;
46 map<String, Int> columns;
47 PeptideHit peptide_hit;
48
49 String
50 line,
51 score_type = "PepNovo",
52 version = "unknown",
53 identifier,
54 filename,
55 sequence,
56 sequence_with_mods;
57
58 DateTime datetime = DateTime::now(); // there's no date given from PepNovo
59 protein_identification.setDateTime(datetime);
60
61 peptide_identifications.clear();
62 PeptideIdentification peptide_identification;
63 protein_identification = ProteinIdentification();
64
65 // open the result
66 ifstream result_file(result_filename.c_str());
67 if (!result_file)
68 {
69 throw Exception::FileNotFound(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, result_filename);
70 }
71
72 Size line_number(0); // used to report in which line an error occurred
73 Size id_count(0); // number of IDs seen (not necessarily the ones finally returned)
74
75 getSearchEngineAndVersion(result_filename, protein_identification);
76 //if information could not be retrieved from the outfile use defaults
77 if (protein_identification.getSearchEngineVersion().empty())
78 {
79 protein_identification.setSearchEngine("PepNovo");
80 protein_identification.setSearchEngineVersion(version);
81 }
82 identifier = protein_identification.getSearchEngine() + "_" + datetime.getDate();
83 protein_identification.setIdentifier(identifier);
84
85 map<String, String> mod_mask_map;
86 const vector<String> & mods = protein_identification.getSearchParameters().variable_modifications;
87 for (const String& mod_it : mods)
88 {
89 if (mod_it.empty())
90 continue;
91 //cout<<*mod_it<<endl;

Callers

nothing calls this directly

Calls 15

getInstanceFunction · 0.85
setSearchEngineMethod · 0.80
getDateMethod · 0.80
prefixMethod · 0.80
getIdMethod · 0.80
substrMethod · 0.80
toIntMethod · 0.80
toDoubleMethod · 0.80
toFloatMethod · 0.80
hasSubstringMethod · 0.80

Tested by

no test coverage detected