libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
pappso::XicCoordTims Struct Reference

coordinates of the XIC to extract and the resulting XIC after extraction More...

#include <xiccoordtims.h>

Inheritance diagram for pappso::XicCoordTims:
pappso::XicCoord

Public Member Functions

 XicCoordTims ()
 
 XicCoordTims (const XicCoordTims &other)
 
virtual ~XicCoordTims ()
 
virtual XicCoordSPtr initializeAndClone () const override
 intialize the XIC and make a deep copy of object
 
virtual XicCoordSPtr addition (const XicCoordSPtr &to_add) const override
 compute a new XIC coord as the sum of the given one
 
virtual XicCoordSPtr multiplyBy (double number) const override
 compute a new xic coord as a product by
 
virtual XicCoordSPtr divideBy (double number) const override
 compute a new xic coord as a division by
 
virtual void reset () override
 reset to zero
 
virtual QString toString () const override
 get a description of the XIC coordinate in a string
 
virtual const QVariant getParam (XicCoordParam param) const override
 get a specific XIC coordinate parameter
 
virtual void writeCborStream (QCborStreamWriter &cbor_writer) const override
 writes xic coordinates in a cbor stream
 
void scanNumBeginRangeCorrection (long start_dev, long stop_dev)
 apply scan num correction on xic coordinate
 
- Public Member Functions inherited from pappso::XicCoord
 XicCoord ()
 
 XicCoord (const XicCoord &other)
 
virtual ~XicCoord ()
 

Public Attributes

std::size_t scanNumBegin
 mobility index begin
 
std::size_t scanNumEnd
 mobility index end
 
- Public Attributes inherited from pappso::XicCoord
MzRange mzRange
 the mass to extract
 
double rtTarget = 0
 the targeted retention time to extract around intended in seconds, and related to one msrun. This is not a reference, just to save memory and cpu usage when extracting xic
 
XicSPtr xicSptr = nullptr
 extracted xic
 

Detailed Description

coordinates of the XIC to extract and the resulting XIC after extraction

to extract a XIC, we need basically the mass to extract it this structure is meant to extact a XIC quickly and not to maintain information about it : no peptide, no scan number, no retention time...

Definition at line 50 of file xiccoordtims.h.

Constructor & Destructor Documentation

◆ XicCoordTims() [1/2]

pappso::XicCoordTims::XicCoordTims ( )
inline

Default constructor

Definition at line 55 of file xiccoordtims.h.

55: XicCoord(){};

References pappso::XicCoord::XicCoord().

Referenced by XicCoordTims(), and addition().

◆ XicCoordTims() [2/2]

pappso::XicCoordTims::XicCoordTims ( const XicCoordTims & other)

Copy constructor

Parameters
otherTODO

Definition at line 41 of file xiccoordtims.cpp.

41 : XicCoord(other)
42{
43 scanNumBegin = other.scanNumBegin;
44 scanNumEnd = other.scanNumEnd;
45}
std::size_t scanNumEnd
mobility index end
std::size_t scanNumBegin
mobility index begin

References pappso::XicCoord::XicCoord(), XicCoordTims(), scanNumBegin, and scanNumEnd.

◆ ~XicCoordTims()

pappso::XicCoordTims::~XicCoordTims ( )
virtual

Destructor

Definition at line 48 of file xiccoordtims.cpp.

49{
50}

Member Function Documentation

◆ addition()

XicCoordSPtr pappso::XicCoordTims::addition ( const XicCoordSPtr & to_add) const
overridevirtual

compute a new XIC coord as the sum of the given one

Reimplemented from pappso::XicCoord.

Definition at line 66 of file xiccoordtims.cpp.

67{
68 XicCoordTimsSPtr xic_coord_sp = std::make_shared<XicCoordTims>(*this);
69
70 XicCoordTims *toadd = dynamic_cast<XicCoordTims *>(to_add.get());
71
72 if(toadd == nullptr)
73 {
74 throw ExceptionNotPossible(QObject::tr("XicCoord to add is of a different type"));
75 }
76
77 // xic_coord_sp.get()->xicSptr = xic_coord_sp.get()->xicSptr;
78
79 xic_coord_sp.get()->mzRange += to_add.get()->mzRange;
80 xic_coord_sp.get()->rtTarget += to_add.get()->rtTarget;
81 xic_coord_sp.get()->scanNumBegin += toadd->scanNumBegin;
82 xic_coord_sp.get()->scanNumEnd += toadd->scanNumEnd;
83
84 qDebug() << "xic_coord_sp.get()->scanNumBegin=" << xic_coord_sp.get()->scanNumBegin;
85 qDebug() << "xic_coord_sp.get()->scanNumEnd=" << xic_coord_sp.get()->scanNumEnd;
86 return xic_coord_sp;
87}
std::shared_ptr< XicCoordTims > XicCoordTimsSPtr

References XicCoordTims(), scanNumBegin, and scanNumEnd.

◆ divideBy()

XicCoordSPtr pappso::XicCoordTims::divideBy ( double number) const
overridevirtual

compute a new xic coord as a division by

Reimplemented from pappso::XicCoord.

Definition at line 107 of file xiccoordtims.cpp.

108{
109
110 XicCoordTimsSPtr xic_coord_sp = std::make_shared<XicCoordTims>(*this);
111
112 // xic_coord_sp.get()->xicSptr = nullptr;
113
114 xic_coord_sp.get()->rtTarget /= number;
115 xic_coord_sp.get()->mzRange *= (double)((double)1 / number);
116
117 xic_coord_sp.get()->scanNumBegin /= number;
118 xic_coord_sp.get()->scanNumEnd /= number;
119
120 qDebug() << "xic_coord_sp.get()->scanNumBegin=" << xic_coord_sp.get()->scanNumBegin;
121 qDebug() << "xic_coord_sp.get()->scanNumEnd=" << xic_coord_sp.get()->scanNumEnd;
122 return xic_coord_sp;
123}

◆ getParam()

const QVariant pappso::XicCoordTims::getParam ( XicCoordParam param) const
overridevirtual

get a specific XIC coordinate parameter

Reimplemented from pappso::XicCoord.

Definition at line 146 of file xiccoordtims.cpp.

147{
148 switch(param)
149 {
151 return QVariant((quint64)scanNumBegin);
152 break;
154 return QVariant((quint64)scanNumEnd);
155 break;
156 default:
157 return QVariant();
158 }
159}
@ TimsTofIonMobilityScanNumberStart
Definition xiccoord.h:52

References scanNumBegin, scanNumEnd, pappso::TimsTofIonMobilityScanNumberStart, and pappso::TimsTofIonMobilityScanNumberStop.

◆ initializeAndClone()

XicCoordSPtr pappso::XicCoordTims::initializeAndClone ( ) const
overridevirtual

intialize the XIC and make a deep copy of object

Reimplemented from pappso::XicCoord.

Definition at line 54 of file xiccoordtims.cpp.

55{
56
57 XicCoordTimsSPtr xic_coord_sp = std::make_shared<XicCoordTims>(*this);
58
59 xic_coord_sp.get()->xicSptr = std::make_shared<Xic>();
60
61 return xic_coord_sp;
62}

◆ multiplyBy()

XicCoordSPtr pappso::XicCoordTims::multiplyBy ( double number) const
overridevirtual

compute a new xic coord as a product by

Reimplemented from pappso::XicCoord.

Definition at line 91 of file xiccoordtims.cpp.

92{
93 XicCoordTimsSPtr xic_coord_sp = std::make_shared<XicCoordTims>(*this);
94
95 // xic_coord_sp.get()->xicSptr = nullptr;
96
97 xic_coord_sp.get()->rtTarget *= number;
98 xic_coord_sp.get()->mzRange *= number;
99
100 xic_coord_sp.get()->scanNumBegin *= number;
101 xic_coord_sp.get()->scanNumEnd *= number;
102
103 return xic_coord_sp;
104}

◆ reset()

void pappso::XicCoordTims::reset ( )
overridevirtual

reset to zero

Reimplemented from pappso::XicCoord.

Definition at line 127 of file xiccoordtims.cpp.

128{
129
130 xicSptr = nullptr;
131
132 rtTarget = 0;
133 mzRange = MzRange(0.0, 0.0);
134 scanNumBegin = 0;
135 scanNumEnd = 0;
136}
XicSPtr xicSptr
extracted xic
Definition xiccoord.h:135
double rtTarget
the targeted retention time to extract around intended in seconds, and related to one msrun....
Definition xiccoord.h:131
MzRange mzRange
the mass to extract
Definition xiccoord.h:125

References pappso::XicCoord::mzRange, pappso::XicCoord::rtTarget, scanNumBegin, scanNumEnd, and pappso::XicCoord::xicSptr.

◆ scanNumBeginRangeCorrection()

void pappso::XicCoordTims::scanNumBeginRangeCorrection ( long start_dev,
long stop_dev )

apply scan num correction on xic coordinate

Definition at line 161 of file xiccoordtims.cpp.

162{
163 long begin = scanNumBegin + start_dev;
164 long end = scanNumEnd + stop_dev;
165 if(begin < 0)
166 scanNumBegin = 0;
167 else
168 scanNumBegin = begin;
169 if(end < 0)
170 scanNumEnd = 0;
171 else
172 scanNumEnd = end;
173}

References scanNumBegin, and scanNumEnd.

Referenced by pappso::IonMobilityGrid::translateXicCoordFromTo().

◆ toString()

QString pappso::XicCoordTims::toString ( ) const
overridevirtual

get a description of the XIC coordinate in a string

Reimplemented from pappso::XicCoord.

Definition at line 139 of file xiccoordtims.cpp.

140{
141 return QString("%1 begin=%2 end=%3").arg(XicCoord::toString()).arg(scanNumBegin).arg(scanNumEnd);
142}
virtual QString toString() const
get a description of the XIC coordinate in a string
Definition xiccoord.cpp:114

References scanNumBegin, scanNumEnd, and pappso::XicCoord::toString().

◆ writeCborStream()

void pappso::XicCoordTims::writeCborStream ( QCborStreamWriter & cbor_writer) const
overridevirtual

writes xic coordinates in a cbor stream

Reimplemented from pappso::XicCoord.

Definition at line 178 of file xiccoordtims.cpp.

179{
180 cbor_writer.append(QLatin1String("xic_coord"));
181 cbor_writer.startMap(3);
182 cbor_writer.append(QLatin1String("mz_range"));
183 cbor_writer.startArray(2);
184 cbor_writer.append(mzRange.lower());
185 cbor_writer.append(mzRange.upper());
186 cbor_writer.endArray();
187
188 cbor_writer.append(QLatin1String("rt"));
189 cbor_writer.append(rtTarget);
190
191 cbor_writer.append(QLatin1String("tim_im_range"));
192 cbor_writer.startArray(2);
193 cbor_writer.append((quint64)scanNumBegin);
194 cbor_writer.append((quint64)scanNumEnd);
195 cbor_writer.endArray();
196 cbor_writer.endMap();
197}

References pappso::XicCoord::mzRange, pappso::XicCoord::rtTarget, scanNumBegin, and scanNumEnd.

Member Data Documentation

◆ scanNumBegin

◆ scanNumEnd


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