From: <hen...@us...> - 2009-12-23 01:12:18
|
Revision: 4804 http://sashimi.svn.sourceforge.net/sashimi/?rev=4804&view=rev Author: henrylam Date: 2009-12-23 01:12:11 +0000 (Wed, 23 Dec 2009) Log Message: ----------- [SpectraST] Put DECOY or REV proteins at the back of the list in the Protein comment field Modified Paths: -------------- trunk/trans_proteomic_pipeline/src/Search/SpectraST/SpectraSTPepXMLLibImporter.cpp trunk/trans_proteomic_pipeline/src/Search/SpectraST/SpectraSTSpLibImporter.cpp Modified: trunk/trans_proteomic_pipeline/src/Search/SpectraST/SpectraSTPepXMLLibImporter.cpp =================================================================== --- trunk/trans_proteomic_pipeline/src/Search/SpectraST/SpectraSTPepXMLLibImporter.cpp 2009-12-21 19:52:02 UTC (rev 4803) +++ trunk/trans_proteomic_pipeline/src/Search/SpectraST/SpectraSTPepXMLLibImporter.cpp 2009-12-23 01:12:11 UTC (rev 4804) @@ -582,7 +582,7 @@ entry->setOneComment("Frag", fragType); } - stringstream proteinss; + string proteinss(""); unsigned int proteinCount = 0; if (r["protein"] != "_NOT_FOUND_") { string altProteins(r["protein"]); @@ -590,18 +590,26 @@ string::size_type divPos = 0; while (!((nextProtein = nextToken(altProteins, divPos, divPos, "$\r\n")).empty())) { - // TODO: FILTERING FROM SGD NAMES -- REMOVE LATER! - - // if (nextProtein[0] == 'Y' || nextProtein.substr(0, 7) == "DECOY_Y") { - proteinss << '/' << nextProtein; proteinCount++; divPos++; - // } + + if (proteinss.empty()) { + proteinss = nextProtein; + continue; + } + + if (nextProtein.compare(0, 5, "DECOY") == 0 || nextProtein.compare(0, 3, "REV") == 0 || nextProtein.compare(0, 3, "rev") == 0) { + proteinss = proteinss + "/" + nextProtein; + } else { + proteinss = nextProtein + "/" + proteinss; + } + } } + if (proteinCount > 0) { stringstream fullproteinss; - fullproteinss << proteinCount << proteinss.str(); + fullproteinss << proteinCount << "/" << proteinss; entry->setOneComment("Protein", fullproteinss.str()); } else { Modified: trunk/trans_proteomic_pipeline/src/Search/SpectraST/SpectraSTSpLibImporter.cpp =================================================================== --- trunk/trans_proteomic_pipeline/src/Search/SpectraST/SpectraSTSpLibImporter.cpp 2009-12-21 19:52:02 UTC (rev 4803) +++ trunk/trans_proteomic_pipeline/src/Search/SpectraST/SpectraSTSpLibImporter.cpp 2009-12-23 01:12:11 UTC (rev 4804) @@ -1441,10 +1441,24 @@ int highestNTT = -1; bool foundOrig = false; + string proteins(""); + string contexts(""); + for (vector<pair<string, string> >::iterator prot = found->second->begin(); prot != found->second->end(); prot++) { - protss << '/' << prot->first; - contextss << '/' << prot->second; + if (proteins.empty()) { + proteins = prot->first; + contexts = prot->second; + } else { + if (prot->first.compare(0, 5, "DECOY") == 0 || prot->first.compare(0, 3, "REV") == 0 || prot->first.compare(0, 3, "rev") == 0) { + proteins = proteins + "/" + prot->first; + contexts = contexts + "/" + prot->second; + } else { + proteins = prot->first + "/" + proteins; + contexts = prot->second + "/" + contexts; + } + } + if (origPrevAA == prot->second[3] && origNextAA == prot->second[5]) { foundOrig = true; if (origNTT > highestNTT) highestNTT = origNTT; @@ -1468,6 +1482,9 @@ } + protss << "/" << proteins; + contextss << "/" << contexts; + if (!foundOrig || highestNTT > origNTT) { entry->getPeptidePtr()->prevAA = bestPrevAA; entry->getPeptidePtr()->nextAA = bestNextAA; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |