Matrix Science header
Public Types | Public Member Functions

ms_fragmentvector Class Reference
[Classes for calculating masses of peptides and fragments.]

Class for holding a list of ms_fragment objects. More...

#include <ms_fragmentvector.hpp>

List of all members.

Public Types

enum  MATCH_PEAKS {
  MATCH_MOST_INTENSE_PEAK = 0x0000,
  MATCH_CLOSEST_PEAK = 0x0001
}
 

Flags for matching experimental peaks to calculated peaks.

More...

Public Member Functions

 ms_fragmentvector ()
 Default constructor.
 ms_fragmentvector (const ms_fragmentvector &src)
 Copying constructor.
virtual ~ms_fragmentvector ()
 Destructor.
bool addExperimentalData (const ms_mascotresfile *resfile, const int query, const int flags=MATCH_MOST_INTENSE_PEAK, const int peaksUsedFromIons1=-1, const int peaksUsedFromIons2=-1, const int peaksUsedFromIons3=-1)
 Find matches to peaks lists from a Mascot results file.
bool addExperimentalData (const std::string &peakList, const int numPeaks, const double tolerance, const std::string &toleranceUnits, const bool updateMatchList=true)
 Find matches to peak list.
bool addExperimentalData (const peaklist_t &peakList, const double tolerance, const std::string &toleranceUnits, const bool updateMatchList=true)
 Find matches to peak list.
void appendFragment (const ms_fragment *item)
 Adds a new fragment to the end of the vector.
void clearFragments ()
 Deletes all fragments from the vector.
void copyFrom (const ms_fragmentvector *right)
 Copies all content from another instance.
const ms_fragmentgetFragmentByNumber (const unsigned int numFrag) const
 Return a fragment object by its number.
int getNumberOfFragments () const
 Returns a number of fragments currently held in the vector.
const frag_vector * getVector () const
 Return a const pointer to the STL vector of ms_fragment objects.
frag_vector * getVector ()
 Return a pointer to the STL vector of ms_fragment objects.
ms_fragmentvectoroperator= (const ms_fragmentvector &right)
 C++ style assignment operator.

Detailed Description

Class for holding a list of ms_fragment objects.

This class is necessary when using Mascot Parser from programming language other than C++. It is used when calling ms_aahelper::calcFragments().

C++ users will generally just want to use a std::vector<ms_fragment> as it is easier.

Examples:

tools_aahelper.cpp.


Member Enumeration Documentation

Flags for matching experimental peaks to calculated peaks.

Used as flags for addExperimentalData() when passing a ms_mascotresfile object.

See Using enumerated values in Perl, Java, Python and C#.

Enumerator:
MATCH_MOST_INTENSE_PEAK 

Match the most intense peak in the region.

MATCH_CLOSEST_PEAK 

Match the peak with the closest m/z value (not currently supported).


Constructor & Destructor Documentation

Default constructor.

Create a default empty list of fragments.

Copying constructor.

Note:
This constructor can only be used from C++. Use copyFrom() from other programming languages.
Parameters:
srcis the original list to base the new list on.
~ms_fragmentvector (  ) [virtual]

Destructor.

No need to call this directly. Frees the list of fragments.


Member Function Documentation

bool addExperimentalData ( const std::string &  peakList,
const int  numPeaks,
const double  tolerance,
const std::string &  toleranceUnits,
const bool  updateMatchList = true 
)

Find matches to peak list.

This function matches the peakList to the calculated fragment matches. To find which peaks are matched, use ms_fragment::getMatchedIonMass() and ms_fragment::getMatchedIonIntensity().

Parameters:
peakListwill be of the form 136.070000:42.95,175.110000:133.1, 299.060000:710.1,415.030000:144.6 . and may be retrieved using ms_inputquery::getStringIons1().
numPeaksis the number of peaks to be used from the list. If this is -1, then all peaks are used. To only match peaks used for matching by the search engine, pass ms_peptide::getPeaksUsedFromIons1().
toleranceis the tolerance to be used for matching the ions. This can be found from ms_searchparams::getITOL().
toleranceUnitsmust be "Da", "mmu" or "ppm". This can be found from ms_searchparams::getITOLU().
updateMatchListshould be set to true if you want to recalculate the list of matches. If this function is to be called multiple times, then set it to false except for the last call.
Returns:
indicates if the function was successful. It will only fail if toleranceUnits are invalid.
bool addExperimentalData ( const ms_mascotresfile resfile,
const int  query,
const int  flags = MATCH_MOST_INTENSE_PEAK,
const int  peaksUsedFromIons1 = -1,
const int  peaksUsedFromIons2 = -1,
const int  peaksUsedFromIons3 = -1 
)

Find matches to peaks lists from a Mascot results file.

This function matches experimental data to the calculated fragment matches. To find which peaks are matched, use ms_fragment::getMatchedIonMass() and ms_fragment::getMatchedIonIntensity(). The peak list is extracted from the results file using the query number specified.

Parameters:
resfileis the Mascot results file from which the fragments were initially calculated. The results file is used to find the peak list and the tolerances to be used for matching.
queryis the query number in the range 1..ms_mascotresfile::getNumQueries().
flagsis a MATCH_PEAKS value. Currently only MATCH_MOST_INTENSE_PEAK is supported.
peaksUsedFromIons1is the number of peaks from the peak list in the passed the results file to be used for matching. Use -1 to indicate all peaks. See also ms_peptide::getPeaksUsedFromIons1() and ms_inputquery::getStringIons1().
peaksUsedFromIons2is the number of peaks from the peak list in the passed the results file to be used for matching. Use -1 to indicate all peaks. See also ms_peptide::getPeaksUsedFromIons2() and ms_inputquery::getStringIons2().
peaksUsedFromIons3is the number of peaks from the peak list in the passed the results file to be used for matching. Use -1 to indicate all peaks. See also ms_peptide::getPeaksUsedFromIons3() and ms_inputquery::getStringIons3().
Returns:
indicates if the function was successful. It will only fail if the results file is invalid or if the query number is invalid.
void appendFragment ( const ms_fragment item )

Adds a new fragment to the end of the vector.

A copy of the ms_fragment is made and added to the list, so there is no requirement to keep the original in memory.

Parameters:
itemis a new item to add to the list.
Examples:
tools_aahelper.cpp.
void clearFragments (  )

Deletes all fragments from the vector.

After calling this, getNumberOfFragments() will return 0.

void copyFrom ( const ms_fragmentvector right )

Copies all content from another instance.

Copy everything from right onto this fragment object.

Parameters:
rightconst pointer to a valid ms_fragmentvector object
Examples:
tools_aahelper.cpp.
const ms_fragment * getFragmentByNumber ( const unsigned int  numFrag ) const

Return a fragment object by its number.

Parameters:
numFragis the fragment to return. This must be in the range 0 to getNumberOfFragments().
Returns:
A pointer to the ms_fragment object. See Maintaining object references: two rules of thumb.
Examples:
tools_aahelper.cpp.
int getNumberOfFragments (  ) const

Returns a number of fragments currently held in the vector.

See also:
getFragmentByNumber().
Returns:
number of fragments
Examples:
tools_aahelper.cpp.
const ms_fragmentvector::frag_vector * getVector (  ) const

Return a const pointer to the STL vector of ms_fragment objects.

See also:
getVector()
Returns:
A pointer to the STL vector.
ms_fragmentvector::frag_vector * getVector (  )

Return a pointer to the STL vector of ms_fragment objects.

Note:
This function would only ever be of use in C++.

This class is just a wrapper for std::vector<ms_fragment> so it possible to get a pointer to the STL vector if required.

Returns:
A pointer to the STL vector.
ms_fragmentvector & operator= ( const ms_fragmentvector right )

C++ style assignment operator.

Parameters:
rightis the original list to copy to the new list.
Returns:
reference to the current object

The documentation for this class was generated from the following files:
Copyright © 2016 Matrix Science Ltd.  All Rights Reserved. Generated on Fri Jun 2 2017 01:44:52