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

`#include <precursor.h>`

## Public Member Functions

void | fromCbor (CborStreamReader &reader)
QJsonObject | toJsonObject () const
| write the structure to a JSON object
double | getTargetMz () const
| get isolation window target m/z given cvParam informations
double | getLowerMz () const
| compute isolation window lower m/z given cvParam informations
double | getUpperMz () const
| compute isolation window upper m/z given cvParam informations

## Public Attributes

CvParamMap | cvParamMap

## Detailed Description

Definition at line 41 of file precursor.h.

## Member Function Documentation

## fromCbor()

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

Definition at line 34 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::IsolationWindow::cvParamMap
CvParamMap cvParamMap
Definition precursor.h:66

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

## getLowerMz()

double pappso::cbor::mzcbor::IsolationWindow::getLowerMz | ( |  | ) | const

compute isolation window lower m/z given cvParam informations

Definition at line 84 of file precursor.cpp.

{
double mz = getTargetMz();
auto it = cvParamMap.find("MS:1000828");
if(it == cvParamMap.end())
{
throw pappso::ExceptionNotFound(
QObject::tr("isolation window lower offset MS:1000828 not found in cvParam map"));
}
return mz - it->second.valueDouble;
}
pappso::Enums::PrecisionUnit::mz
@ mz
Definition types.h:101
pappso::cbor::mzcbor::IsolationWindow::getTargetMz
double getTargetMz() const
get isolation window target m/z given cvParam informations
Definition precursor.cpp:70

References cvParamMap, and getTargetMz().

## getTargetMz()

double pappso::cbor::mzcbor::IsolationWindow::getTargetMz | ( |  | ) | const

get isolation window target m/z given cvParam informations

Definition at line 70 of file precursor.cpp.

{
auto it = cvParamMap.find("MS:1000827");
if(it == cvParamMap.end())
{
throw pappso::ExceptionNotFound(
QObject::tr("isolation window target m/z MS:1000827 not found in cvParam map"));
}
return it->second.valueDouble;
}

References cvParamMap.

Referenced by getLowerMz(), and getUpperMz().

## getUpperMz()

double pappso::cbor::mzcbor::IsolationWindow::getUpperMz | ( |  | ) | const

compute isolation window upper m/z given cvParam informations

Definition at line 117 of file precursor.cpp.

{
double mz = getTargetMz();
auto it = cvParamMap.find("MS:1000829");
if(it == cvParamMap.end())
{
throw pappso::ExceptionNotFound(
QObject::tr("isolation window upper offset MS:1000829 not found in cvParam map"));
}
return mz + it->second.valueDouble;
}

References cvParamMap, and getTargetMz().

## toJsonObject()

QJsonObject pappso::cbor::mzcbor::IsolationWindow::toJsonObject | ( |  | ) | const

write the structure to a JSON object

Returns
  QJsonObject

Definition at line 100 of file precursor.cpp.

{
QJsonObject isolationWindow;
isolationWindow.insert("cvParam", cvParamMap.toJsonArray());
return isolationWindow;
}

References cvParamMap.

## Member Data Documentation

## cvParamMap

CvParamMap pappso::cbor::mzcbor::IsolationWindow::cvParamMap

Definition at line 66 of file precursor.h.

Referenced by fromCbor(), getLowerMz(), getTargetMz(), getUpperMz(), and toJsonObject().

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