| 50 | } |
| 51 | |
| 52 | vector<Size> InspectOutfile::load(const String& result_filename, vector<PeptideIdentification>& peptide_identifications, |
| 53 | ProteinIdentification& protein_identification, const double p_value_threshold, const String& database_filename) |
| 54 | { |
| 55 | // check whether the p_value is correct |
| 56 | if ((p_value_threshold < 0) || (p_value_threshold > 1)) |
| 57 | { |
| 58 | throw Exception::IllegalArgument(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, "The parameters 'p_value_threshold' must be >= 0 and <=1 !"); |
| 59 | } |
| 60 | |
| 61 | ifstream result_file(result_filename.c_str()); |
| 62 | if (!result_file) |
| 63 | { |
| 64 | throw Exception::FileNotFound(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, result_filename); |
| 65 | } |
| 66 | |
| 67 | String |
| 68 | line, |
| 69 | accession, |
| 70 | accession_type, |
| 71 | spectrum_file, |
| 72 | identifier; |
| 73 | |
| 74 | Size |
| 75 | record_number(0), |
| 76 | scan_number(0), |
| 77 | line_number(0), |
| 78 | number_of_columns(0); |
| 79 | |
| 80 | vector<String> substrings; |
| 81 | vector<Size> corrupted_lines; |
| 82 | |
| 83 | PeptideIdentification peptide_identification; |
| 84 | |
| 85 | if (!getline(result_file, line)) // the header is read in a special function, so it can be skipped |
| 86 | { |
| 87 | result_file.close(); |
| 88 | result_file.clear(); |
| 89 | throw Exception::FileEmpty(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, result_filename); |
| 90 | } |
| 91 | if (!line.empty() && (line[line.length() - 1] < 33)) |
| 92 | line.resize(line.length() - 1); |
| 93 | line.trim(); |
| 94 | ++line_number; |
| 95 | |
| 96 | DateTime datetime = DateTime::now(); |
| 97 | if (protein_identification.getSearchEngine().empty()) |
| 98 | { |
| 99 | identifier = "InsPecT_" + datetime.getDate(); |
| 100 | } |
| 101 | else |
| 102 | { |
| 103 | protein_identification.getSearchEngine() + "_" + datetime.getDate(); |
| 104 | } |
| 105 | // to get the precursor retention time and mz values later, save the filename and the numbers of the scans |
| 106 | vector<pair<String, vector<pair<Size, Size> > > > files_and_peptide_identification_with_scan_number; |
| 107 | // the record number is mapped to the position in the protein hits, to retrieve their sequences |
| 108 | map<Size, Size> rn_position_map; |
| 109 |
nothing calls this directly
no test coverage detected