86 string pep = msHits->GetPepstring();
90 int pos = (*iMod)->GetSite();
91 int num = (*iMod)->GetModtype();
97 double mass = aaMass + mdiff;
106 modaaMass->SetAttlist().SetPosition(pos+1);
107 modaaMass->SetAttlist().SetMass(mass);
115 modInfo->
SetAttlist().SetMod_nterm_mass(mass);
122 modInfo->
SetAttlist().SetMod_cterm_mass(mass);
136 for (
unsigned int i=0;
i<pep.length();
i++) {
141 if (it != modMap.
end()) {
142 modPep.append(it->second);
146 modaaMass->SetAttlist().SetPosition(
i+1);
148 modaaMass->SetAttlist().SetMass(staticMass);
157 CMSSearchSettings::TFixed::const_iterator iterF;
158 for (iterF = inOMSSA.
GetRequest().front()->GetSettings().GetFixed().begin();
159 iterF != inOMSSA.
GetRequest().front()->GetSettings().GetFixed().end(); ++iterF) {
183 if(!hasMod)
return null;
184 modInfo->
SetAttlist().SetModified_peptide(modPep);
193 if (
type % 2 == 0) {
199 aaMod->SetAttlist().SetAminoacid(aaStr);
202 double mass = aaMass + mdiff;
204 aaMod->SetAttlist().SetMass(mass);
206 aaMod->SetAttlist().SetVariable(
"N");
211 aaMod->SetAttlist().SetVariable(
"Y");
217 aaMod->SetAttlist().SetDescription(Modset->
GetUnimodName(modnum));
218 sSum->SetAminoacid_modification().push_back(aaMod);
225 termMod->SetAttlist().SetVariable(
"N");
227 termMod->SetAttlist().SetVariable(
"Y");
229 termMod->SetAttlist().SetDescription(Modset->
GetUnimodName(modnum));
232 termMod->SetAttlist().SetTerminus(
"n");
233 termMod->SetAttlist().SetProtein_terminus(
"Y");
237 termMod->SetAttlist().SetTerminus(
"n");
238 termMod->SetAttlist().SetProtein_terminus(
"N");
242 termMod->SetAttlist().SetTerminus(
"c");
243 termMod->SetAttlist().SetProtein_terminus(
"Y");
244 termMod->SetAttlist().SetMass(mass +
OH_MASS);
247 termMod->SetAttlist().SetTerminus(
"c");
248 termMod->SetAttlist().SetProtein_terminus(
"N");
249 termMod->SetAttlist().SetMass(mass +
OH_MASS);
252 sSum->SetTerminal_modification().push_back(termMod);
266 string specFile, startScan, stopScan, dtaCharge;
271 if (RxpLocus.
IsMatch(SpecID)) {
274 stopScan = startScan;
277 specFile = RxpParse.
GetMatch(SpecID, 0, 1);
278 if (specFile ==
"") {
281 startScan= RxpParse.
GetMatch(SpecID, 0, 2);
282 if (startScan ==
"") {
284 stopScan = startScan;
286 stopScan = RxpParse.
GetMatch(SpecID, 0, 3);
287 if (stopScan ==
"") {
288 stopScan = startScan;
293 sQuery->SetAttlist().SetSpectrum(specFile +
"." + startScan +
"." + stopScan +
"." + dtaCharge);
299 if (pHit->CanGetAccession()) {
300 return pHit->GetAccession();
301 }
else if (pHit->CanGetGi()) {
304 return pHit->GetDefline();
314 if (pHitSet->GetHits().empty())
317 CMSHitSet::THits::const_iterator iHit;
321 for(iHit = pHitSet->GetHits().begin(); iHit != pHitSet->GetHits().end(); iHit++) {
322 charges.
insert((*iHit)->GetCharge());
327 iHit = pHitSet->GetHits().begin();
328 int charge = (*iHit)->GetCharge();
331 while ( charge != *iCharge ) {
333 charge = (*iHit)->GetCharge();
338 if(!(pHitSet->GetIds().empty())) {
339 spectrumID = *(pHitSet->GetIds().begin());
343 ConvertScanID(sQuery, spectrumID, pHitSet->GetNumber(), charge);
346 double neutral_precursor_mass = (*iHit)->GetMass()/
m_scale;
347 sQuery->SetAttlist().SetPrecursor_neutral_mass(neutral_precursor_mass);
348 sQuery->SetAttlist().SetAssumed_charge(charge);
349 sQuery->SetAttlist().SetIndex(
m_index++);
354 CMSHits::TPephits::const_iterator iPephit;
357 for( ; iHit != pHitSet->GetHits().end(); iHit++) {
359 charge = (*iHit)->GetCharge();
360 if ( charge != *iCharge ) {
365 iPephit = (*iHit)->GetPephits().begin();
369 sHit->SetAttlist().SetHit_rank(hitRank);
371 sHit->SetAttlist().SetPeptide((*iHit)->GetPepstring());
372 if((*iHit)->CanGetPepstart())
373 sHit->SetAttlist().SetPeptide_prev_aa((*iHit)->GetPepstart());
374 if((*iHit)->CanGetPepstop())
375 sHit->SetAttlist().SetPeptide_next_aa((*iHit)->GetPepstop());
379 sHit->SetAttlist().SetNum_tot_proteins((*iHit)->GetPephits().size());
380 sHit->SetAttlist().SetNum_matched_ions((*iHit)->GetMzhits().size());
381 int tot_num_ions = ((*iHit)->GetPepstring().length()-1) * 2;
382 sHit->SetAttlist().SetTot_num_ions(tot_num_ions);
383 sHit->SetAttlist().SetCalc_neutral_pep_mass((*iHit)->GetTheomass()/
m_scale);
384 sHit->SetAttlist().SetMassdiff(
ConvertDouble(neutral_precursor_mass - ((*iHit)->GetTheomass())/
m_scale));
388 sHit->SetAttlist().SetProtein_descr((*iPephit)->GetDefline());
392 pValue->SetAttlist().SetName(
"pvalue");
393 pValue->SetAttlist().SetValue(
ConvertDouble((*iHit)->GetPvalue()));
395 eValue->SetAttlist().SetName(
"expect");
396 eValue->SetAttlist().SetValue(
ConvertDouble((*iHit)->GetEvalue()));
397 sHit->SetSearch_score().push_back(pValue);
398 sHit->SetSearch_score().push_back(eValue);
399 if ((*iHit)->CanGetScores()) {
402 score->SetAttlist().SetName((*iScore)->GetName());
403 score->SetAttlist().SetValue(
ConvertDouble((*iScore)->GetValue()));
404 sHit->SetSearch_score().push_back(score);
408 for (iPephit++ ; iPephit != (*iHit)->GetPephits().end(); iPephit++) {
411 altPro->SetAttlist().SetProtein_descr((*iPephit)->GetDefline());
414 sHit->SetAlternative_protein().push_back(altPro);
417 if (modInfo) sHit->SetModification_info(*modInfo);
419 sResult->SetSearch_hit().push_back(sHit);
421 sQuery->SetSearch_result().push_back(sResult);
422 sQueries.push_back(sQuery);
429 m_scale =
static_cast<float>(inOMSSA.
GetRequest().front()->GetSettings().GetScale());
432 for (
int modchar=0; modchar < 29; modchar++) {
446 rSum->SetAttlist().SetBase_name(
basename);
447 rSum->SetAttlist().SetRaw_data_type(
"raw");
448 rSum->SetAttlist().SetRaw_data(
".mzXML");
452 rSum->SetSample_enzyme().SetAttlist().SetName(enzymeName);
455 specificity->SetAttlist().SetCut(cleave->
GetCleaveAt());
467 cerr <<
"Hmm, a cleavage with no sense, how odd." << endl;
470 specificity->SetAttlist().SetNo_cut(
"P");
472 rSum->SetSample_enzyme().SetSpecificity().push_back(specificity);
477 sSum->SetAttlist().SetBase_name(
basename);
478 sSum->SetAttlist().SetSearch_engine(
"OMSSA");
479 sSum->SetAttlist().SetOut_data_type(
"n/a");
480 sSum->SetAttlist().SetOut_data(
"n/a");
484 switch (searchType) {
496 cerr <<
"Hmm, a typeless search, how odd." << endl;
503 switch (searchType) {
515 cerr <<
"Hmm, a typeless search, how odd." << endl;
519 sSum->SetAttlist().SetSearch_id(1);
522 sSum->SetSearch_database().SetAttlist().SetLocal_path(
dbname);
525 if(inOMSSA.
GetResponse().front()->IsSetBioseqs() && inOMSSA.
GetResponse().front()->GetBioseqs().Get().size() > 0)
526 dbtype = inOMSSA.
GetResponse().front()->GetBioseqs().Get().front()->GetSeq().GetInst().GetMol();
535 sSum->SetSearch_database().SetAttlist().SetSize_in_db_entries(inOMSSA.
GetResponse().front()->GetDbversion());
537 sSum->SetEnzymatic_search_constraint().SetAttlist().SetEnzyme(enzymeName);
538 sSum->SetEnzymatic_search_constraint().SetAttlist().SetMax_num_internal_cleavages(inOMSSA.
GetRequest().front()->GetSettings().GetMissedcleave());
539 sSum->SetEnzymatic_search_constraint().SetAttlist().SetMin_number_termini(cleave->
GetCleaveNum());
542 CMSSearchSettings::TFixed::const_iterator iterF;
543 for (iterF = inOMSSA.
GetRequest().front()->GetSettings().GetFixed().begin();
544 iterF != inOMSSA.
GetRequest().front()->GetSettings().GetFixed().end(); ++iterF) {
552 CMSSearchSettings::TVariable::const_iterator iterV;
553 for (iterV = inOMSSA.
GetRequest().front()->GetSettings().GetVariable().begin();
554 iterV != inOMSSA.
GetRequest().front()->GetSettings().GetVariable().end(); ++iterV) {
556 variableMods.
insert(*iterV);
560 CMSResponse::THitsets::const_iterator iHits;
562 for (iHits = inOMSSA.
GetResponse().front()->GetHitsets().begin();
563 iHits != inOMSSA.
GetResponse().front()->GetHitsets().end(); iHits++) {
565 ConvertMSHitSet(*iHits, rSum->SetSpectrum_query(), Modset, variableMods, inOMSSA);
572 rSum->SetSearch_summary().push_back(sSum);
char const *const kEnzymeNames[eMSEnzymes_max]
@MSEnzymes.hpp User-defined methods of the data storage class.
CAminoacid_modification –.
static CRef< CCleave > CleaveFactory(const EMSEnzymes enzyme)
Simple factory to return back object for enzyme.
bool GetCheckProline(void) const
Should we check for proline?
const string GetCleaveAt(void) const
What are the cleavage chars?
const char * GetCleaveSense(void) const
Should we check for proline?
int GetCleaveNum(void) const
Get the number of cleavage chars.
const char * GetUnimodName(int Mod) const
get unimod name
int GetModNumChars(int Mod) const
get the number of modification AA's
char GetModChar(int Mod, int Number) const
get modification AA's
EMSModType GetModType(int Mod) const
get modification type
int GetModMass(int Mod) const
get modification mass
TAminoAcidMassMap m_aaMassMap
CRef< CModification_info > ConvertModifications(CRef< CMSHits > msHits, CRef< CMSModSpecSet > Modset, set< int > &vModSet, CMSSearch &inOMSSA)
void ConvertModSetting(CRef< CSearch_summary > sSum, CRef< CMSModSpecSet > Modset, int modnum, bool fixed)
string ConvertDouble(double n)
string GetProteinName(CRef< CMSPepHit > pHit)
void ConvertFromOMSSA(CMSSearch &inOMSSA, CRef< CMSModSpecSet > Modset, string basename, string newname)
convert OMSSA to PepXML
pair< char, double > TAminoAcidMassPair
set< char > m_staticModSet
void ConvertMSHitSet(CRef< CMSHitSet > pHitSet, CMsms_run_summary::TSpectrum_query &sQueries, CRef< CMSModSpecSet > Modset, set< int > &variableMods, CMSSearch &inOMSSA)
void ConvertScanID(CRef< CSpectrum_query > sQuery, string SpecID, int query, int charge)
static SIZE_TYPE Convert(const CTempString &src, TCoding src_coding, TSeqPos pos, TSeqPos length, string &dst, TCoding dst_coding)
CTerminal_modification –.
container_type::iterator iterator
const_iterator end() const
iterator_bool insert(const value_type &val)
const_iterator find(const key_type &key) const
iterator_bool insert(const value_type &val)
std::ofstream out("events_result.xml")
main entry point for tests
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
bool IsMatch(CTempString str, TMatch flags=fMatch_default)
Check existence substring which match a specified pattern.
CTempString GetMatch(CTempString str, size_t offset=0, size_t idx=0, TMatch flags=fMatch_default, bool noreturn=false)
Get matching pattern and subpatterns.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define BEGIN_SCOPE(ns)
Define a new scope.
static string DoubleToString(double value, int precision=-1, TNumToStringFlags flags=0)
Convert double to string.
static int StringToInt(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to int.
static bool EndsWith(const CTempString str, const CTempString end, ECase use_case=eCase)
Check if a string ends with a specified suffix value.
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
static enable_if< is_arithmetic< TNumeric >::value||is_convertible< TNumeric, Int8 >::value, string >::type NumericToString(TNumeric value, TNumToStringFlags flags=0, int base=10)
Convert numeric value to string.
static void SetFormat(const CTimeFormat &fmt)
Set the current time format.
string AsString(const CTimeFormat &format=kEmptyStr, TSeconds out_tz=eCurrentTimeZone) const
Transform time to string.
@ eCurrent
Use current time. See also CCurrentTime.
list< CRef< CMSScoreSet > > TScores
const TRequest & GetRequest(void) const
Get the Request member data.
EMSSearchType
what type of atomic mass to use
list< CRef< CMSModHit > > TMods
const TResponse & GetResponse(void) const
Get the Response member data.
EMSModType
enumerate modification types
EMSEnzymes
enumerate enzymes
@ eMSSearchType_multiisotope
@ eMSSearchType_monoisotopic
@ eMSModType_modn
at the N terminus of a protein
@ eMSModType_modc
at the C terminus of a protein
@ eMSModType_modnpaa
at the N terminus of a peptide at particular amino acids
@ eMSModType_modcpaa
at the C terminus of a peptide at particular amino acids
@ eMSModType_modnp
at the N terminus of a peptide
@ eMSModType_modaa
at particular amino acids
@ eMSModType_modcaa
at the C terminus of a protein at particular amino acids
@ eMSModType_modcp
at the C terminus of a peptide
@ eMSModType_modnaa
at the N terminus of a protein at particular amino acids
TAttlist & SetAttlist(void)
Assign a value to Attlist data member.
TMod_aminoacid_mass & SetMod_aminoacid_mass(void)
Assign a value to Mod_aminoacid_mass data member.
void SetDate(const TDate &value)
Assign a value to Date data member.
void SetAttlist(TAttlist &value)
Assign a value to Attlist data member.
void SetSummary_xml(const TSummary_xml &value)
Assign a value to Summary_xml data member.
list< CRef< CSpectrum_query > > TSpectrum_query
TMsms_run_summary & SetMsms_run_summary(void)
Assign a value to Msms_run_summary data member.
@ eAttlist_fragment_mass_type_average
@ eAttlist_fragment_mass_type_monoisotopic
@ eAttlist_precursor_mass_type_average
@ eAttlist_precursor_mass_type_monoisotopic
char * dbname(DBPROCESS *dbproc)
Get name of current database.
std::istream & in(std::istream &in_, double &x_)
const double HYDROGEN_MASS
map< int, string > TAAModMap
pair< int, string > TAAModPair
C++ wrappers for the Perl-compatible regular expression (PCRE) library.