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

Method writeHeader_

src/openms/source/FORMAT/MascotGenericFile.cpp:186–288  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184 }
185
186 void MascotGenericFile::writeHeader_(ostream& os)
187 {
188 // search title
189 if (param_.getValue("search_title") != "")
190 {
191 writeParameterHeader_("COM", os);
192 os << param_.getValue("search_title") << "\n";
193 }
194
195 // user name
196 writeParameterHeader_("USERNAME", os);
197 os << param_.getValue("username") << "\n";
198
199 // email
200 if (!param_.getValue("email").toString().empty())
201 {
202 writeParameterHeader_("USEREMAIL", os);
203 os << param_.getValue("email") << "\n";
204 }
205
206 // format
207 writeParameterHeader_("FORMAT", os); // make sure this stays within the first 5 lines of the file, since we use it to recognize our own MGF files in case their file suffix is not MGF
208 os << param_.getValue("internal:format") << "\n";
209
210 // precursor mass tolerance unit : Da
211 writeParameterHeader_("TOLU", os);
212 os << param_.getValue("precursor_error_units") << "\n";
213
214 // ion mass tolerance unit : Da
215 writeParameterHeader_("ITOLU", os);
216 os << param_.getValue("fragment_error_units") << "\n";
217
218 // format version
219 writeParameterHeader_("FORMVER", os);
220 os << "1.01" << "\n";
221
222 // db name
223 writeParameterHeader_("DB", os);
224 os << param_.getValue("database") << "\n";
225
226 // decoys
227 if (param_.getValue("decoy").toBool() == true)
228 {
229 writeParameterHeader_("DECOY", os);
230 os << 1 << "\n";
231 }
232
233 // search type
234 writeParameterHeader_("SEARCH", os);
235 os << param_.getValue("search_type") << "\n";
236
237 // number of peptide candidates in the list
238 writeParameterHeader_("REPORT", os);
239 UInt num_hits((UInt)param_.getValue("number_of_hits"));
240 if (num_hits != 0)
241 {
242 os << param_.getValue("number_of_hits") << "\n";
243 }

Callers

nothing calls this directly

Calls 4

getValueMethod · 0.45
emptyMethod · 0.45
toStringMethod · 0.45
toBoolMethod · 0.45

Tested by

no test coverage detected