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

Method createParamFile_

src/topp/CometAdapter.cpp:258–581  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

256 }
257
258 ExitCodes createParamFile_(ostream& os, const String& comet_version)
259 {
260 os << comet_version << "\n"; // required as first line in the param file
261 os << "# Comet MS/MS search engine parameters file.\n";
262 os << "# Everything following the '#' symbol is treated as a comment.\n";
263 os << "database_name = " << getStringOption_("database") << "\n";
264 os << "decoy_search = " << 0 << "\n"; // 0=no (default), 1=concatenated search, 2=separate search
265 os << "peff_format = 0\n"; // 0=no (normal fasta, default), 1=PEFF PSI-MOD, 2=PEFF Unimod
266 os << "peff_obo =\n"; // path to PSI Mod or Unimod OBO file
267
268 os << "num_threads = " << getIntOption_("threads") << "\n"; // 0=poll CPU to set num threads; else specify num threads directly (max 64)
269
270 // masses
271 map<String,int> precursor_error_units;
272 precursor_error_units["amu"] = 0;
273 precursor_error_units["mmu"] = 1;
274 precursor_error_units["ppm"] = 2;
275
276 map<string,int> isotope_error;
277 isotope_error["off"] = 0;
278 isotope_error["0/1"] = 1;
279 isotope_error["0/1/2"] = 2;
280 isotope_error["0/1/2/3"] = 3;
281 isotope_error["-8/-4/0/4/8"] = 4;
282 isotope_error["-1/0/1/2/3"] = 5;
283
284 os << "peptide_mass_tolerance = " << getDoubleOption_("precursor_mass_tolerance") << "\n";
285 os << "peptide_mass_units = " << precursor_error_units[getStringOption_("precursor_error_units")] << "\n"; // 0=amu, 1=mmu, 2=ppm
286 os << "mass_type_parent = " << 1 << "\n"; // 0=average masses, 1=monoisotopic masses
287 os << "mass_type_fragment = " << 1 << "\n"; // 0=average masses, 1=monoisotopic masses
288 os << "precursor_tolerance_type = " << 1 << "\n"; // 0=MH+ (default), 1=precursor m/z; only valid for amu/mmu tolerances
289 os << "isotope_error = " << isotope_error[getStringOption_(Constants::UserParam::ISOTOPE_ERROR)] << "\n"; // 0=off, 1=0/1 (C13 error), 2=0/1/2, 3=0/1/2/3, 4=-8/-4/0/4/8 (for +4/+8 labeling)
290
291 // search enzyme
292
293 String enzyme_name = getStringOption_("enzyme");
294 String enzyme_number = String(ProteaseDB::getInstance()->getEnzyme(enzyme_name)->getCometID());
295 String second_enzyme_name = getStringOption_("second_enzyme");
296 String enzyme2_number = "0";
297 if (!second_enzyme_name.empty())
298 {
299 enzyme2_number = String(ProteaseDB::getInstance()->getEnzyme(second_enzyme_name)->getCometID());
300 }
301
302 os << "search_enzyme_number = " << enzyme_number << "\n"; // choose from list at end of this params file
303 os << "search_enzyme2_number = " << enzyme2_number << "\n"; // second enzyme; set to 0 if no second enzyme
304 os << "num_enzyme_termini = " << num_enzyme_termini[getStringOption_("num_enzyme_termini")] << "\n"; // 1 (semi-digested), 2 (fully digested, default), 8 C-term unspecific , 9 N-term unspecific
305 os << "allowed_missed_cleavage = " << getIntOption_("missed_cleavages") << "\n"; // maximum value is 5; for enzyme search
306
307 // Up to 9 variable modifications are supported
308 // # format: <mass> <residues> <0=variable/else binary> <max_mods_per_peptide> <term_distance> <n/c-term> <required> <neutral_loss>
309 // e.g. 79.966331 STY 0 3 -1 0 0 97.976896
310 vector<String> variable_modifications_names = getStringList_("variable_modifications");
311 const vector<const ResidueModification*> variable_modifications = getModifications_(variable_modifications_names);
312 if (variable_modifications.size() > 9)
313 {
314 throw OpenMS::Exception::IllegalArgument(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, "Error: Comet supports at most 9 variable modifications. " + String(variable_modifications.size()) + " provided.");
315 }

Callers

nothing calls this directly

Calls 15

getInstanceFunction · 0.85
concatenateFunction · 0.85
getCometIDMethod · 0.80
getEnzymeMethod · 0.80
getDiffMonoMassMethod · 0.80
getResidueMethod · 0.80
toLowerMethod · 0.80
StringClass · 0.50
emptyMethod · 0.45
sizeMethod · 0.45
getOriginMethod · 0.45

Tested by

no test coverage detected