Mass++ Common Libraries v2.7.5
 All Classes Namespaces Files Functions Variables Enumerations Macros
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
kome::objects::Spectrum Class Referenceabstract

spectrum information management class More...

#include <Spectrum.h>

Inheritance diagram for kome::objects::Spectrum:
Inheritance graph
[legend]
Collaboration diagram for kome::objects::Spectrum:
Collaboration graph
[legend]

Classes

struct  PrecursorInfo
 precursor information More...
 

Public Types

enum  Polarity { POLARITY_UNKNOWN = 0, POLARITY_POSITIVE = 1, POLARITY_NEGATIVE = 2 }
 polarity definition
 

Public Member Functions

 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...
 

Static Public Member Functions

static bool isCommonProperty (const char *key)
 check whther the specified property key is common property or not More...
 

Protected Member Functions

virtual void onGetXYData (kome::core::XYData *const xyData, const double minX, const double maxX)=0
 This method is called by getXYData method. (abstract method) More...
 
virtual void onGetXRange (double *minX, double *maxX)=0
 This method is called by getMinX or getMaxX method. (abstract method) More...
 
virtual double onGetTotalIntensity (const double minX, const double maxX)=0
 This method is called by getTotalIntensity method. (abstract method) More...
 
virtual double onGetMaxIntensity (const double minX, const double maxX)=0
 This method is called by getMaxIntensity method. (abstract 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...
 
bool firstAccessProcess (void)
 method for processing when accessing the first item of this class More...
 

Protected Attributes

Spectrumm_orgSpec
 
bool m_op
 
int m_specId
 

Static Protected Attributes

static std::vector< std::string > m_commonProps
 

Detailed Description

spectrum information management class

Definition at line 30 of file Spectrum.h.

Constructor & Destructor Documentation

kome::objects::Spectrum::Spectrum ( Sample sample,
const char *  name 
)

constructor

Parameters
[in]samplesample object that has this spectrum
[in]namespectrum name

Definition at line 42 of file Spectrum.cpp.

42  {
43  // initialize
44  m_sample = sample;
45  m_name = NVL( name, "" );
46 
47  m_rt.start = -1.0;
48  m_rt.end = -1.0;
49 
50  m_bpm = -1.0;
51 
52  m_msStage = 1;
53  m_parentSpec = NULL;
54  m_chrom = false;
55 
56  m_charge = 0;
57 
58  m_group = NULL;
59  m_scanNumber = -1;
60 
61  m_polarity = POLARITY_UNKNOWN;
62  m_centroidMode = false;
63 
64  m_resolution = -1.0;
65 
66  m_orgSpec = NULL;
67  m_op = false;
68 
69  // reserve properties
71 
72  for( unsigned int i = 0; i < m_commonProps.size(); i++ ) {
73  m_props.setValue( m_commonProps[ i ].c_str(), "" );
74  }
75  m_props.setValue( "Name", m_name.c_str() );
76 
77  // issue spectrum id
78  if( sample != NULL ){
79  m_specId = sample->issueSpecId();
80  }
81 
82  // visible flag
83  m_visible = true;
84  m_autoZeroPoints = true;
85 
86  // >>>>>> @Date:2013/07/16 <Add> A.Ozaki
87  m_strSpotId = FMT( "" );
88  // <<<<<< @Date:2013/07/16 <Add> A.Ozaki
89 
90 }
int issueSpecId()
to issue the spectrum id
Definition: Sample.cpp:462
void setValue(const char *key, const char *value)
sets parameter value
Definition: Properties.cpp:39
static std::vector< std::string > m_commonProps
Definition: Spectrum.h:169
static bool isCommonProperty(const char *key)
check whther the specified property key is common property or not
Definition: Spectrum.cpp:1083
#define NVL(checkVal, replaceVal)
Definition: CoreMacros.h:99
#define NULL
Definition: CoreMacros.h:18
Spectrum * m_orgSpec
Definition: Spectrum.h:162

Here is the call graph for this function:

Member Function Documentation

bool kome::objects::Spectrum::firstAccessProcess ( void  )
protected

method for processing when accessing the first item of this class

Returns
If true, file reading success.

Definition at line 1252 of file Spectrum.cpp.

1253 {
1254  bool bRet = true;
1255  if ( isFirstAccess( ) && isRequestLoadData( ) )
1256  {
1257  bRet = loadData( );
1258  resetFirstAccess( );
1259  }
1260 
1261  return bRet;
1262 }
bool isFirstAccess(void)
check the flag of first access
Definition: Spectrum.cpp:1198
bool loadData(void)
load data
Definition: Spectrum.cpp:1204
void resetFirstAccess(void)
reset the flag of first access
Definition: Spectrum.cpp:1190
bool isRequestLoadData(void)
check the flag of request load data
Definition: Spectrum.cpp:1176

Here is the call graph for this function:

double kome::objects::Spectrum::getBasePeakMass ( )

gets base peak mass

Returns
base peak mass

Definition at line 581 of file Spectrum.cpp.

581  {
582  firstAccessProcess( ); // @Date:2013/07/16 <Add> A.Ozaki
583  return m_bpm;
584 }
bool firstAccessProcess(void)
method for processing when accessing the first item of this class
Definition: Spectrum.cpp:1252

Here is the call graph for this function:

void kome::objects::Spectrum::getChildSpectra ( std::vector< Spectrum * > &  children)

gets child spectra

Parameters
[out]childrenthe array to store child spectra

Definition at line 855 of file Spectrum.cpp.

855  {
856  // sample
857  Sample* smpl = getSample();
858  if( smpl == NULL ) {
859  return;
860  }
861 
862  // get children
863  if( m_children.size() == 0 ) {
864  // spectra
865  for( unsigned int i = 0; i < smpl->getNumberOfGroups(); i++ ) {
866  DataGroupNode* group = smpl->getGroup( i );
867  for( unsigned int j = 0; j < group->getNumberOfSpectra(); j++ ) {
868  Spectrum* spec = group->getSpectrum( j );
869  if( spec->getParentSpectrum() == this ) {
870  m_children.push_back( spec );
871  }
872  }
873  }
874  }
875 
876  // store
877  for( unsigned int i = 0; i < m_children.size(); i++ ) {
878  children.push_back( m_children[ i ] );
879  }
880 }
group of spectrum management class
Definition: DataGroupNode.h:33
Sample * getSample()
gets the sample that has this spectrum
Definition: Spectrum.cpp:108
sample information management class
Definition: Sample.h:34
DataGroupNode * getGroup(const unsigned int index)
gets spectrum group
Definition: Sample.cpp:234
unsigned int getNumberOfSpectra()
gets the number of spectra
Definition: DataSet.cpp:128
Spectrum * getSpectrum(const unsigned int index)
gets the number of spectra
Definition: DataSet.cpp:133
#define NULL
Definition: CoreMacros.h:18
unsigned int getNumberOfGroups()
gets the number of spectrum groups
Definition: Sample.cpp:229
Spectrum * getParentSpectrum()
gets parent spectrum
Definition: Spectrum.cpp:850
spectrum information management class
Definition: Spectrum.h:30

Here is the call graph for this function:

const char * kome::objects::Spectrum::getCollisionEnergy ( )

gets the collision energy

Returns
collision energy

Definition at line 963 of file Spectrum.cpp.

963  {
964  return m_collisionEnergy.c_str();
965 }
double kome::objects::Spectrum::getEndRt ( )

gets the end of retention time

Returns
the end of retention time

Definition at line 197 of file Spectrum.cpp.

197  {
198  firstAccessProcess( ); // @Date:2013/07/16 <Add> A.Ozaki
199  return m_rt.end;
200 }
bool firstAccessProcess(void)
method for processing when accessing the first item of this class
Definition: Spectrum.cpp:1252

Here is the call graph for this function:

DataGroupNode * kome::objects::Spectrum::getGroup ( )

gets spectrum group

Returns
spectrum group

Definition at line 898 of file Spectrum.cpp.

898  {
899  return m_group;
900 }
const char * kome::objects::Spectrum::getIcon ( )

gets icon name

Returns
icon name

Definition at line 273 of file Spectrum.cpp.

273  {
274  firstAccessProcess( ); // @Date:2013/07/16 <Add> A.Ozaki
275  return m_icon.c_str();
276 }
bool firstAccessProcess(void)
method for processing when accessing the first item of this class
Definition: Spectrum.cpp:1252

Here is the call graph for this function:

int kome::objects::Spectrum::getId ( )

gets spectrum id

Returns
spectrum id

Definition at line 1136 of file Spectrum.cpp.

1136  {
1137  return m_specId;
1138 }
double kome::objects::Spectrum::getMaxIntensity ( const double  minX = -1.0,
const double  maxX = -1.0 
)

gets max intensity in specified range

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

Definition at line 548 of file Spectrum.cpp.

548  {
549  firstAccessProcess( ); // @Date:2013/07/16 <Add> A.Ozaki
550  // check member
551  if( minX < 0.0 && maxX < 0.0 ) {
552  if( m_bpi ) {
553  return m_bpi.get();
554  }
555  }
556 
557  // get max intensity
558  double intensity = onGetMaxIntensity( minX, maxX );
559 
560  // set bpc
561  if( minX < 0.0 && maxX < 0.0 ) {
562  setMaxIntensity( intensity );
563  }
564 
565  return intensity;
566 }
void setMaxIntensity(const double intensity)
sets max intensity of spectrum
Definition: Spectrum.cpp:537
bool firstAccessProcess(void)
method for processing when accessing the first item of this class
Definition: Spectrum.cpp:1252
virtual double onGetMaxIntensity(const double minX, const double maxX)=0
This method is called by getMaxIntensity method. (abstract method)

Here is the call graph for this function:

double kome::objects::Spectrum::getMaxX ( )

gets max x

Returns
max x

Definition at line 489 of file Spectrum.cpp.

489  {
490  firstAccessProcess( ); // @Date:2013/07/16 <Add> A.Ozaki
491  // check the member
492  if( !m_maxX ) {
493  double minX = double();
494  double maxX = double();
495 
496  onGetXRange( &minX, &maxX );
497 
498  setXRange( minX, maxX );
499  }
500 
501  return m_maxX.get();
502 }
bool firstAccessProcess(void)
method for processing when accessing the first item of this class
Definition: Spectrum.cpp:1252
void setXRange(const double minX, const double maxX)
sets x range
Definition: Spectrum.cpp:443
virtual void onGetXRange(double *minX, double *maxX)=0
This method is called by getMinX or getMaxX method. (abstract method)

Here is the call graph for this function:

double kome::objects::Spectrum::getMinX ( )

gets min x

Returns
min x

Definition at line 461 of file Spectrum.cpp.

461  {
462  firstAccessProcess( ); // @Date:2013/07/16 <Add> A.Ozaki
463  // check the member
464  if( !m_minX ) {
465  double minX = double();
466  double maxX = double();
467 
468  onGetXRange( &minX, &maxX );
469 
470  setXRange( minX, maxX );
471  }
472 
473  return m_minX.get();
474 }
bool firstAccessProcess(void)
method for processing when accessing the first item of this class
Definition: Spectrum.cpp:1252
void setXRange(const double minX, const double maxX)
sets x range
Definition: Spectrum.cpp:443
virtual void onGetXRange(double *minX, double *maxX)=0
This method is called by getMinX or getMaxX method. (abstract method)

Here is the call graph for this function:

int kome::objects::Spectrum::getMsStage ( )

gets ms stage

Returns
ms stage

Definition at line 634 of file Spectrum.cpp.

634  {
635  firstAccessProcess( ); // @Date:2013/07/16 <Add> A.Ozaki
636  return m_msStage;
637 }
bool firstAccessProcess(void)
method for processing when accessing the first item of this class
Definition: Spectrum.cpp:1252

Here is the call graph for this function:

const char * kome::objects::Spectrum::getName ( )

gets spectrum name

Returns
spectrum name

Definition at line 123 of file Spectrum.cpp.

123  {
124  firstAccessProcess( ); // @Date:2013/07/16 <Add> A.Ozaki
125  return m_name.c_str();
126 }
bool firstAccessProcess(void)
method for processing when accessing the first item of this class
Definition: Spectrum.cpp:1252

Here is the call graph for this function:

bool kome::objects::Spectrum::getOperationFlag ( )
inline

gets the operation flag value

Returns
operation flag value

Definition at line 202 of file Spectrum.h.

202 { return m_op; }
Spectrum * kome::objects::Spectrum::getOrgSpectrum ( )

gets original spectrum

Returns
original spectrum

Definition at line 1003 of file Spectrum.cpp.

1003  {
1004  if( m_orgSpec == NULL ) {
1005  m_orgSpec = this;
1006  }
1007 
1008  return m_orgSpec;
1009 }
#define NULL
Definition: CoreMacros.h:18
Spectrum * m_orgSpec
Definition: Spectrum.h:162
Spectrum * kome::objects::Spectrum::getParentSpectrum ( )

gets parent spectrum

Returns
parent spectrum. (If this spectrum has no parent, this method returns NULL.)

Definition at line 850 of file Spectrum.cpp.

850  {
851  return m_parentSpec;
852 }
Polarity kome::objects::Spectrum::getPolarity ( )

gets polarity

Returns
polarity

Definition at line 930 of file Spectrum.cpp.

930  {
931  return m_polarity;
932 }
double kome::objects::Spectrum::getPrecursor ( const int  stage)

gets precursor

Parameters
[in]stageMS stage of precursor ion spectrum
Returns
precursor

Definition at line 683 of file Spectrum.cpp.

683  {
684  firstAccessProcess( ); // @Date:2013/07/16 <Add> A.Ozaki
685  for( unsigned int i = 0; i < m_precursor.size(); i++ ) {
686  if( m_precursor[ i ].stage == stage ) {
687  return m_precursor[ i ].precursor;
688  }
689  }
690 
691  return -1.0;
692 }
bool firstAccessProcess(void)
method for processing when accessing the first item of this class
Definition: Spectrum.cpp:1252

Here is the call graph for this function:

double kome::objects::Spectrum::getPrecursor ( )

gets the precursor mass of precursor ion spectrum.

Returns
precursor mass

Definition at line 695 of file Spectrum.cpp.

695  {
696  firstAccessProcess( ); // @Date:2013/07/16 <Add> A.Ozaki
697  int stage = ( m_msStage > 1 ? ( m_msStage - 1 ) : -1 );
698  return getPrecursor( stage );
699 }
bool firstAccessProcess(void)
method for processing when accessing the first item of this class
Definition: Spectrum.cpp:1252
double getPrecursor()
gets the precursor mass of precursor ion spectrum.
Definition: Spectrum.cpp:695

Here is the call graph for this function:

int kome::objects::Spectrum::getPrecursorCharge ( )

gets the precursor charge

Returns
precursor charge

Definition at line 816 of file Spectrum.cpp.

816  {
817  return m_charge;
818 }
double kome::objects::Spectrum::getPrecursorIntensity ( const int  stage)

gets the precursor intensity

Parameters
[in]stageMS stage of precursor ion spectrum
Returns
precursor intensity

Definition at line 749 of file Spectrum.cpp.

749  {
750  firstAccessProcess( ); // @Date:2013/07/16 <Add> A.Ozaki
751  // get intensity
752  double intensity = -1.0;
753  for( unsigned int i = 0; i < m_precursor.size(); i++ ) {
754  if( m_precursor[ i ].stage == stage ) {
755  intensity = m_precursor[ i ].intensity;
756  }
757  }
758  if( intensity >= 0.0 ) {
759  return intensity;
760  }
761 
762  // get from parent spectrum
763  Spectrum* parent = getParentSpectrum();
764  double precursor = getPrecursor( stage );
765  if( precursor < 0.0 ) {
766  return -1.0;
767  }
768 
769  std::set< Spectrum* > parentSet;
770  parentSet.insert( this );
771  parentSet.insert( parent );
772  while( parent != NULL && parent->getMsStage() != stage ) {
773  parent = parent->getParentSpectrum();
774  if( parentSet.find( parent ) == parentSet.end() ) {
775  parentSet.insert( parent );
776  }
777  else {
778  parent = NULL;
779  }
780  }
781 
782  if( parent != NULL ) {
783  intensity = 0.0;
785  parent->getXYData( &dps, precursor - 0.5, precursor + 0.5, false );
786 
787  for( unsigned int i = 0; i < dps.getLength(); i++ ) {
788  intensity = std::max( intensity, dps.getY( i ) );
789  }
790  setPrecursorIntensity( stage, intensity );
791  }
792 
793  return intensity;
794 }
bool firstAccessProcess(void)
method for processing when accessing the first item of this class
Definition: Spectrum.cpp:1252
data points data of profile management class
Definition: DataPoints.h:25
void setPrecursorIntensity(const int stage, const double intensity)
sets precursor intensity
Definition: Spectrum.cpp:702
double getY(const unsigned int index)
gets y coordinate
Definition: XYData.cpp:243
int getMsStage()
gets ms stage
Definition: Spectrum.cpp:634
#define NULL
Definition: CoreMacros.h:18
kome::core::XYData * getXYData()
gets xy data from data manager
Definition: Spectrum.cpp:279
double getPrecursor()
gets the precursor mass of precursor ion spectrum.
Definition: Spectrum.cpp:695
Spectrum * getParentSpectrum()
gets parent spectrum
Definition: Spectrum.cpp:850
spectrum information management class
Definition: Spectrum.h:30
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:

double kome::objects::Spectrum::getPrecursorIntensity ( )

gets the precursor intensity of the precursor ion spectrum.

Returns
the precursor intensity

Definition at line 797 of file Spectrum.cpp.

797  {
798  firstAccessProcess( ); // @Date:2013/07/16 <Add> A.Ozaki
799  int stage = ( m_msStage > 1 ? ( m_msStage - 1 ) : -1 );
800  return getPrecursorIntensity( stage );
801 }
double getPrecursorIntensity()
gets the precursor intensity of the precursor ion spectrum.
Definition: Spectrum.cpp:797
bool firstAccessProcess(void)
method for processing when accessing the first item of this class
Definition: Spectrum.cpp:1252

Here is the call graph for this function:

kome::core::Properties & kome::objects::Spectrum::getProperties ( )

gets properties

Returns
properties

Definition at line 968 of file Spectrum.cpp.

968  {
969  return m_props;
970 }
void kome::objects::Spectrum::getProperties ( kome::core::Properties properties)

gets spectrum and spectrum group properties

Parameters
[out]propertiesproperties object to store properties

Definition at line 1012 of file Spectrum.cpp.

1012  {
1013  firstAccessProcess( ); // @Date:2013/07/16 <Add> A.Ozaki
1014  // get spectrum properties
1015  for( unsigned int i = 0; i < m_props.getNumberOfProperties(); i++ ) {
1016  properties.setValue( m_props.getKey( i ), m_props.getValue( i ) );
1017  }
1018 
1019  // get peak information
1021  Peaks* peaks = pkMgr.getPeaks( this );
1022  if( peaks != NULL ) {
1023  int peakNum = peaks->getLength();
1024  double precursor = peaks->getPrecursor();
1025  std::string chargeStr;
1026  for( unsigned int i = 0; i < peaks->getNumberOfCharges(); i++ ) {
1027  int charge = peaks->getCharge( i );
1028  if( charge > 0 ) {
1029  if( !chargeStr.empty() ) {
1030  chargeStr.append( ", " );
1031  }
1032  }
1033  chargeStr.append( FMT( "%d", charge ) );
1034  }
1035 
1036  properties.setIntValue( "Peaks Count", peakNum );
1037  if( precursor < 0.0 ) {
1038  properties.setValue( "Calculated Precursor", "" );
1039  }
1040  else {
1041  properties.setDoubleValue( "Calculated Precursor", precursor );
1042  }
1043  properties.setValue( "Calculated Precursor Charge", chargeStr.c_str() );
1044  }
1045 
1046  // get group properties
1047  DataGroupNode* group = m_group;
1048 
1049  while( group != NULL ) {
1050  for( unsigned int i = 0; i < group->getProperties().getNumberOfProperties(); i++ ) {
1051  properties.setValue(
1052  group->getProperties().getKey( i ),
1053  group->getProperties().getValue( i )
1054  );
1055  }
1056  group = group->getParentGroup();
1057  }
1058 }
unsigned int getNumberOfCharges()
gets the number of charges
Definition: Peaks.cpp:162
group of spectrum management class
Definition: DataGroupNode.h:33
bool firstAccessProcess(void)
method for processing when accessing the first item of this class
Definition: Spectrum.cpp:1252
double getPrecursor()
gets precursor
Definition: Peaks.cpp:189
Peaks * getPeaks(Spectrum *spec)
gets peaks of specified spectrum
void setValue(const char *key, const char *value)
sets parameter value
Definition: Properties.cpp:39
void setIntValue(const char *key, int value)
sets parameter value
Definition: Properties.cpp:57
short getCharge(const unsigned int index)
gets charge
Definition: Peaks.cpp:167
peaks management class
Definition: PeaksManager.h:41
const char * getValue(const unsigned int index)
gets the parameter value
Definition: Properties.cpp:175
kome::core::Properties & getProperties()
gets properties
unsigned int getNumberOfProperties()
gets the number of Properties
Definition: Properties.cpp:160
DataGroupNode * getParentGroup()
get parent spectrum group
#define NULL
Definition: CoreMacros.h:18
const char * getKey(const unsigned int index)
gets the name of parameter
Definition: Properties.cpp:165
peaks information class
Definition: Peaks.h:35
static PeaksManager & getInstance()
get peaks manager object (This is the only object.)
unsigned int getLength()
gets the number of points @return the number of points
Definition: XYData.cpp:216
void setDoubleValue(const char *key, double value)
sets parameter value
Definition: Properties.cpp:62

Here is the call graph for this function:

double kome::objects::Spectrum::getResolution ( )

gets resolution

Returns
resolution

Definition at line 952 of file Spectrum.cpp.

952  {
953  return m_resolution;
954 }
double kome::objects::Spectrum::getRt ( )

gets retention time

Returns
retention time

Definition at line 184 of file Spectrum.cpp.

184  {
185  firstAccessProcess( ); // @Date:2013/07/16 <Add> A.Ozaki
186  double rt = ( m_rt.start + m_rt.end ) / 2.0;
187  return rt;
188 }
bool firstAccessProcess(void)
method for processing when accessing the first item of this class
Definition: Spectrum.cpp:1252

Here is the call graph for this function:

Sample * kome::objects::Spectrum::getSample ( )

gets the sample that has this spectrum

Returns
sample object

Definition at line 108 of file Spectrum.cpp.

108  {
109  return m_sample;
110 }
int kome::objects::Spectrum::getScanNumber ( )

gets scan number

Returns
scan number

Definition at line 915 of file Spectrum.cpp.

915  {
916  return m_scanNumber;
917 }
const char * kome::objects::Spectrum::getSpecType ( )

gets spectrum type

Returns
spectrum type

Definition at line 209 of file Spectrum.cpp.

209  {
210  firstAccessProcess( ); // @Date:2013/07/16 <Add> A.Ozaki
211  return m_specType.c_str();
212 }
bool firstAccessProcess(void)
method for processing when accessing the first item of this class
Definition: Spectrum.cpp:1252

Here is the call graph for this function:

const char * kome::objects::Spectrum::getSpotId ( void  )

get spot id

Returns
string of spot id

Definition at line 1153 of file Spectrum.cpp.

1154 {
1155  firstAccessProcess( );
1156  return m_strSpotId.c_str( );
1157 }
bool firstAccessProcess(void)
method for processing when accessing the first item of this class
Definition: Spectrum.cpp:1252

Here is the call graph for this function:

double kome::objects::Spectrum::getStartRt ( )

gets the start of retention time

Returns
the start of retention time

Definition at line 191 of file Spectrum.cpp.

191  {
192  firstAccessProcess( ); // @Date:2013/07/16 <Add> A.Ozaki
193  return m_rt.start;
194 }
bool firstAccessProcess(void)
method for processing when accessing the first item of this class
Definition: Spectrum.cpp:1252

Here is the call graph for this function:

const char * kome::objects::Spectrum::getTitle ( )

gets spectrum title

Returns
spectrum title

Definition at line 222 of file Spectrum.cpp.

222  {
223  firstAccessProcess( ); // @Date:2013/07/16 <Add> A.Ozaki
224 
225  if( m_title.empty() ) {
226  std::string name = m_name;
227  std::string values;
228 
229  int scanNum = getScanNumber();
230  if( scanNum >= 0 ) {
231  if( !values.empty() ) {
232  values.append( "," );
233  }
234  values.append( FMT( "scanNum=%d", scanNum ) );
235  }
236 
237  double rt = getRt();
238  if( rt >= 0.0 ) {
239  if( !values.empty() ) {
240  values.append( "," );
241  }
242  values.append( FMT( "rt=%.2f", rt ) );
243  }
244 
245  double prec = getPrecursor();
246  if( prec >= 0.0 ) {
247  if( !values.empty() ) {
248  values.append( "," );
249  }
250  values.append( FMT( "precursor=%.2f", prec ) );
251  }
252 
253  if( values.empty() ) {
254  m_title = name;
255  }
256  else if( name.empty() ) {
257  m_title = values;
258  }
259  else {
260  m_title = FMT( "%s: %s", name.c_str(), values.c_str() );
261  }
262  }
263 
264  return m_title.c_str();
265 }
bool firstAccessProcess(void)
method for processing when accessing the first item of this class
Definition: Spectrum.cpp:1252
double getRt()
gets retention time
Definition: Spectrum.cpp:184
int getScanNumber()
gets scan number
Definition: Spectrum.cpp:915
double getPrecursor()
gets the precursor mass of precursor ion spectrum.
Definition: Spectrum.cpp:695

Here is the call graph for this function:

double kome::objects::Spectrum::getTotalIntensity ( const double  minX = -1.0,
const double  maxX = -1.0 
)

gets total intensity in specified range

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

Definition at line 516 of file Spectrum.cpp.

516  {
517  firstAccessProcess( ); // @Date:2013/07/16 <Add> A.Ozaki
518  // check member
519  if( minX < 0.0 && maxX < 0.0 ) {
520  if( m_tic ) {
521  return m_tic.get();
522  }
523  }
524 
525  // get total intensity
526  double intensity = onGetTotalIntensity( minX, maxX );
527 
528  // set tic
529  if( minX < 0.0 && maxX < 0.0 ) {
530  setTotalIntensity( intensity );
531  }
532 
533  return intensity;
534 }
void setTotalIntensity(const double intensity)
sets total intensity of spectrum
Definition: Spectrum.cpp:505
bool firstAccessProcess(void)
method for processing when accessing the first item of this class
Definition: Spectrum.cpp:1252
virtual double onGetTotalIntensity(const double minX, const double maxX)=0
This method is called by getTotalIntensity method. (abstract method)

Here is the call graph for this function:

kome::core::Properties & kome::objects::Spectrum::getUserProperties ( )

gets user properties

Returns
user properties

Definition at line 993 of file Spectrum.cpp.

993  {
994  return m_userProps;
995 }
void kome::objects::Spectrum::getUserProperties ( kome::core::Properties userProperties)

gets spectrum and spectrum group user properties

Parameters
[out]userPropertiesuserProperties object to store user properties

Definition at line 1061 of file Spectrum.cpp.

1061  {
1062  firstAccessProcess( ); // @Date:2013/07/16 <Add> A.Ozaki
1063  // get spectrum user properties
1064  for( unsigned int i = 0; i < m_userProps.getNumberOfProperties(); i++ ) {
1065  userProperties.setValue( m_userProps.getKey( i ), m_userProps.getValue( i ) );
1066  }
1067 
1068  // get group user properties
1069  DataGroupNode* group = m_group;
1070 
1071  while( group != NULL ) {
1072  for( unsigned int i = 0; i < group->getUserProperties().getNumberOfProperties(); i++ ) {
1073  userProperties.setValue(
1074  group->getUserProperties().getKey( i ),
1075  group->getUserProperties().getValue( i )
1076  );
1077  }
1078  group = group->getParentGroup();
1079  }
1080 }
group of spectrum management class
Definition: DataGroupNode.h:33
bool firstAccessProcess(void)
method for processing when accessing the first item of this class
Definition: Spectrum.cpp:1252
void setValue(const char *key, const char *value)
sets parameter value
Definition: Properties.cpp:39
const char * getValue(const unsigned int index)
gets the parameter value
Definition: Properties.cpp:175
unsigned int getNumberOfProperties()
gets the number of Properties
Definition: Properties.cpp:160
DataGroupNode * getParentGroup()
get parent spectrum group
#define NULL
Definition: CoreMacros.h:18
const char * getKey(const unsigned int index)
gets the name of parameter
Definition: Properties.cpp:165
kome::core::Properties & getUserProperties()
gets user properties

Here is the call graph for this function:

kome::core::XYData * kome::objects::Spectrum::getXYData ( )

gets xy data from data manager

Returns
xy data object

Definition at line 279 of file Spectrum.cpp.

279  {
281 
282  return ptMgr.getXYData( this );
283 }
static PointsManager & getInstance()
get data points manager object (This is the only object.)
data points management class
Definition: PointsManager.h:36
kome::core::XYData * getXYData(Spectrum *spec)
gets xy data of specified spectrum

Here is the call graph for this function:

void kome::objects::Spectrum::getXYData ( kome::core::XYData *const  xyData,
const bool  op 
)

gets data points

Parameters
[out]xyDatathe object to store data points
[in]opIf true, getting operated data points

Definition at line 293 of file Spectrum.cpp.

293  {
294  // get data points
295  getXYData( xyData, -1.0, -1.0, op );
296 
297  // operation
298  if( op ) {
299  // get operations
301  for( unsigned int i = 0; i < ptMgr.getNumberOfOperations( this ); i++ ) {
302  XYDataOperation* operation = ptMgr.getOperation( this, i );
303 
304  operation->update( *xyData, *xyData, *this );
305  }
306  }
307 }
unsigned int getNumberOfOperations(Spectrum *spec)
gets the number of operations of specified spectrum
static PointsManager & getInstance()
get data points manager object (This is the only object.)
data points management class
Definition: PointsManager.h:36
void update(kome::core::XYData &src, kome::core::XYData &dst, Chromatogram &chrom)
updates xy data
kome::core::XYData * getXYData()
gets xy data from data manager
Definition: Spectrum.cpp:279
XYDataOperation * getOperation(Spectrum *spec, const unsigned int index)
gets operation of specified spectrum
xy data operation class

Here is the call graph for this function:

void kome::objects::Spectrum::getXYData ( kome::core::XYData *const  xyData,
const double  minX,
const double  maxX,
const bool  zero 
)

gets data points that spectrum has

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.)
[in]zerozero intensities insertion flag

Definition at line 310 of file Spectrum.cpp.

310  {
311  // check parameter
312  if( xyData == NULL ) {
313  return;
314  }
315 
316  // gets data points
318  onGetXYData( &dps, minX, maxX );
319 
320  // correct data points
321  if( minX < 0.0 && maxX < 0.0 ) {
322  // get length
323  unsigned int length = dps.getLength();
324 
325  // set x range
326  double minXX = getMinX();
327  double maxXX = getMaxX();
328 
329  // set total and max y
330  if( !m_tic || !m_bpi || m_bpm < 0.0 ) {
331  double tic = 0.0;
332  double bpi = 0.0;
333  double bpm = 0.0;
334 
335  for( unsigned int i = 0; i < length; i++ ) {
336  double x = dps.getX( i );
337  double y = dps.getY( i );
338 
339  tic += y;
340  if( y > bpi ) {
341  bpi = y;
342  bpm = x;
343  }
344  }
345 
346  if( !m_tic ) {
347  setTotalIntensity( tic );
348  }
349  if( !m_bpi ) {
350  setMaxIntensity( bpi );
351  }
352 
353  if( m_bpm < 0.0 ) {
354  setBasePeakMass( bpm );
355  }
356  }
357  }
358 
359  // get precursor intensity
361 
362  // check the points
363  if( dps.getLength() == 0 ) {
364  return;
365  }
366 
367  // zero points
368  if( zero && m_autoZeroPoints ) {
369  double minX = -1.0;
370  if( m_minX ) {
371  minX = m_minX.get();
372  }
373 
374  double maxX = -1.0;
375  if( m_maxX ) {
376  maxX = m_maxX.get();
377  }
378 
379  const double space = DEFAULT_RESOLUTION;
380 
381  // the first point
382  double prevX = dps.getX( 0 );
383  if( prevX > 0.0 && prevX > minX ) {
384  prevX = prevX - space / 3.0;
385  if( prevX < 0.0 ) {
386  prevX = 0.0;
387  }
388  if( prevX < minX ) {
389  prevX = minX;
390  }
391 
392  xyData->addPoint( prevX, 0.0 );
393  }
394 
395  // each points
396  for( unsigned int i = 0; i < dps.getLength(); i++ ) {
397  const double x = dps.getX( i );
398  const double y = dps.getY( i );
399 
400  const double d = x - prevX;
401 
402  if( d > space ) {
403  const double startX = prevX + space / 3.0;
404  const double endX = x - space / 3.0;
405 
406  xyData->addPoint( startX, 0.0 );
407 
408  const int num = (int)( ( endX - startX ) / space );
409 
410  for( int j = 0; j < num; j++ ) {
411  double midX = startX + (double)j * ( endX - startX ) / (double)( num + 2 );
412  if( midX > startX && midX < endX ) {
413  xyData->addPoint( midX, 0.0 );
414  }
415  }
416 
417  xyData->addPoint( endX, 0.0 );
418  }
419 
420  xyData->addPoint( x, y );
421 
422  prevX = x;
423  }
424 
425  // last point
426  if( maxX < 0.0 || prevX < maxX ) {
427  prevX = prevX + space / 3.0;
428  if( maxX >= 0.0 && prevX > maxX ) {
429  prevX = maxX;
430  }
431 
432  xyData->addPoint( prevX, 0.0 );
433  }
434  }
435  else {
436  for( unsigned int i = 0; i < dps.getLength(); i++ ) {
437  xyData->addPoint( dps.getX( i ), dps.getY( i ) );
438  }
439  }
440 }
double getPrecursorIntensity()
gets the precursor intensity of the precursor ion spectrum.
Definition: Spectrum.cpp:797
void setTotalIntensity(const double intensity)
sets total intensity of spectrum
Definition: Spectrum.cpp:505
void setMaxIntensity(const double intensity)
sets max intensity of spectrum
Definition: Spectrum.cpp:537
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
double getMinX()
gets min x
Definition: Spectrum.cpp:461
double getMaxX()
gets max x
Definition: Spectrum.cpp:489
#define NULL
Definition: CoreMacros.h:18
void setBasePeakMass(const double mass)
sets base peak mass
Definition: Spectrum.cpp:569
virtual void onGetXYData(kome::core::XYData *const xyData, const double minX, const double maxX)=0
This method is called by getXYData method. (abstract method)
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::objects::Spectrum::hasChromatogram ( )

judges whether this spectrum has chromatogram

Returns
where this spectrum has chromatogram

Definition at line 888 of file Spectrum.cpp.

888  {
889  return m_chrom;
890 }
bool kome::objects::Spectrum::isAutoZeroPoints ( )

gets auto zero points flag value

Returns
auto zero points flag value

Definition at line 988 of file Spectrum.cpp.

988  {
989  return m_autoZeroPoints;
990 }
bool kome::objects::Spectrum::isCentroidMode ( )

judget wheter this spectrum is centroid mode

Returns
If true, this spectrum is centroid mode.

Definition at line 941 of file Spectrum.cpp.

941  {
942  return m_centroidMode;
943 }
static bool kome::objects::Spectrum::isCommonProperty ( const char *  key)
static

check whther the specified property key is common property or not

Parameters
[in]keyparameter key
Returns
If true, specified key is common property key

Definition at line 1083 of file Spectrum.cpp.

1083  {
1084  // common properties
1085  const char* keys[] = {
1086  "Name",
1087  "RT",
1088  "Start RT",
1089  "End RT",
1090  "Low Mass",
1091  "High Mass",
1092  "TIC",
1093  "BPI",
1094  "BPM",
1095  "Stage",
1096  "Precursor",
1097  "Precursor Intensity",
1098  "Scan Number",
1099  "Polarity",
1100  "Centroid Mode",
1101  "Resolution",
1102  "Collision Energy",
1103  "Spectrum Type",
1104  "Title"
1105  };
1106 
1107  // create array
1108  if( m_commonProps.size() == 0 ) {
1109  const unsigned int num = sizeof( keys ) / sizeof( const char* );
1110 
1111  for( unsigned int i = 0; i < num; i++ ) {
1112  m_commonProps.push_back( keys[ i ] );
1113  }
1114  }
1115 
1116  // check the key
1117  if( key == NULL ) {
1118  return false;
1119  }
1120 
1121  for( unsigned int i = 0; i < m_commonProps.size(); i++ ) {
1122  if( m_commonProps[ i ].compare( key ) == 0 ) {
1123  return true;
1124  }
1125  }
1126 
1127  return false;
1128 }
static std::vector< std::string > m_commonProps
Definition: Spectrum.h:169
#define NULL
Definition: CoreMacros.h:18
bool kome::objects::Spectrum::isFirstAccess ( void  )

check the flag of first access

Returns
If true, enable flag of first access

Definition at line 1198 of file Spectrum.cpp.

1199 {
1200  return onIsFirstAccess( );
1201 }
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::objects::Spectrum::isRequestLoadData ( void  )

check the flag of request load data

Returns
If true, enable flag of request load data

Definition at line 1176 of file Spectrum.cpp.

1177 {
1178  return onIsRequestLoadData( );
1179 }
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::objects::Spectrum::isVisible ( )

gets the visible flag value

Returns
visible flag value

Definition at line 978 of file Spectrum.cpp.

978  {
979  return m_visible;
980 }
bool kome::objects::Spectrum::loadData ( void  )

load data

Returns
If true, file reading success.

Definition at line 1204 of file Spectrum.cpp.

1205 {
1206  return onLoadData( );
1207 }
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:

double kome::objects::Spectrum::onGetMaxIntensity ( const double  minX,
const double  maxX 
)
protectedpure virtual

This method is called by getMaxIntensity method. (abstract 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

Implemented in kome::operation::TransformedSpectrum, kome::objects::AveragedSpectrum, kome::objects::OverlappingSpectrum, and kome::operation::ManipulatedSpectrum.

double kome::objects::Spectrum::onGetTotalIntensity ( const double  minX,
const double  maxX 
)
protectedpure virtual

This method is called by getTotalIntensity method. (abstract 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

Implemented in kome::operation::TransformedSpectrum, kome::objects::AveragedSpectrum, kome::objects::OverlappingSpectrum, and kome::operation::ManipulatedSpectrum.

void kome::objects::Spectrum::onGetXRange ( double *  minX,
double *  maxX 
)
protectedpure virtual

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

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

Implemented in kome::operation::TransformedSpectrum, kome::objects::AveragedSpectrum, kome::objects::OverlappingSpectrum, and kome::operation::ManipulatedSpectrum.

void kome::objects::Spectrum::onGetXYData ( kome::core::XYData *const  xyData,
const double  minX,
const double  maxX 
)
protectedpure virtual

This method is called by getXYData method. (abstract 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.)

Implemented in kome::operation::TransformedSpectrum, kome::objects::AveragedSpectrum, kome::objects::OverlappingSpectrum, and kome::operation::ManipulatedSpectrum.

bool kome::objects::Spectrum::onIsFirstAccess ( void  )
protectedvirtual

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

Returns
If true, the first accessing.

Reimplemented in kome::operation::TransformedSpectrum, and kome::operation::ManipulatedSpectrum.

Definition at line 1240 of file Spectrum.cpp.

1241 {
1242  return false;
1243 }
bool kome::objects::Spectrum::onIsRequestLoadData ( void  )
protectedvirtual

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

Returns
If true, file read request is valid.

Reimplemented in kome::operation::TransformedSpectrum, and kome::operation::ManipulatedSpectrum.

Definition at line 1222 of file Spectrum.cpp.

1223 {
1224  return false;
1225 }
bool kome::objects::Spectrum::onLoadData ( void  )
protectedvirtual

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

Returns
If true, file reading success.

Reimplemented in kome::operation::TransformedSpectrum, and kome::operation::ManipulatedSpectrum.

Definition at line 1246 of file Spectrum.cpp.

1247 {
1248  return true;
1249 }
void kome::objects::Spectrum::setAutoZeroPoints ( const bool  autoZero)

sets auto zero points flag value

Parameters
[in]autoZeroauto zero points flag value.

Definition at line 983 of file Spectrum.cpp.

983  {
984  m_autoZeroPoints = autoZero;
985 }
void kome::objects::Spectrum::setBasePeakMass ( const double  mass)

sets base peak mass

Parameters
[in]massbase peak mass

Definition at line 569 of file Spectrum.cpp.

569  {
570  if( mass >= 0.0 ) {
571  m_props.setDoubleValue( "BPM", mass );
572  }
573  else {
574  m_props.setValue( "BPM", "" );
575  }
576 
577  m_bpm = mass;
578 }
void setValue(const char *key, const char *value)
sets parameter value
Definition: Properties.cpp:39
void setDoubleValue(const char *key, double value)
sets parameter value
Definition: Properties.cpp:62

Here is the call graph for this function:

void kome::objects::Spectrum::setCentroidMode ( const bool  centroidMode)

sets centroid mode or not

Parameters
[in]centroidModeIf true, this spectrum is centroid mode.

Definition at line 935 of file Spectrum.cpp.

935  {
936  m_props.setBoolValue( "Centroid Mode", centroidMode );
937  m_centroidMode = centroidMode;
938 }
void setBoolValue(const char *key, bool value)
sets parameter value
Definition: Properties.cpp:67

Here is the call graph for this function:

void kome::objects::Spectrum::setCollisionEnergy ( const char *  collisionEnergy)

sets the collision energy

Parameters
[in]collisionEnergycollision energy

Definition at line 957 of file Spectrum.cpp.

957  {
958  m_props.setValue( "Collision Energy", NVL( collisionEnergy, "" ) );
959  m_collisionEnergy = NVL( collisionEnergy, "" );
960 }
void setValue(const char *key, const char *value)
sets parameter value
Definition: Properties.cpp:39
#define NVL(checkVal, replaceVal)
Definition: CoreMacros.h:99

Here is the call graph for this function:

void kome::objects::Spectrum::setEndRt ( const double  rt)

sets end retention time

Parameters
[in]rtend retention time

Definition at line 172 of file Spectrum.cpp.

172  {
173  if( rt >= 0.0 ) {
174  m_props.setDoubleValue( "End RT", rt );
175  }
176  else {
177  m_props.setValue( "End RT", "" );
178  }
179 
180  m_rt.end = rt;
181 }
void setValue(const char *key, const char *value)
sets parameter value
Definition: Properties.cpp:39
void setDoubleValue(const char *key, double value)
sets parameter value
Definition: Properties.cpp:62

Here is the call graph for this function:

void kome::objects::Spectrum::setGroup ( DataGroupNode group)

sets spectrum group

Parameters
[in]groupspectrum group

Definition at line 893 of file Spectrum.cpp.

893  {
894  m_group = group;
895 }
void kome::objects::Spectrum::setHasChromatogram ( const bool  chromatogram)

sets wheher this spectrum has chromatogram

Parameters
[in]chromatogramwhether this spectrum has chromatogram

Definition at line 883 of file Spectrum.cpp.

883  {
884  m_chrom = chromatogram;
885 }
void kome::objects::Spectrum::setIcon ( const char *  icon)

sets icon name

Returns
icon name

Definition at line 268 of file Spectrum.cpp.

268  {
269  m_icon = std::string( NVL( icon, "" ) );
270 }
#define NVL(checkVal, replaceVal)
Definition: CoreMacros.h:99
void kome::objects::Spectrum::setId ( int  id)

sets spectrum id

Parameters
[in]idspectrum id

Definition at line 1131 of file Spectrum.cpp.

1131  {
1132  m_specId = id;
1133 }
void kome::objects::Spectrum::setMaxIntensity ( const double  intensity)

sets max intensity of spectrum

Parameters
[in]intensitymax intensity

Definition at line 537 of file Spectrum.cpp.

537  {
538  if( intensity > 0.0 ) {
539  m_props.setDoubleValue( "BPI", intensity );
540  m_bpi = intensity;
541  }
542  else {
543  m_props.setValue( "BPI", "" );
544  }
545 }
void setValue(const char *key, const char *value)
sets parameter value
Definition: Properties.cpp:39
void setDoubleValue(const char *key, double value)
sets parameter value
Definition: Properties.cpp:62

Here is the call graph for this function:

void kome::objects::Spectrum::setMaxX ( const double  maxX)

sets max x

Parameters
[in]maxXmax x

Definition at line 477 of file Spectrum.cpp.

477  {
478  if( maxX >= 0.0 ) {
479  m_props.setDoubleValue( "High Mass", maxX );
480  }
481  else {
482  m_props.setValue( "High Mass", "" );
483  }
484 
485  m_maxX = maxX;
486 }
void setValue(const char *key, const char *value)
sets parameter value
Definition: Properties.cpp:39
void setDoubleValue(const char *key, double value)
sets parameter value
Definition: Properties.cpp:62

Here is the call graph for this function:

void kome::objects::Spectrum::setMinX ( const double  minX)

sets min x

Parameters
[in]minXmin x

Definition at line 449 of file Spectrum.cpp.

449  {
450  if( minX >= 0.0 ) {
451  m_props.setDoubleValue( "Low Mass", minX );
452  }
453  else {
454  m_props.setValue( "Low Mass", "" );
455  }
456 
457  m_minX = minX;
458 }
void setValue(const char *key, const char *value)
sets parameter value
Definition: Properties.cpp:39
void setDoubleValue(const char *key, double value)
sets parameter value
Definition: Properties.cpp:62

Here is the call graph for this function:

void kome::objects::Spectrum::setMsStage ( const int  stage)

sets ms stage

Parameters
[in]stagems stage

Definition at line 587 of file Spectrum.cpp.

587  {
588  // properties
589  if( stage > 0 ) {
590  m_props.setIntValue( "Stage", stage );
591  }
592  else {
593  m_props.setValue( "Stage", "" );
594  }
595 
596  for( int i = 1; i < m_msStage; i++ ) {
597  std::string key = FMT( "Precursor%d (Mass)", i );
598  m_props.setValue( key.c_str(), "" );
599 
600  key = FMT( "Precursor%d (Intensity)", i );
601  m_props.setValue( key.c_str(), "" );
602  }
603 
604  // stage
605  m_msStage = stage;
606 
607  // precursor
608  int idx = -1;
609  double prec = -1.0;
610  double intensity = -1.0;
611 
612  for( unsigned int i = 0; i < m_precursor.size() && idx < 0; i++ ) {
613  if( m_precursor[ i ].stage < 0 ) {
614  idx = (int)i;
615  prec = m_precursor[ i ].precursor;
616  intensity = m_precursor[ i ].intensity;
617  }
618  }
619 
620  if( idx >= 0 ) {
621  m_precursor.erase( m_precursor.begin() + idx );
622 
623  if( prec >= 0.0 ) {
624  setPrecursor( stage - 1, prec );
625  }
626 
627  if( intensity >= 0.0 ) {
628  setPrecursorIntensity( stage - 1, intensity );
629  }
630  }
631 }
void setPrecursor(const int stage, const double precursor)
sets precursor
Definition: Spectrum.cpp:640
void setPrecursorIntensity(const int stage, const double intensity)
sets precursor intensity
Definition: Spectrum.cpp:702
void setValue(const char *key, const char *value)
sets parameter value
Definition: Properties.cpp:39
void setIntValue(const char *key, int value)
sets parameter value
Definition: Properties.cpp:57

Here is the call graph for this function:

void kome::objects::Spectrum::setName ( const char *  name)

sets spectrum name

Parameters
[in]namespectrum name

Definition at line 113 of file Spectrum.cpp.

113  {
114  m_name = std::string( NVL( name, "" ) ) ;
115  if( m_title.empty() ) {
116  setTitle( name );
117  }
118 
119  m_props.setValue( "Name", m_name.c_str() );
120 }
void setValue(const char *key, const char *value)
sets parameter value
Definition: Properties.cpp:39
#define NVL(checkVal, replaceVal)
Definition: CoreMacros.h:99
void setTitle(const char *title)
sets spectrum title
Definition: Spectrum.cpp:215

Here is the call graph for this function:

void kome::objects::Spectrum::setOperationFlag ( const bool  op)
inline

sets the operation flag value

Parameters
[in]opoperation flag value

Definition at line 195 of file Spectrum.h.

195 { m_op = op; }
void kome::objects::Spectrum::setOrgSpectrum ( Spectrum spec)

sets original spectrum

Parameters
[in]specorignal spectrum

Definition at line 998 of file Spectrum.cpp.

998  {
999  m_orgSpec = spec;
1000 }
Spectrum * m_orgSpec
Definition: Spectrum.h:162
void kome::objects::Spectrum::setParentSpectrum ( Spectrum *const  parent)

sets parent spectrum

Parameters
[in]parentparent spectrum oebject. (If this spectrum has no parent, this parameter is NULL.)

Definition at line 821 of file Spectrum.cpp.

821  {
822  // set parent spectrum
823  m_parentSpec = parent;
824 
825  // precursor
826  std::set< Spectrum* > parentSet;
827  parentSet.insert( this );
828  parentSet.insert( parent );
829  Spectrum* p = parent;
830  while( p != NULL ) {
831  int stage = p->getMsStage() - 1;
832  if( stage > 0 ) {
833  double precursor = getPrecursor( stage );
834  if( precursor < 0.0 ) {
835  precursor = p->getPrecursor();
836  setPrecursor( stage, precursor );
837  }
838  }
839  p = p->getParentSpectrum();
840  if( parentSet.find( p ) == parentSet.end() ) {
841  parentSet.insert( p );
842  }
843  else {
844  p = NULL;
845  }
846  }
847 }
double getPrecursor(const int stage)
gets precursor
Definition: Spectrum.cpp:683
void setPrecursor(const int stage, const double precursor)
sets precursor
Definition: Spectrum.cpp:640
int getMsStage()
gets ms stage
Definition: Spectrum.cpp:634
#define NULL
Definition: CoreMacros.h:18
double getPrecursor()
gets the precursor mass of precursor ion spectrum.
Definition: Spectrum.cpp:695
Spectrum * getParentSpectrum()
gets parent spectrum
Definition: Spectrum.cpp:850
spectrum information management class
Definition: Spectrum.h:30

Here is the call graph for this function:

void kome::objects::Spectrum::setPolarity ( Polarity  polarity)

sets polarity

Parameters
[in]polaritypolarity

Definition at line 920 of file Spectrum.cpp.

920  {
921  m_props.setValue(
922  "Polarity",
923  ( polarity == POLARITY_POSITIVE ? "+" : (polarity == POLARITY_NEGATIVE ? "-" : "" ) )
924  );
925 
926  m_polarity = polarity;
927 }
void setValue(const char *key, const char *value)
sets parameter value
Definition: Properties.cpp:39

Here is the call graph for this function:

void kome::objects::Spectrum::setPrecursor ( const int  stage,
const double  precursor 
)

sets precursor

Parameters
[in]stageMS stage of precursor ion spectrum.
[in]precursorprecursor mass

Definition at line 640 of file Spectrum.cpp.

640  {
641  // property
642  if( stage >= 1 ) {
643  std::string key = FMT( "Precursor%d (Mass)", stage );
644  m_props.setDoubleValue( key.c_str(), precursor );
645 
646  key = FMT( "Precursor%d (Intensity)", stage );
647  if( !m_props.hasKey( key.c_str() ) ) {
648  m_props.setValue( key.c_str(), "" );
649  }
650  }
651 
652  if( m_msStage > 1 && stage == m_msStage - 1 ) {
653  m_props.setDoubleValue( "Precursor", precursor );
654  }
655 
656  // search
657  for( unsigned int i = 0; i < m_precursor.size(); i++ ) {
658  if( m_precursor[ i ].stage == stage ) {
659  m_precursor[ i ].precursor = precursor;
660  return;
661  }
662  }
663 
664  // add
665  m_precursor.resize( m_precursor.size() + 1 );
666  m_precursor.back().stage = stage;
667  m_precursor.back().intensity = -1.0;
668  m_precursor.back().precursor = precursor;
669 }
void setValue(const char *key, const char *value)
sets parameter value
Definition: Properties.cpp:39
bool hasKey(const char *key)
judges whether this object has specified parameter key
Definition: Properties.cpp:93
void setDoubleValue(const char *key, double value)
sets parameter value
Definition: Properties.cpp:62

Here is the call graph for this function:

void kome::objects::Spectrum::setPrecursor ( const double  precursor)

sets precursor

Parameters
[in]precursorprecursor mass

Definition at line 672 of file Spectrum.cpp.

672  {
673  // stage
674  if( m_msStage > 1 ) {
675  setPrecursor( m_msStage - 1, precursor );
676  }
677  else {
678  setPrecursor( -1, precursor );
679  }
680 }
void setPrecursor(const int stage, const double precursor)
sets precursor
Definition: Spectrum.cpp:640

Here is the call graph for this function:

void kome::objects::Spectrum::setPrecursorCharge ( const int  charge)

sets the precursor charge

Parameters
[in]chargeprecursor charge

Definition at line 804 of file Spectrum.cpp.

804  {
805  m_charge = charge;
806 
807  if( charge > 0 ) {
808  m_props.setIntValue( "Precursor Charge", charge );
809  }
810  else {
811  m_props.setValue( "Precursor Charge", "" );
812  }
813 }
void setValue(const char *key, const char *value)
sets parameter value
Definition: Properties.cpp:39
void setIntValue(const char *key, int value)
sets parameter value
Definition: Properties.cpp:57

Here is the call graph for this function:

void kome::objects::Spectrum::setPrecursorIntensity ( const int  stage,
const double  intensity 
)

sets precursor intensity

Parameters
[in]stageMS stage of precursor ion spectrum
[in]intensityprecursor intensity

Definition at line 702 of file Spectrum.cpp.

702  {
703  // check parameters
704  if( intensity < 0.0 ) {
705  return;
706  }
707 
708  // property
709  if( stage >= 1 ) {
710  std::string key = FMT( "Precursor%d (Mass)", stage );
711  if( !m_props.hasKey( key.c_str() ) ) {
712  m_props.setValue( key.c_str(), "" );
713  }
714 
715  key = FMT( "Precursor%d (Intensity)", stage );
716  m_props.setDoubleValue( key.c_str(), intensity );
717  }
718 
719  if( m_msStage > 1 && stage == m_msStage - 1 ) {
720  m_props.setDoubleValue( "Precursor Intensity", intensity );
721  }
722 
723  // search
724  for( unsigned int i = 0; i < m_precursor.size(); i++ ) {
725  if( m_precursor[ i ].stage == stage ) {
726  m_precursor[ i ].intensity = intensity;
727  return;
728  }
729  }
730 
731  // add
732  m_precursor.resize( m_precursor.size() + 1 );
733  m_precursor.back().stage = stage;
734  m_precursor.back().precursor = -1.0;
735  m_precursor.back().intensity = intensity;
736 }
void setValue(const char *key, const char *value)
sets parameter value
Definition: Properties.cpp:39
bool hasKey(const char *key)
judges whether this object has specified parameter key
Definition: Properties.cpp:93
void setDoubleValue(const char *key, double value)
sets parameter value
Definition: Properties.cpp:62

Here is the call graph for this function:

void kome::objects::Spectrum::setPrecursorIntensity ( const double  intensity)

sets precursor intensity

Parameters
[in]intensityprecursor intensity

Definition at line 739 of file Spectrum.cpp.

739  {
740  if( m_msStage > 1 ) {
741  setPrecursorIntensity( m_msStage - 1, intensity );
742  }
743  else {
744  setPrecursorIntensity( -1, intensity );
745  }
746 }
void setPrecursorIntensity(const int stage, const double intensity)
sets precursor intensity
Definition: Spectrum.cpp:702

Here is the call graph for this function:

void kome::objects::Spectrum::setRequestLoadData ( void  )

set the flag of request load data

reset the flag of request load data

Definition at line 1160 of file Spectrum.cpp.

1161 {
1163 
1164  return;
1165 }
virtual void onSetRequestLoadData(void)
This method is called by setRequestLoadData method. (abstract method)
Definition: Spectrum.cpp:1210

Here is the call graph for this function:

void kome::objects::Spectrum::setResolution ( const double  resolution)

sets resolution

Parameters
[in]resolutionresolution

Definition at line 946 of file Spectrum.cpp.

946  {
947  m_props.setDoubleValue( "Resolution", resolution );
948  m_resolution = resolution;
949 }
void setDoubleValue(const char *key, double value)
sets parameter value
Definition: Properties.cpp:62

Here is the call graph for this function:

void kome::objects::Spectrum::setRt ( const double  rt)

sets retention time

Parameters
[in]rtretention time

Definition at line 129 of file Spectrum.cpp.

129  {
130  // properties
131  if( rt >= 0.0 ) {
132  m_props.setDoubleValue( "RT", rt );
133  m_props.setDoubleValue( "Start RT", rt );
134  m_props.setDoubleValue( "End RT", rt );
135  }
136  else {
137  m_props.setValue( "RT", "" );
138  m_props.setValue( "Start RT", "" );
139  m_props.setValue( "End RT", "" );
140  }
141 
142  // RT
143  setRt( rt, rt );
144 }
void setRt(const double rt)
sets retention time
Definition: Spectrum.cpp:129
void setValue(const char *key, const char *value)
sets parameter value
Definition: Properties.cpp:39
void setDoubleValue(const char *key, double value)
sets parameter value
Definition: Properties.cpp:62

Here is the call graph for this function:

void kome::objects::Spectrum::setRt ( const double  startRt,
const double  endRt 
)

gets retention time

Parameters
[in]startRtthe start retention time
[in]endRtthe end retention time

Definition at line 147 of file Spectrum.cpp.

147  {
148  if( startRt >= 0.0 && endRt >= 0.0 ) {
149  m_props.setDoubleValue( "RT", ( startRt + endRt ) / 2.0 );
150  }
151  else {
152  m_props.setValue( "RT", "" );
153  }
154 
155  setStartRt( startRt );
156  setEndRt( endRt );
157 }
void setValue(const char *key, const char *value)
sets parameter value
Definition: Properties.cpp:39
void setEndRt(const double rt)
sets end retention time
Definition: Spectrum.cpp:172
void setStartRt(const double rt)
sets start retention time
Definition: Spectrum.cpp:160
void setDoubleValue(const char *key, double value)
sets parameter value
Definition: Properties.cpp:62

Here is the call graph for this function:

void kome::objects::Spectrum::setScanNumber ( const int  scan)

sets scan number

Parameters
[in]scanscan number

Definition at line 903 of file Spectrum.cpp.

903  {
904  if( scan >= 0 ) {
905  m_props.setIntValue( "Scan Number", scan );
906  }
907  else {
908  m_props.setValue( "Scan Number", "" );
909  }
910 
911  m_scanNumber = scan;
912 }
void setValue(const char *key, const char *value)
sets parameter value
Definition: Properties.cpp:39
void setIntValue(const char *key, int value)
sets parameter value
Definition: Properties.cpp:57

Here is the call graph for this function:

void kome::objects::Spectrum::setSpecType ( const char *  type)

sets spectrum type

Parameters
[in]typespectrum type

Definition at line 203 of file Spectrum.cpp.

203  {
204  m_specType = trimstring( type );
205  m_props.setValue( "Spectrum Type", m_specType.c_str() );
206 }
void setValue(const char *key, const char *value)
sets parameter value
Definition: Properties.cpp:39
std::string trimstring(const char *s)
remove white spaces from both ends of specified string

Here is the call graph for this function:

void kome::objects::Spectrum::setStartRt ( const double  rt)

sets start retention time

Parameters
[in]rtstart retention time

Definition at line 160 of file Spectrum.cpp.

160  {
161  if( rt >= 0.0 ) {
162  m_props.setDoubleValue( "Start RT", rt );
163  }
164  else {
165  m_props.setValue( "Start RT", "" );
166  }
167 
168  m_rt.start = rt;
169 }
void setValue(const char *key, const char *value)
sets parameter value
Definition: Properties.cpp:39
void setDoubleValue(const char *key, double value)
sets parameter value
Definition: Properties.cpp:62

Here is the call graph for this function:

void kome::objects::Spectrum::setTitle ( const char *  title)

sets spectrum title

Parameters
[in]titlespectrum title

Definition at line 215 of file Spectrum.cpp.

215  {
216  // title
217  m_title = trimstring( title );
218  m_props.setValue( "Title", m_title.c_str() );
219 }
void setValue(const char *key, const char *value)
sets parameter value
Definition: Properties.cpp:39
std::string trimstring(const char *s)
remove white spaces from both ends of specified string

Here is the call graph for this function:

void kome::objects::Spectrum::setTotalIntensity ( const double  intensity)

sets total intensity of spectrum

Parameters
[in]intensitytotal intensity.

Definition at line 505 of file Spectrum.cpp.

505  {
506  if( intensity > 0.0 ) {
507  m_props.setDoubleValue( "TIC", intensity );
508  m_tic = intensity;
509  }
510  else {
511  m_props.setValue( "TIC", "" );
512  }
513 }
void setValue(const char *key, const char *value)
sets parameter value
Definition: Properties.cpp:39
void setDoubleValue(const char *key, double value)
sets parameter value
Definition: Properties.cpp:62

Here is the call graph for this function:

void kome::objects::Spectrum::setVisible ( const bool  visible)

sets the visible flag

Parameters
[in]visiblevisible flag value

Definition at line 973 of file Spectrum.cpp.

973  {
974  m_visible = visible;
975 }
void kome::objects::Spectrum::setXRange ( const double  minX,
const double  maxX 
)

sets x range

Parameters
[in]minXmin x
[in]maxXmax x

Definition at line 443 of file Spectrum.cpp.

443  {
444  setMinX( minX );
445  setMaxX( maxX );
446 }
void setMinX(const double minX)
sets min x
Definition: Spectrum.cpp:449
void setMaxX(const double maxX)
sets max x
Definition: Spectrum.cpp:477

Here is the call graph for this function:

Member Data Documentation

std::vector< std::string > Spectrum::m_commonProps
staticprotected

common properties

Definition at line 169 of file Spectrum.h.

bool kome::objects::Spectrum::m_op
protected

operation flag

Definition at line 165 of file Spectrum.h.

Spectrum* kome::objects::Spectrum::m_orgSpec
protected

original spectrum

Definition at line 162 of file Spectrum.h.

int kome::objects::Spectrum::m_specId
protected

spectrum id

Definition at line 172 of file Spectrum.h.


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