Show the list of peptides in a table - for use as a CGI application.
#include "msparser.hpp"
#include <set>
#include <iostream>
#include <time.h>
#include <iomanip>
using namespace matrix_science;
int main(int argc, char * argv[])
{
#ifdef _DEBUG
putenv("QUERY_STRING=file=../data/20021123/F018521.dat");
#endif
std::cout << "Content-type: text/html" << std::endl << std::endl;
std::cout << "<HTML>" << std::endl;
std::cout << "<HEAD>" << std::endl;
std::cout << " <TITLE>Mascot summary</TITLE>" << std::endl;
std::cout << "</HEAD>" << std::endl;
std::cout << "<BODY BGCOLOR=\"#ffffff\">" << std::endl;;
if (getenv("QUERY_STRING") && strncmp(getenv("QUERY_STRING"), "file=", 5) == 0)
{
ms_mascotresfilebase file = ms_mascotresfilebase::createResfile(getenv(
"QUERY_STRING")+strlen(
"file="));
{
{
ms_mascotresults::MSRES_GROUP_PROTEINS |
ms_mascotresults::MSRES_SHOW_SUBSETS,
0,
1000,
0,
0);
if (!prot)
std::cout << "No significant matches" << std::endl;
else
{
std::set<std::string> pep_strings;
std::cout << "<TABLE BORDER=1>" << std::endl;
std::cout << " <TR>" << std::endl;
std::cout << " <TD><B>Peptide</B></TD>" << std::endl
<< " <TD><B>Score</B></TD>" << std::endl
<< " <TD><B>Query</B></TD>" << std::endl
<< " <TD><B>Rank</B></TD>" << std::endl
<< " <TD><B>Proteins</B></TD>" << std::endl;
std::cout << " </TR>" << std::endl;
{
for (int p=1; p <= 10; p++)
{
{
{
std::cout << " <TR>" << std::endl;
std::cout << " <TD>"
<< " </TD>"
<< std::endl;
std::cout << " <TD>"
<< " </TD>"
<< std::endl;
std::cout << " <TD>" << query << " </TD>" << std::endl;
std::cout << " <TD>" << p << " </TD>" << std::endl;
std::cout << " <TD>"
<< " </TD>"
<< std::endl;
std::cout << " </TR>" << std::endl;
}
}
}
}
std::cout << "</TABLE>" << std::endl;
}
{
std::cout << "There was an error..." << std::endl;
}
}
}
else
}
else
std::cout << "Must supply 'file=[name of a .dat file]'"
<< "Number of args = " << argc
<< "QS=" << getenv("QUERY_STRING")
<<std::endl;
std::cout << "</BODY>" << std::endl;;
std::cout << "</HTML>" << std::endl;;
return 0;
}
bool isValid() const
Call this function to determine if there have been any errors.
Definition: ms_errors.cpp:1472
Abstract base class of ms_mascotresfile_dat and ms_mascotresfile_msr.
Definition: ms_mascotresfilebase.hpp:72
std::string getLastErrorString() const
Return the last error number - or an empty string.
Definition: ms_mascotresfilebase.cpp:824
int getLastError() const
Return the last error number - or ms_erros::ERR_NO_ERROR.
Definition: ms_mascotresfilebase.cpp:786
virtual bool isMSMS() const =0
Returns true if the search was an MSMS search (SEARCH=MIS).
virtual int getNumQueries(const int resfileID=0) const =0
Returns the number of queries (peptide masses or ms-ms spectra).
Abstract class for either ms_peptidesummary or ms_proteinsummary.
Definition: ms_mascotresults.hpp:83
virtual int getPeptideIdentityThreshold(const int query, double OneInXprobRnd, DB_MATCH_TYPE dbType=DM_FASTA) const
Return the threshold value for this ms-ms data being a random match.
Definition: ms_mascotresults.cpp:605
virtual ms_peptide getPeptide(const int q, const int p) const =0
Return the ms_peptide object given the query and either the rank (ms_peptidesummary) or the hit (ms_p...
virtual ms_protein * getHit(const int hit, const int memberNumber=0) const
Return the ms_protein hit - returns null if hit > number of hits.
Definition: ms_mascotresults.cpp:1030
virtual std::string getProteinsWithThisPepMatch(const int q, const int p, const bool quotes=false)=0
Return a partial list of proteins that matched the same peptide.
This class encapsulates a peptide from the mascot results file.
Definition: ms_peptide.hpp:57
double getIonsScore() const
Returns the ions score.
Definition: ms_peptide.cpp:1050
std::string getPeptideStr(bool substituteAmbiguous=true, const PSM psmComponent=PSM_COMPLETE) const
Returns the sequence found for the peptide.
Definition: ms_peptide.cpp:710
Use this class to get peptide summary results.
Definition: ms_peptidesummary.hpp:51
This class encapsulates a protein in the mascot results file.
Definition: ms_protein.hpp:57