Matrix Science Mascot Parser toolkit
 
Loading...
Searching...
No Matches
resfile_params.cpp

Example program for retrieving search parameter data.

/*
##############################################################################
# file: resfile_params.cpp #
# 'msparser' toolkit example code #
##############################################################################
# COPYRIGHT NOTICE #
# Copyright 1998-2005 Matrix Science Limited All Rights Reserved. #
# #
##############################################################################
# $Source: parser/examples/test_cxx/resfile_params.cpp $ #
# $Author: robertog@matrixscience.com $ #
# $Date: 2024-09-04 10:23:46 +0100 $ #
# $Revision: 526921a73137894bb1eae0b0fc8ccb4bb52ea662 | MSPARSER_REL_3_0_0-2024-09-24-0-g93ebaeb4f4 $ #
# $NoKeywords:: $ #
##############################################################################
*/
#include "msparser.hpp"
#include <iostream>
#include <iomanip>
// All the classes are part of the matrix_science namespace
using namespace matrix_science;
/*****************************************************************************/
/* Local functions */
/* (This test harness is 'C' and not C++) */
/*****************************************************************************/
static void searchParameters(ms_mascotresfilebase & file);
/*****************************************************************************/
/* main */
/* Call this program with a single argument - the name of the .dat file */
/*****************************************************************************/
int main(int argc, char * argv[])
{
if (argc == 2)
{
ms_mascotresfilebase file = ms_mascotresfilebase::createResfile(argv[1]);
if (file.isValid())
{
searchParameters(file);
}
else
std::cout << "Error: " << file.getLastErrorString() << std::endl;
}
else
std::cout << "Must supply the name of a .dat file as a command line argument" << std::endl;
return 0;
}
/*****************************************************************************/
/* searchParameters */
/* Display parameters from the ms_searchparams object. */
/* The values come from the parameters and the masses sections of the file */
/*****************************************************************************/
static void searchParameters(ms_mascotresfilebase & file)
{
ms_searchparams p(file);
std::cout << "Search parameters from ms_searchparams" << std::endl;
std::cout << "=========================================" << std::endl;
std::cout << "License : " << p.getLICENSE() << std::endl;
std::cout << "Search title : " << p.getCOM() << std::endl;
std::cout << "SEG mass : " << p.getSEG() << std::endl;
std::cout << "Peptide tol : " << p.getTOL() << std::endl;
std::cout << "Peptide tol units : " << p.getTOLU() << std::endl;
std::cout << "Fragment tol : " << p.getITOL() << std::endl;
std::cout << "Fragment tol units : " << p.getITOLU() << std::endl;
std::cout << "Missed cleavages : " << p.getPFA() << std::endl;
std::cout << "Database : " << p.getDB() << std::endl;
std::cout << "Static mods : " << p.getMODS() << std::endl;
std::cout << "Average/monoisotopic: " << p.getMASS() << std::endl;
std::cout << "Enzyme : " << p.getCLE() << std::endl;
std::cout << "Raw data file name : " << p.getFILENAME() << std::endl;
std::cout << "Input data : " << p.getQUE() << std::endl;
std::cout << "Type of search : " << p.getSEARCH() << std::endl;
std::cout << "User name : " << p.getUSERNAME() << std::endl;
std::cout << "User email : " << p.getUSEREMAIL() << std::endl;
std::cout << "Charge state : " << p.getCHARGE() << std::endl;
std::cout << "Repeat search file : " << p.getINTERMEDIATE() << std::endl;
std::cout << "Num hits to display : " << p.getREPORT() << std::endl;
std::cout << "Show overview : " << p.getOVERVIEW() << std::endl;
std::cout << "Data file format : " << p.getFORMAT() << std::endl;
std::cout << "Form version : " << p.getFORMVER() << std::endl;
std::cout << "Variable mods : " << p.getIT_MODS() << std::endl;
for (int u=0; u <=12; u++)
std::cout << "User"
<< std::setw(2) << std::setfill('0') << u
<< " : " << p.getUSERField(u) << std::endl;
std::cout << "Precursor mass : " << p.getPRECURSOR() << std::endl;
std::cout << "Taxonomy filter : " << p.getTAXONOMY() << std::endl;
std::cout << "Type of report : " << p.getREPTYPE() << std::endl;
std::cout << "Accessions to search: " << p.getACCESSION() << std::endl;
std::cout << "Subcluster used : " << p.getSUBCLUSTER() << std::endl;
std::cout << "ICAT search? : " << p.getICAT() << std::endl;
std::cout << "Instrument type : " << p.getINSTRUMENT() << std::endl;
std::cout << "Error tolerant? : " << p.getERRORTOLERANT() << std::endl;
std::cout << "Rules (ions series) : " << p.getRULES() << std::endl;
std::cout << "Quantitation method : " << p.getQUANTITATION() << std::endl;
std::cout << "Peptide isotope err : " << p.getPEP_ISOTOPE_ERROR() << std::endl;
std::cout << "Decoy database : " << p.getDECOY() << std::endl;
for (char ch='A'; ch <= 'Z'; ch++)
{
std::cout << "Residue " << ch << " : "
<< p.getResidueMass(ch)
<< std::endl;
}
std::cout << "C terminus mass : " << p.getCTermMass() << std::endl;
std::cout << "N terminus mass : " << p.getNTermMass() << std::endl;
std::cout << "Mass of hydrogen : " << p.getHydrogenMass() << std::endl;
std::cout << "Mass of oxygen : " << p.getOxygenMass() << std::endl;
std::cout << "Mass of carbon : " << p.getCarbonMass() << std::endl;
std::cout << "Mass of nitrogen : " << p.getNitrogenMass() << std::endl;
std::cout << "Mass of electron : " << p.getElectronMass() << std::endl;
int i = 1;
while (p.getVarModsName(i).length())
{
std::cout << "Variable mod name : " << p.getVarModsName(i) << std::endl;
std::cout << "Variable mod delta : " << p.getVarModsDelta(i) << std::endl;
std::cout << "Variable mod neutral: " << p.getVarModsNeutralLoss(i)<< std::endl;
i++;
}
std::cout << std::endl << std::endl;
}
/*
will give the output:
Search parameters from ms_searchparams
=========================================
License :
Search title : A few peptides from an LCMS run
SEG mass : -1
Peptide tol : 2
Peptide tol units : Da
Fragment tol : 1
Fragment tol units : Da
Missed cleavages : 1
Database : MSDB
Static mods : Oxidation (M),SMA (K),SMA (N-term)
Average/monoisotopic: Monoisotopic
Enzyme : Trypsin
Raw data file name : U:\\Mascot test data\\TSQ\\dyckall_1.asc
Input data :
Type of search : MIS
User name : Cat R. Piller
User email : crp@brassica.com
Charge state : 2+
Repeat search file :
Num hits to display : 5
Show overview : 0
Data file format : Finnigan (.ASC)
Form version : 1.01
Variable mods :
User00 :
User01 :
User02 :
User03 :
User04 :
User05 :
User06 :
User07 :
User08 :
User09 :
User10 :
User11 :
User12 :
Precursor mass : 0
Taxonomy filter : All entries
Type of report : peptide
Accessions to search:
Subcluster used : -1
ICAT search? : 0
Instrument type : ESI-QUAD-TOF
Error tolerant? : 0
Rules (ions series) : 1,2,8,9,10,13,14,15
Quantitation method : ICAT
Peptide isotope err : 2
Decoy database : 1
Residue A : 71.0371
Residue B : 114.535
Residue C : 103.009
Residue D : 115.027
Residue E : 129.043
Residue F : 147.068
Residue G : 57.0215
Residue H : 137.059
Residue I : 113.084
Residue J : 0
Residue K : 255.158
Residue L : 113.084
Residue M : 147.035
Residue N : 114.043
Residue O : 0
Residue P : 97.0528
Residue Q : 128.059
Residue R : 156.101
Residue S : 87.032
Residue T : 101.048
Residue U : 0
Residue V : 99.0684
Residue W : 186.079
Residue X : 111
Residue Y : 163.063
Residue Z : 128.551
C terminus mass : 17.0027
N terminus mass : 128.071
Mass of hydrogen : 1.00783
Mass of oxygen : 15.9949
Mass of carbon : 12
Mass of nitrogen : 14.0031
Mass of electron : 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
This class encapsulates the search parameters in the Mascot results file.
Definition: ms_searchparams.hpp:47