Class for holding a list of ms_fragment objects. More...
#include <ms_fragmentvector.hpp>
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_fragment * | getFragmentByNumber (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_fragmentvector & | operator= (const ms_fragmentvector &right) |
C++ style assignment operator. | |
Static Public Member Functions | |
static void | getMassesWithinTolerance (const double &fragmentMass, const double &fragmentToleranceValue, const TOLERANCE_UNIT &fragmentToleranceUnit, double &minMass, double &maxMass) |
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.
enum MATCH_PEAKS |
Flags for matching experimental peaks to calculated peaks.
Used as flags for addExperimentalData() when passing a ms_mascotresfile object.
See Using enumerated values and static const ints in Perl, Java, Python and C#.
Default constructor.
Create a default empty list of fragments.
ms_fragmentvector | ( | const ms_fragmentvector & | src ) |
Copying constructor.
src | is the original list to base the new list on. |
~ms_fragmentvector | ( | ) | [virtual] |
Destructor.
No need to call this directly. Frees the list of fragments.
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().
peakList | will 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(). |
numPeaks | is 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(). |
tolerance | is the tolerance to be used for matching the ions. This can be found from ms_searchparams::getITOL(). |
toleranceUnits | must be "Da", "mmu" or "ppm". This can be found from ms_searchparams::getITOLU(). |
updateMatchList | should 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. |
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.
resfile | is 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. |
query | is the query number in the range 1..ms_mascotresfile::getNumQueries(). |
flags | is a MATCH_PEAKS value. Currently only MATCH_MOST_INTENSE_PEAK is supported. |
peaksUsedFromIons1 | is 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(). |
peaksUsedFromIons2 | is 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(). |
peaksUsedFromIons3 | is 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(). |
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.
item | is a new item to add to the list. |
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.
right | const pointer to a valid ms_fragmentvector object |
const ms_fragment * getFragmentByNumber | ( | const unsigned int | numFrag ) | const |
Return a fragment object by its number.
numFrag | is the fragment to return. This must be in the range 0 to getNumberOfFragments() -1. |
void getMassesWithinTolerance | ( | const double & | fragmentMass, |
const double & | fragmentToleranceValue, | ||
const TOLERANCE_UNIT & | fragmentToleranceUnit, | ||
double & | minMass, | ||
double & | maxMass | ||
) | [static] |
[in] | fragmentMass | is the mass of the fragment |
[in] | fragmentToleranceValue | the tolerance in the units specified by fragmentToleranceUnit |
[in] | fragmentToleranceUnit | any of the four ms_fragmentvector::TOLERANCE_UNIT values |
[out] | minMass | Used to return the minimum mass in the range |
[out] | maxMass | Used to return the maximum mass in the range |
int getNumberOfFragments | ( | ) | const |
Returns a number of fragments currently held in the vector.
const ms_fragmentvector::frag_vector * getVector | ( | ) | const |
Return a const pointer to the STL vector of ms_fragment objects.
ms_fragmentvector::frag_vector * getVector | ( | ) |
Return a pointer to the STL vector of ms_fragment objects.
This class is just a wrapper for std::vector<ms_fragment> so it possible to get a pointer to the STL vector if required.
ms_fragmentvector & operator= | ( | const ms_fragmentvector & | right ) |
C++ style assignment operator.
right | is the original list to copy to the new list. |
Copyright © 2022 Matrix Science Ltd. All Rights Reserved. Generated on Thu Mar 31 2022 01:12:32 |