From 397d514f4c693c8c3500972e0ca16a39283ee549 Mon Sep 17 00:00:00 2001 From: Henric Zazzi Date: Tue, 18 Mar 2014 15:21:17 +0100 Subject: [PATCH] corrected single filename use --- main.cpp | 2 +- xmlio.cpp | 12 ++++++------ xmlio.h | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/main.cpp b/main.cpp index 3628583..d55f23c 100644 --- a/main.cpp +++ b/main.cpp @@ -73,7 +73,7 @@ int main(int argc, char **argv) { if (percolator.noFilename()) THROW_ERROR(PRINT_TEXT::PERCOLATOR_FILE_NOT_ENTERED); xercesc::XMLPlatformUtils::Initialize(); - percolator.setUniqueMzIDFilename(mzid.getUniqueFilename()); + percolator.setFirstMzIDFilename(mzid.getFirstFilename()); if (!percolator.getPoutValues(pout_values)) THROW_ERROR(PRINT_TEXT::CANNOT_LOAD_PERCOLATOR_FILE); if (!mzid.insertMZIDValues(pout_values)) diff --git a/xmlio.cpp b/xmlio.cpp index 1c77806..da0bc8e 100644 --- a/xmlio.cpp +++ b/xmlio.cpp @@ -99,8 +99,8 @@ bool MzIDIO::checkFilenames() { return b1 || warning; } //------------------------------------------------------------------------------ -string MzIDIO::getUniqueFilename() { - return filename.size()==1?filename[0]:""; +string MzIDIO::getFirstFilename() { + return filename[0]; } //------------------------------------------------------------------------------ string MzIDIO::setOutputFileName(int mzidfilenameid) { @@ -204,7 +204,7 @@ MzIDIO::~MzIDIO() { //------------------------------------------------------------------------------ PercolatorOutI::PercolatorOutI() { filename=""; - uniquemzidfilename=""; + firstmzidfilename=""; decoy=false; } //------------------------------------------------------------------------------ @@ -213,8 +213,8 @@ bool PercolatorOutI::setFilename(string filename) { return boost::filesystem::exists(filename.c_str()); } //------------------------------------------------------------------------------ -void PercolatorOutI::setUniqueMzIDFilename(string filename) { - uniquemzidfilename=filename; +void PercolatorOutI::setFirstMzIDFilename(string filename) { + firstmzidfilename=filename; } //------------------------------------------------------------------------------ bool PercolatorOutI::noFilename() { @@ -288,7 +288,7 @@ string PercolatorOutI::convertPSMIDFileName(string percolatorid) { string psmidfile; int i1; - psmidfile=boost::lexical_cast(uniquemzidfilename).stem().string(); + psmidfile=boost::lexical_cast(firstmzidfilename).stem().string(); i1=percolatorid.find(PERCOLATOR_PARAM::PSMID_START); if (i1!=string::npos) psmidfile=percolatorid.substr(0,i1); diff --git a/xmlio.h b/xmlio.h index f25c8dc..4bd7921 100644 --- a/xmlio.h +++ b/xmlio.h @@ -100,7 +100,7 @@ class MzIDIO : public XMLIO { void setFilename(string filename); bool addFilenames(string filenamefile); bool checkFilenames(); - string getUniqueFilename(); + string getFirstFilename(); string setOutputFileName(int mzidfilenameid); bool insertMZIDValues(boost::unordered_map pout_values); bool saveMZIDFile(auto_ptr &pmzid, int mzidfilenameid); @@ -109,13 +109,13 @@ class MzIDIO : public XMLIO { //------------------------------------------------------------------------------ class PercolatorOutI : public XMLIO { private: - string filename,uniquemzidfilename; + string filename,firstmzidfilename; bool decoy; public: PercolatorOutI(); bool setFilename(string filename); - void setUniqueMzIDFilename(string filename); + void setFirstMzIDFilename(string filename); bool noFilename(); void setDecoy(); bool getPoutValues(boost::unordered_map &pout_values);