| 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; |
nothing calls this directly
no test coverage detected