Skip to content

Commit

Permalink
corrected single filename use
Browse files Browse the repository at this point in the history
  • Loading branch information
Henric Zazzi committed Mar 18, 2014
1 parent d5f23cd commit 397d514
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
12 changes: 6 additions & 6 deletions xmlio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -204,7 +204,7 @@ MzIDIO::~MzIDIO() {
//------------------------------------------------------------------------------
PercolatorOutI::PercolatorOutI() {
filename="";
uniquemzidfilename="";
firstmzidfilename="";
decoy=false;
}
//------------------------------------------------------------------------------
Expand All @@ -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() {
Expand Down Expand Up @@ -288,7 +288,7 @@ string PercolatorOutI::convertPSMIDFileName(string percolatorid) {
string psmidfile;
int i1;

psmidfile=boost::lexical_cast<boost::filesystem::path>(uniquemzidfilename).stem().string();
psmidfile=boost::lexical_cast<boost::filesystem::path>(firstmzidfilename).stem().string();
i1=percolatorid.find(PERCOLATOR_PARAM::PSMID_START);
if (i1!=string::npos)
psmidfile=percolatorid.substr(0,i1);
Expand Down
6 changes: 3 additions & 3 deletions xmlio.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<PercolatorOutFeatures, string, PercolatorOutFeatures> pout_values);
bool saveMZIDFile(auto_ptr<mzidXML::MzIdentMLType> &pmzid, int mzidfilenameid);
Expand All @@ -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<PercolatorOutFeatures, string, PercolatorOutFeatures> &pout_values);
Expand Down

0 comments on commit 397d514

Please sign in to comment.