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

Method store

src/openms/source/FORMAT/SequestInfile.cpp:159–349  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

157 }
158
159 void
160 SequestInfile::store(
161 const String & filename)
162 {
163 ofstream ofs(filename.c_str());
164 if (!ofs)
165 {
166 throw Exception::UnableToCreateFile(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, filename);
167 }
168 stringstream file_content;
169
170 float dyn_n_term_mod(0.0), dyn_c_term_mod(0.0), stat_n_term_mod(0.0), stat_c_term_mod(0.0), stat_n_term_prot_mod(0.0), stat_c_term_prot_mod(0.0);
171
172 map<char, float> stat_mods, dyn_mods;
173 map<char, float> * mods_p = nullptr;
174
175 // compute the masses for the amino acids, divided into fixed and optional modifications
176 float mass(0.0);
177 String residues, dyn_mods_string;
178 for (map<String, vector<String> >::const_iterator mods_i = PTMname_residues_mass_type_.begin(); mods_i != PTMname_residues_mass_type_.end(); ++mods_i)
179 {
180 if (mods_i->second[0] == "CTERM")
181 {
182 if (mods_i->second[2] == "OPT")
183 {
184 dyn_c_term_mod += mods_i->second[1].toFloat();
185 }
186 if (mods_i->second[2] == "FIX")
187 {
188 stat_c_term_mod += mods_i->second[1].toFloat();
189 }
190 }
191 else if (mods_i->second[0] == "NTERM")
192 {
193 if (mods_i->second[2] == "OPT")
194 {
195 dyn_n_term_mod += mods_i->second[1].toFloat();
196 }
197 if (mods_i->second[2] == "FIX")
198 {
199 stat_n_term_mod += mods_i->second[1].toFloat();
200 }
201 }
202 else if (mods_i->second[0] == "CTERM_PROT")
203 {
204 stat_c_term_prot_mod += mods_i->second[1].toFloat();
205 }
206 else if (mods_i->second[0] == "NTERM_PROT")
207 {
208 stat_n_term_prot_mod += mods_i->second[1].toFloat();
209 }
210 else
211 {
212 if (mods_i->second[2] == "FIX")
213 {
214 mods_p = &stat_mods;
215 }
216 else

Callers

nothing calls this directly

Calls 9

toFloatMethod · 0.80
StringClass · 0.50
beginMethod · 0.45
endMethod · 0.45
appendMethod · 0.45
emptyMethod · 0.45
eraseMethod · 0.45
closeMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected