Loading...
Searching...
No Matches
pappso::cbor::mzcbor::SelectedIon Struct Reference

`#include <precursor.h>`

## Public Member Functions

void | fromCbor (CborStreamReader &reader)
int | getChargeState () const
double | getIntensity (bool *isok) const
double | getMz () const

## Public Attributes

CvParamMap | cvParamMap

## Detailed Description

Definition at line 69 of file precursor.h.

## Member Function Documentation

## fromCbor()

void pappso::cbor::mzcbor::SelectedIon::fromCbor | ( | CborStreamReader & | reader | ) |

Definition at line 134 of file precursor.cpp.

{
QString txt_value;
reader.enterContainer();
qDebug() << txt_value;
while(reader.hasNext() && (!reader.isInvalid()))
{
if(reader.isString())
{
if(reader.decodeString(txt_value))
{
qDebug() << txt_value;
if(txt_value == "cvParam")
{
cvParamMap.fromCbor(reader);
// reader.next();
}
else
{
reader.next();
}
}
else
{
reader.next();
}
}
else
{
reader.next();
}
}
reader.leaveContainer();
}
pappso::cbor::mzcbor::SelectedIon::cvParamMap
CvParamMap cvParamMap
Definition precursor.h:77

References cvParamMap, and pappso::cbor::CborStreamReader::decodeString().

Referenced by pappso::cbor::mzcbor::Precursor::fromCbor().

## getChargeState()

int pappso::cbor::mzcbor::SelectedIon::getChargeState | ( |  | ) | const

Definition at line 171 of file precursor.cpp.

{
// <cvParam cvRef="MS" accession="MS:1000041" value="3" name="charge state" />
auto it = cvParamMap.find("MS:1000041");
if(it == cvParamMap.end())
{
throw pappso::ExceptionNotFound(
QObject::tr("Charge state not found in SelectedIon cvParam map"));
}
qDebug() << it->first << " " << it->second.valueInt;
return it->second.valueInt;
}

References cvParamMap.

## getIntensity()

double pappso::cbor::mzcbor::SelectedIon::getIntensity | ( | bool * | isok | ) | const

Definition at line 187 of file precursor.cpp.

{
// <cvParam cvRef="MS" accession="MS:1000042" value="248032.25" name="peak intensity"
// unitAccession="MS:1000131" unitName="number of detector counts" unitCvRef="MS" />
// MS:1000042
auto it = cvParamMap.find("MS:1000042");
if(it == cvParamMap.end())
{
// throw pappso::ExceptionNotFound(
// QObject::tr("Intensity not found in SelectedIon cvParam map"));
*isok = false;
return 0;
}
qDebug() << it->first << " " << it->second.valueDouble;
double intensity = it->second.valueDouble;
*isok = true;
if(std::isnan(intensity))
{
return it->second.valueInt;
}
return intensity;
}

References cvParamMap.

## getMz()

double pappso::cbor::mzcbor::SelectedIon::getMz | ( |  | ) | const

Definition at line 212 of file precursor.cpp.

{
// <cvParam cvRef="MS" accession="MS:1000744" value="506.2513" name="selected ion m/z"
// unitAccession="MS:1000040" unitName="m/z" unitCvRef="MS" />
auto it = cvParamMap.find("MS:1000744");
if(it == cvParamMap.end())
{
throw pappso::ExceptionNotFound(QObject::tr("m/z not found in SelectedIon cvParam map"));
}
qDebug() << it->first << " " << it->second.valueDouble;
return it->second.valueDouble;
}

References cvParamMap.

## Member Data Documentation

## cvParamMap

CvParamMap pappso::cbor::mzcbor::SelectedIon::cvParamMap

Definition at line 77 of file precursor.h.

Referenced by fromCbor(), getChargeState(), getIntensity(), and getMz().

The documentation for this struct was generated from the following files:

- pappsomspp/core/processing/cbor/mzcbor/precursor.h
- pappsomspp/core/processing/cbor/mzcbor/precursor.cpp