Mass++ Common Libraries v2.7.5
 All Classes Namespaces Files Functions Variables Enumerations Macros
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
kome::operation::TransformedSpectrum Class Reference

transformed spectrum class More...

#include <TransformedSpectrum.h>

Inheritance diagram for kome::operation::TransformedSpectrum:
Inheritance graph
[legend]
Collaboration diagram for kome::operation::TransformedSpectrum:
Collaboration graph
[legend]

Public Member Functions

 TransformedSpectrum (kome::objects::Spectrum &org, const bool op=false)
 constructor More...
 
virtual ~TransformedSpectrum ()
 destructor
 
void setXScale (const double sc)
 sets x scale More...
 
double getXScale ()
 gets x scale More...
 
void setXTranslation (const double tr)
 sets x translation More...
 
double getXTranslation ()
 gets x translation More...
 
void setYScale (const double sc)
 sets y scale More...
 
double getYScale ()
 gets y scale More...
 
void setYTranslation (const double tr)
 sets y translation More...
 
double getYTranslation ()
 gets y translation More...
 
- Public Member Functions inherited from kome::objects::Spectrum
 Spectrum (Sample *sample, const char *name)
 constructor More...
 
virtual ~Spectrum ()
 destructor
 
void setId (int id)
 sets spectrum id More...
 
int getId ()
 gets spectrum id More...
 
void setOperationFlag (const bool op)
 sets the operation flag value More...
 
bool getOperationFlag ()
 gets the operation flag value More...
 
SamplegetSample ()
 gets the sample that has this spectrum More...
 
void setName (const char *name)
 sets spectrum name More...
 
const char * getName ()
 gets spectrum name More...
 
void setRt (const double rt)
 sets retention time More...
 
void setRt (const double startRt, const double endRt)
 gets retention time More...
 
void setStartRt (const double rt)
 sets start retention time More...
 
void setEndRt (const double rt)
 sets end retention time More...
 
double getRt ()
 gets retention time More...
 
double getStartRt ()
 gets the start of retention time More...
 
double getEndRt ()
 gets the end of retention time More...
 
void setSpecType (const char *type)
 sets spectrum type More...
 
const char * getSpecType ()
 gets spectrum type More...
 
void setTitle (const char *title)
 sets spectrum title More...
 
const char * getTitle ()
 gets spectrum title More...
 
void setIcon (const char *icon)
 sets icon name More...
 
const char * getIcon ()
 gets icon name More...
 
kome::core::XYDatagetXYData ()
 gets xy data from data manager More...
 
void deleteXYData ()
 deletes xy data of data manager
 
void getXYData (kome::core::XYData *const xyData, const bool op)
 gets data points More...
 
void getXYData (kome::core::XYData *const xyData, const double minX, const double maxX, const bool zero)
 gets data points that spectrum has More...
 
void setXRange (const double minX, const double maxX)
 sets x range More...
 
void setMinX (const double minX)
 sets min x More...
 
double getMinX ()
 gets min x More...
 
void setMaxX (const double maxX)
 sets max x More...
 
double getMaxX ()
 gets max x More...
 
void setTotalIntensity (const double intensity)
 sets total intensity of spectrum More...
 
double getTotalIntensity (const double minX=-1.0, const double maxX=-1.0)
 gets total intensity in specified range More...
 
void setMaxIntensity (const double intensity)
 sets max intensity of spectrum More...
 
double getMaxIntensity (const double minX=-1.0, const double maxX=-1.0)
 gets max intensity in specified range More...
 
void setBasePeakMass (const double mass)
 sets base peak mass More...
 
double getBasePeakMass ()
 gets base peak mass More...
 
void setMsStage (const int stage)
 sets ms stage More...
 
int getMsStage ()
 gets ms stage More...
 
void setPrecursor (const int stage, const double precursor)
 sets precursor More...
 
void setPrecursor (const double precursor)
 sets precursor More...
 
double getPrecursor (const int stage)
 gets precursor More...
 
double getPrecursor ()
 gets the precursor mass of precursor ion spectrum. More...
 
void setPrecursorIntensity (const int stage, const double intensity)
 sets precursor intensity More...
 
void setPrecursorIntensity (const double intensity)
 sets precursor intensity More...
 
double getPrecursorIntensity (const int stage)
 gets the precursor intensity More...
 
double getPrecursorIntensity ()
 gets the precursor intensity of the precursor ion spectrum. More...
 
void setPrecursorCharge (const int charge)
 sets the precursor charge More...
 
int getPrecursorCharge ()
 gets the precursor charge More...
 
void setParentSpectrum (Spectrum *const parent)
 sets parent spectrum More...
 
SpectrumgetParentSpectrum ()
 gets parent spectrum More...
 
void getChildSpectra (std::vector< Spectrum * > &children)
 gets child spectra More...
 
void setHasChromatogram (const bool chromatogram)
 sets wheher this spectrum has chromatogram More...
 
bool hasChromatogram ()
 judges whether this spectrum has chromatogram More...
 
void setGroup (DataGroupNode *group)
 sets spectrum group More...
 
DataGroupNodegetGroup ()
 gets spectrum group More...
 
void setScanNumber (const int scan)
 sets scan number More...
 
int getScanNumber ()
 gets scan number More...
 
void setPolarity (Polarity polarity)
 sets polarity More...
 
Polarity getPolarity ()
 gets polarity More...
 
void setCentroidMode (const bool centroidMode)
 sets centroid mode or not More...
 
bool isCentroidMode ()
 judget wheter this spectrum is centroid mode More...
 
void setResolution (const double resolution)
 sets resolution More...
 
double getResolution ()
 gets resolution More...
 
void setCollisionEnergy (const char *collisionEnergy)
 sets the collision energy More...
 
const char * getCollisionEnergy ()
 gets the collision energy More...
 
void setVisible (const bool visible)
 sets the visible flag More...
 
bool isVisible ()
 gets the visible flag value More...
 
void setAutoZeroPoints (const bool autoZero)
 sets auto zero points flag value More...
 
bool isAutoZeroPoints ()
 gets auto zero points flag value More...
 
kome::core::PropertiesgetProperties ()
 gets properties More...
 
kome::core::PropertiesgetUserProperties ()
 gets user properties More...
 
void setOrgSpectrum (Spectrum *spec)
 sets original spectrum More...
 
SpectrumgetOrgSpectrum ()
 gets original spectrum More...
 
void getProperties (kome::core::Properties &properties)
 gets spectrum and spectrum group properties More...
 
void getUserProperties (kome::core::Properties &userProperties)
 gets spectrum and spectrum group user properties More...
 
void setSpotId (const char *pcSpotId)
 set spot id param[in] pcSpotId SpotId information
 
const char * getSpotId (void)
 get spot id More...
 
void setRequestLoadData (void)
 set the flag of request load data More...
 
void resetRequestLoadData (void)
 
bool isRequestLoadData (void)
 check the flag of request load data More...
 
void setFirstAccess (void)
 set the flag of first access
 
void resetFirstAccess (void)
 reset the flag of first access
 
bool isFirstAccess (void)
 check the flag of first access More...
 
bool loadData (void)
 load data More...
 

Protected Member Functions

virtual void onGetXYData (kome::core::XYData *const xyData, const double minX, const double maxX)
 This method is called by getXYData method. (override method) More...
 
virtual void onGetXRange (double *minX, double *maxX)
 This method is called by getMinX or getMaxX method. (override method) More...
 
virtual double onGetTotalIntensity (const double minX, const double maxX)
 This method is called by getTotalIntensity method. (override method) More...
 
virtual double onGetMaxIntensity (const double minX, const double maxX)
 This method is called by getMaxIntensity method. (override method) More...
 
virtual void onSetRequestLoadData (void)
 This method is called by setRequestLoadData method. (abstract method)
 
virtual void onResetRequestLoadData (void)
 This method is called by resetRequestLoadData method. (abstract method)
 
virtual bool onIsRequestLoadData (void)
 This method is called by isRequestLoadData method. (abstract method) More...
 
virtual void onSetFirstAccess (void)
 This method is called by setFirstAccess method. (abstract method)
 
virtual void onResetFirstAccess (void)
 This method is called by resetFirstAccess method. (abstract method)
 
virtual bool onIsFirstAccess (void)
 This method is called by isFirstAccess method. (abstract method) More...
 
virtual bool onLoadData (void)
 This method is called by loadData method. (abstract method) More...
 
- Protected Member Functions inherited from kome::objects::Spectrum
bool firstAccessProcess (void)
 method for processing when accessing the first item of this class More...
 

Protected Attributes

kome::objects::Spectrumm_org
 
double m_scX
 
double m_trX
 
double m_scY
 
double m_trY
 
- Protected Attributes inherited from kome::objects::Spectrum
Spectrumm_orgSpec
 
bool m_op
 
int m_specId
 

Additional Inherited Members

- Public Types inherited from kome::objects::Spectrum
enum  Polarity { POLARITY_UNKNOWN = 0, POLARITY_POSITIVE = 1, POLARITY_NEGATIVE = 2 }
 polarity definition
 
- Static Public Member Functions inherited from kome::objects::Spectrum
static bool isCommonProperty (const char *key)
 check whther the specified property key is common property or not More...
 
- Static Protected Attributes inherited from kome::objects::Spectrum
static std::vector< std::string > m_commonProps
 

Detailed Description

transformed spectrum class

Definition at line 23 of file TransformedSpectrum.h.

Constructor & Destructor Documentation

kome::operation::TransformedSpectrum::TransformedSpectrum ( kome::objects::Spectrum org,
const bool  op = false 
)

constructor

Parameters
[in]orgoriginal spectrum
[in]opIf true, processed data is gotten when getting data points.

Definition at line 28 of file TransformedSpectrum.cpp.

29  : kome::objects::Spectrum( org.getSample(), org.getName() ), m_org( org ) {
30  m_scX = 1.0;
31  m_trX = 0.0;
32  m_scY = 1.0;
33  m_trY = 0.0;
34  m_op = op;
35 
36  setName( org.getName() );
37  setRt( org.getRt() );
38  setStartRt( org.getStartRt() );
39  setEndRt( org.getEndRt() );
40  setSpecType( org.getSpecType() );
41  setTitle( org.getTitle() );
42  setIcon( org.getIcon() );
43  setMinX( org.getMinX() );
44  setMaxX( org.getMaxX() );
47  setMsStage( org.getMsStage() );
48  setPrecursor( org.getPrecursor() );
52  setGroup( org.getGroup() );
54  setPolarity( org.getPolarity() );
58 }
double getStartRt()
gets the start of retention time
Definition: Spectrum.cpp:191
void setTotalIntensity(const double intensity)
sets total intensity of spectrum
Definition: Spectrum.cpp:505
Sample * getSample()
gets the sample that has this spectrum
Definition: Spectrum.cpp:108
double getPrecursor(const int stage)
gets precursor
Definition: Spectrum.cpp:683
double getRt()
gets retention time
Definition: Spectrum.cpp:184
void setMinX(const double minX)
sets min x
Definition: Spectrum.cpp:449
const char * getName()
gets spectrum name
Definition: Spectrum.cpp:123
void setRt(const double rt)
sets retention time
Definition: Spectrum.cpp:129
void setPrecursor(const int stage, const double precursor)
sets precursor
Definition: Spectrum.cpp:640
void setPolarity(Polarity polarity)
sets polarity
Definition: Spectrum.cpp:920
void setPrecursorIntensity(const int stage, const double intensity)
sets precursor intensity
Definition: Spectrum.cpp:702
void setMaxX(const double maxX)
sets max x
Definition: Spectrum.cpp:477
const char * getIcon()
gets icon name
Definition: Spectrum.cpp:273
void setIcon(const char *icon)
sets icon name
Definition: Spectrum.cpp:268
void setEndRt(const double rt)
sets end retention time
Definition: Spectrum.cpp:172
void setName(const char *name)
sets spectrum name
Definition: Spectrum.cpp:113
void setParentSpectrum(Spectrum *const parent)
sets parent spectrum
Definition: Spectrum.cpp:821
void setCentroidMode(const bool centroidMode)
sets centroid mode or not
Definition: Spectrum.cpp:935
Spectrum * getOrgSpectrum()
gets original spectrum
Definition: Spectrum.cpp:1003
double getResolution()
gets resolution
Definition: Spectrum.cpp:952
double getMinX()
gets min x
Definition: Spectrum.cpp:461
int getMsStage()
gets ms stage
Definition: Spectrum.cpp:634
double getMaxX()
gets max x
Definition: Spectrum.cpp:489
void setHasChromatogram(const bool chromatogram)
sets wheher this spectrum has chromatogram
Definition: Spectrum.cpp:883
int getScanNumber()
gets scan number
Definition: Spectrum.cpp:915
double getTotalIntensity(const double minX=-1.0, const double maxX=-1.0)
gets total intensity in specified range
Definition: Spectrum.cpp:516
void setMsStage(const int stage)
sets ms stage
Definition: Spectrum.cpp:587
DataGroupNode * getGroup()
gets spectrum group
Definition: Spectrum.cpp:898
void setStartRt(const double rt)
sets start retention time
Definition: Spectrum.cpp:160
void setScanNumber(const int scan)
sets scan number
Definition: Spectrum.cpp:903
void setBasePeakMass(const double mass)
sets base peak mass
Definition: Spectrum.cpp:569
const char * getTitle()
gets spectrum title
Definition: Spectrum.cpp:222
void setOrgSpectrum(Spectrum *spec)
sets original spectrum
Definition: Spectrum.cpp:998
Spectrum * getParentSpectrum()
gets parent spectrum
Definition: Spectrum.cpp:850
spectrum information management class
Definition: Spectrum.h:30
double getEndRt()
gets the end of retention time
Definition: Spectrum.cpp:197
void setSpecType(const char *type)
sets spectrum type
Definition: Spectrum.cpp:203
const char * getSpecType()
gets spectrum type
Definition: Spectrum.cpp:209
double getPrecursorIntensity(const int stage)
gets the precursor intensity
Definition: Spectrum.cpp:749
void setGroup(DataGroupNode *group)
sets spectrum group
Definition: Spectrum.cpp:893
void setTitle(const char *title)
sets spectrum title
Definition: Spectrum.cpp:215
bool isCentroidMode()
judget wheter this spectrum is centroid mode
Definition: Spectrum.cpp:941
void setResolution(const double resolution)
sets resolution
Definition: Spectrum.cpp:946
Polarity getPolarity()
gets polarity
Definition: Spectrum.cpp:930
double getBasePeakMass()
gets base peak mass
Definition: Spectrum.cpp:581
bool hasChromatogram()
judges whether this spectrum has chromatogram
Definition: Spectrum.cpp:888

Here is the call graph for this function:

Member Function Documentation

double kome::operation::TransformedSpectrum::getXScale ( )

gets x scale

Returns
x scale

Definition at line 70 of file TransformedSpectrum.cpp.

70  {
71  return m_scX;
72 }
double kome::operation::TransformedSpectrum::getXTranslation ( )

gets x translation

Returns
x translation

Definition at line 80 of file TransformedSpectrum.cpp.

80  {
81  return m_trX;
82 }
double kome::operation::TransformedSpectrum::getYScale ( )

gets y scale

Returns
y scale

Definition at line 90 of file TransformedSpectrum.cpp.

90  {
91  return m_scY;
92 }
double kome::operation::TransformedSpectrum::getYTranslation ( )

gets y translation

Returns
y translation

Definition at line 100 of file TransformedSpectrum.cpp.

100  {
101  return m_trY;
102 }
double kome::operation::TransformedSpectrum::onGetMaxIntensity ( const double  minX,
const double  maxX 
)
protectedvirtual

This method is called by getMaxIntensity method. (override method)

Parameters
[in]minXminimum x of range (If minX is negative number, minimum x value is unbounded.)
[in]maxXmaximum x of range (If maxX is negative number, maximum x value is unbounded.)
Returns
max intensity

Implements kome::objects::Spectrum.

Definition at line 161 of file TransformedSpectrum.cpp.

161  {
162  // x range
163  double orgMinX = minX;
164  if( orgMinX >= 0.0 ) {
165  orgMinX = std::max( ( minX - m_trX ) / m_scX, 0.0 );
166  }
167 
168  double orgMaxX = maxX;
169  if( orgMaxX >= 0.0 ) {
170  orgMaxX = std::max( ( maxX - m_trX ) / m_scX, 0.0 );
171  }
172 
173  // max intensity
174  double intensity = m_org.getMaxIntensity( orgMinX, orgMaxX );
175  intensity = m_scY * intensity + m_trY;
176 
177  return intensity;
178 }
double getMaxIntensity(const double minX=-1.0, const double maxX=-1.0)
gets max intensity in specified range
Definition: Spectrum.cpp:548

Here is the call graph for this function:

double kome::operation::TransformedSpectrum::onGetTotalIntensity ( const double  minX,
const double  maxX 
)
protectedvirtual

This method is called by getTotalIntensity method. (override method)

Parameters
[in]minXminimum x of range (If minX is negative number, minimum x value is unbounded.)
[in]maxXmaximum x of range (If maxX is negative number, maximum x value is unbounded.)
Returns
total intensity

Implements kome::objects::Spectrum.

Definition at line 141 of file TransformedSpectrum.cpp.

141  {
142  // x range
143  double orgMinX = minX;
144  if( orgMinX >= 0.0 ) {
145  orgMinX = std::max( ( minX - m_trX ) / m_scX, 0.0 );
146  }
147 
148  double orgMaxX = maxX;
149  if( orgMaxX >= 0.0 ) {
150  orgMaxX = std::max( ( maxX - m_trX ) / m_scX, 0.0 );
151  }
152 
153  // total intensity
154  double intensity = m_org.getTotalIntensity( orgMinX, orgMaxX );
155  intensity = m_scY * intensity + m_trY;
156 
157  return intensity;
158 }
double getTotalIntensity(const double minX=-1.0, const double maxX=-1.0)
gets total intensity in specified range
Definition: Spectrum.cpp:516

Here is the call graph for this function:

void kome::operation::TransformedSpectrum::onGetXRange ( double *  minX,
double *  maxX 
)
protectedvirtual

This method is called by getMinX or getMaxX method. (override method)

Parameters
[out]minXthe pointer to store minimum x value
[out]maxXthe pointer to store maximum x value

Implements kome::objects::Spectrum.

Definition at line 126 of file TransformedSpectrum.cpp.

126  {
127  // get original x range
128  double orgMinX = m_org.getMinX();
129  double orgMaxX = m_org.getMaxX();
130 
131  // get range
132  if( minX != NULL ) {
133  *minX = m_scX * orgMinX + m_trX;
134  }
135  if( maxX != NULL ) {
136  *maxX = m_scX * orgMaxX + m_trX;
137  }
138 }
double getMinX()
gets min x
Definition: Spectrum.cpp:461
double getMaxX()
gets max x
Definition: Spectrum.cpp:489
#define NULL
Definition: CoreMacros.h:18

Here is the call graph for this function:

void kome::operation::TransformedSpectrum::onGetXYData ( kome::core::XYData *const  xyData,
const double  minX,
const double  maxX 
)
protectedvirtual

This method is called by getXYData method. (override method)

Parameters
[out]xyDatathe object to store data points
[in]minXminimum x value. (If minX is negative number, minimum x value is not unbounded.)
[in]maxXmaximum x value. (If maxX is negative number, maximum x value is not unbounded.)

Implements kome::objects::Spectrum.

Definition at line 105 of file TransformedSpectrum.cpp.

109  {
110  // get points
112  m_org.getXYData( &dps, m_op );
113 
114  // transform
115  for( unsigned int i = 0; i < dps.getLength(); i++ ) {
116  const double x = m_scX * dps.getX( i ) + m_trX;
117  const double y = m_scY * dps.getY( i ) + m_trY;
118 
119  if( ( minX < 0.0 || x >= minX ) && ( maxX < 0.0 || x <= maxX ) ) {
120  xyData->addPoint( x, y );
121  }
122  }
123 }
data points data of profile management class
Definition: DataPoints.h:25
double getX(const unsigned int index)
gets x coordinate
Definition: XYData.cpp:224
double getY(const unsigned int index)
gets y coordinate
Definition: XYData.cpp:243
kome::core::XYData * getXYData()
gets xy data from data manager
Definition: Spectrum.cpp:279
void addPoint(const double x, const double y)
adds point
Definition: XYData.cpp:149
unsigned int getLength()
gets the number of points @return the number of points
Definition: XYData.cpp:216

Here is the call graph for this function:

bool kome::operation::TransformedSpectrum::onIsFirstAccess ( void  )
protectedvirtual

This method is called by isFirstAccess method. (abstract method)

Returns
If true, the first accessing.

Reimplemented from kome::objects::Spectrum.

Definition at line 213 of file TransformedSpectrum.cpp.

214 {
216 }
virtual bool onIsFirstAccess(void)
This method is called by isFirstAccess method. (abstract method)
Definition: Spectrum.cpp:1240

Here is the call graph for this function:

bool kome::operation::TransformedSpectrum::onIsRequestLoadData ( void  )
protectedvirtual

This method is called by isRequestLoadData method. (abstract method)

Returns
If true, file read request is valid.

Reimplemented from kome::objects::Spectrum.

Definition at line 195 of file TransformedSpectrum.cpp.

196 {
198 }
virtual bool onIsRequestLoadData(void)
This method is called by isRequestLoadData method. (abstract method)
Definition: Spectrum.cpp:1222

Here is the call graph for this function:

bool kome::operation::TransformedSpectrum::onLoadData ( void  )
protectedvirtual

This method is called by loadData method. (abstract method)

Returns
If true, file reading success.

Reimplemented from kome::objects::Spectrum.

Definition at line 219 of file TransformedSpectrum.cpp.

220 {
222 }
virtual bool onLoadData(void)
This method is called by loadData method. (abstract method)
Definition: Spectrum.cpp:1246

Here is the call graph for this function:

void kome::operation::TransformedSpectrum::setXScale ( const double  sc)

sets x scale

Parameters
[in]scx scale

Definition at line 65 of file TransformedSpectrum.cpp.

65  {
66  m_scX = std::max( sc, 1.0e-10 );
67 }
void kome::operation::TransformedSpectrum::setXTranslation ( const double  tr)

sets x translation

Parameters
[in]trx translation

Definition at line 75 of file TransformedSpectrum.cpp.

75  {
76  m_trX = tr;
77 }
void kome::operation::TransformedSpectrum::setYScale ( const double  sc)

sets y scale

Parameters
[in]scy scale

Definition at line 85 of file TransformedSpectrum.cpp.

85  {
86  m_scY = std::max( sc, 1.0e-10 );
87 }
void kome::operation::TransformedSpectrum::setYTranslation ( const double  tr)

sets y translation

Parameters
[in]try translation

Definition at line 95 of file TransformedSpectrum.cpp.

95  {
96  m_trY = tr;
97 }

Member Data Documentation

kome::objects::Spectrum& kome::operation::TransformedSpectrum::m_org
protected

original spectrum

Definition at line 41 of file TransformedSpectrum.h.

double kome::operation::TransformedSpectrum::m_scX
protected

x scale

Definition at line 45 of file TransformedSpectrum.h.

double kome::operation::TransformedSpectrum::m_scY
protected

y scale

Definition at line 51 of file TransformedSpectrum.h.

double kome::operation::TransformedSpectrum::m_trX
protected

x translation

Definition at line 48 of file TransformedSpectrum.h.

double kome::operation::TransformedSpectrum::m_trY
protected

y translation

Definition at line 54 of file TransformedSpectrum.h.


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