35 #ifndef OPENMS_FORMAT_MASCOTINFILE_H 
   36 #define OPENMS_FORMAT_MASCOTINFILE_H 
   82     template <
typename MapType>
 
   91       std::ifstream is(filename.c_str());
 
   92       std::vector<std::pair<double, double> > spec;
 
   94       double pre_mz(0), pre_int(0), rt(-1);
 
   96       while (getNextSpectrum_(is, spec, charge, pre_mz, pre_int, rt, title))
 
   98         typename MapType::SpectrumType spectrum;
 
   99         for (std::vector<std::pair<double, double> >::const_iterator it = spec.begin(); it != spec.end(); ++it)
 
  103           p.setIntensity(it->second);
 
  104           spectrum.push_back(p);
 
  106         spectrum.setMSLevel(2);
 
  107         spectrum.getPrecursors().resize(1);
 
  108         spectrum.getPrecursors()[0].setMZ(pre_mz);
 
  109         spectrum.getPrecursors()[0].setIntensity(pre_int);
 
  110         spectrum.getPrecursors()[0].setCharge(charge);
 
  114           spectrum.setMetaValue(
"TITLE", title);
 
  118         exp.addSpectrum(spectrum);
 
  129     const String & getBoundary();
 
  131     void setBoundary(
const String & boundary);
 
  136     void setDB(
const String & db);
 
  139     const String & getSearchType();
 
  141     void setSearchType(
const String & search_type);
 
  146     void setHits(
const String & hits);
 
  149     const String & getCleavage();
 
  151     void setCleavage(
const String & cleavage);
 
  154     const String & getMassType();
 
  156     void setMassType(
const String & mass_type);
 
  159     const std::vector<String> & getModifications();
 
  161     void setModifications(
const std::vector<String> & mods);
 
  164     const std::vector<String> & getVariableModifications();
 
  166     void setVariableModifications(
const std::vector<String> & mods);
 
  169     const String & getInstrument();
 
  171     void setInstrument(
const String & instrument);
 
  174     UInt getMissedCleavages();
 
  176     void setMissedCleavages(
UInt missed_cleavages);
 
  179     Real getPrecursorMassTolerance();
 
  181     void setPrecursorMassTolerance(
Real precursor_mass_tolerance);
 
  184     Real getPeakMassTolerance();
 
  186     void setPeakMassTolerance(
Real ion_mass_tolerance);
 
  189     const String & getTaxonomy();
 
  191     void setTaxonomy(
const String & taxonomy);
 
  194     const String & getFormVersion();
 
  196     void setFormVersion(
const String & form_version);
 
  199     const String & getCharges();
 
  201     void setCharges(std::vector<Int> & charges);
 
  259     void writeParameterHeader_(
const String & name, FILE * fp, 
bool line_break = 
true);
 
  262     void writeHeader_(FILE * fp);
 
  265     void writeSpectrum_(FILE * fp,
 
  270     void writeMSExperiment_(FILE * fp,
 
  274     bool getNextSpectrum_(std::istream & is, std::vector<std::pair<double, double> > & spectrum, 
UInt & charge, 
double & precursor_mz, 
double & precursor_int, 
double & rt, 
String & title);
 
  279 #endif // OPENMS_FORMAT_MASCOTINFILE_H 
float Real
Real type. 
Definition: Types.h:109
A more convenient string class. 
Definition: String.h:56
String search_title_
the search title of the mascot search 
Definition: MascotInfile.h:211
DoubleReal retention_time_
the retention time 
Definition: MascotInfile.h:256
void load(const String &filename, MapType &exp)
Definition: MascotInfile.h:83
String mass_type_
Monoisotopic/average mass. 
Definition: MascotInfile.h:226
Peak2D PeakType
Definition: MassTrace.h:49
UInt missed_cleavages_
number of missed cleavages 
Definition: MascotInfile.h:238
Real ion_mass_tolerance_
m/z tolerance of ions in Da 
Definition: MascotInfile.h:244
File not found exception. 
Definition: Exception.h:524
String charges_
charge states to use 
Definition: MascotInfile.h:208
String taxonomy_
taxonomy 
Definition: MascotInfile.h:247
static bool exists(const String &file)
Method used to test if a file exists. 
String db_
the DB to search in 
Definition: MascotInfile.h:214
String instrument_
the used instument 
Definition: MascotInfile.h:235
void setPosition(const PositionType &position)
Mutable access to the position. 
Definition: Peak2D.h:185
DoubleReal mz_
parent mass 
Definition: MascotInfile.h:205
Real precursor_mass_tolerance_
precursor mass toerance in Da 
Definition: MascotInfile.h:241
Representation of a mass spectrometry experiment. 
Definition: MSExperiment.h:68
String form_version_
form version 
Definition: MascotInfile.h:250
std::vector< String > variable_mods_
variable Modifications 
Definition: MascotInfile.h:232
std::vector< String > mods_
fixed Modifications 
Definition: MascotInfile.h:229
String search_type_
search type: MIS, SQ or PMF 
Definition: MascotInfile.h:217
Mascot input file adapter. 
Definition: MascotInfile.h:59
Base class for all classes that want to report their progess. 
Definition: ProgressLogger.h:56
String cleavage_
Enzyme used for cleavage. 
Definition: MascotInfile.h:223
String hits_
number of hits to report 
Definition: MascotInfile.h:220
String boundary_
the boundary used for the MIME format 
Definition: MascotInfile.h:253