isotopiccluster.h

00001 #ifndef _ISOTOPIC_CLUSTER_H_
00002 #define _ISOTOPIC_CLUSTER_H_
00003 
00004 /* Copyright (c) Kyriacos Leptos and the President and Fellows of Harvard University
00005    Release Date: 2004-11-01
00006    Part of the MapQuant suite library "mqobject.lib" 
00007 */
00008 
00009 #define CARBON_RICH 16.34
00010 #define CARBON_POOR 34.34
00011 
00012 #define ISOTOPIC_CLUSTER_ARRAY_FITTED_MAX_SIZE 5
00013 
00014 
00015 extern int ISOTOPIC_CLUSTER_ARRAY_MAX_SIZE;
00016 
00017 extern int ISOCLUSTER_SCORE_RT_SD_WIDTH;
00018 extern int ISOCLUSTER_SCORE_RT_SD_DECIMAL_PLACES;
00019 
00020 extern int ISOCLUSTER_SCORE_DELTA_MZ_SD_WIDTH;
00021 extern int ISOCLUSTER_SCORE_DELTA_MZ_SD_DECIMAL_PLACES;
00022 
00023 extern int ISOCLUSTER_SCORE_DELTA_MZ_WIDTH;
00024 extern int ISOCLUSTER_SCORE_DELTA_MZ_DECIMAL_PLACES;
00025 
00026 extern int ISOCLUSTER_SCORE_NORM_ABU_WIDTH;
00027 extern int ISOCLUSTER_SCORE_NORM_ABU_DECIMAL_PLACES;
00028 
00029 struct IsotopicCluster
00030 {
00031     unsigned            isSubset: 1;
00032     
00033     unsigned int        isValid;
00034 
00035     char*               szSession;
00036     int                 peakgroup;
00037 
00038     int                *index_array;
00039     FPeak2iPointer     *pPFPeaks;       //Array of pointers of FPeak
00040     FPeak2i            *pFPeaks;
00041     int                 nFPeaks;
00042     
00043     int                *zarray;
00044 
00045     float               dCharge;
00046 
00047     float               ab_avg;
00048     float               norm_abu;
00049 
00050     float               rt_avg;
00051     float               rt_sd;
00052 
00053     float               mz_avg;
00054 
00055     float               delta_mz_avg;
00056     float               delta_mz_sd;
00057     float               delta_mz_score;
00058 
00059     int                 ncupper;
00060     int                 nclower;
00061     int                 ncarbons;       
00062     int                 mip;
00063     float               dev;
00064 
00065     float               score;
00066 };
00067 
00068 typedef struct IsotopicCluster IsotopicCluster;
00069 
00070 typedef IsotopicCluster* IsotopicClusterPointer;
00071 
00072 int                     findSubsetClusters(PeakGroup* PG);
00073 int                     isClusterSubsetOfSubset(IsotopicCluster IC1, IsotopicCluster IC2);
00074 int                     doesFPeak2iBelongToCluster(FPeak2iPointer pfpeak, IsotopicCluster IC);
00075 
00076 // Enumeration of properties
00077 
00078 #define IC_NPEAKS           0x00000001
00079 #define IC_ABUNDANCE        0x00000002
00080 #define IC_CHARGE           0x00000004
00081 #define IC_PEAKGROUP        0x00000008
00082 #define IC_CARBONS          0x00000010
00083 #define IC_FUNDAMENTAL      0x00000020
00084 #define IC_PRIMARY_PEAK2I   0x00000040
00085 #define IC_RT               0x00000080
00086 #define IC_MS2              0x00000100
00087 #define IC_SCORE            0x00000200
00088 #define IC_MZ               0x00000400
00089 
00090 enum {ISOTOPIC_CLUSTER_FORMAT_TABLE, ISOTOPIC_CLUSTER_FORMAT_WITH_HEADER};
00091 
00092 void IsotopicCluster_destroy(IsotopicCluster *cluster);
00093 void IsotopicCluster_fprint(FILE* fp, IsotopicCluster* cluster, int index, int format);
00094 void IsotopicCluster_init       (IsotopicCluster* isc, int npeaks);
00095 
00096 int IsotopicCluster_cmpByCharge       (const void *p1, const void *p2);
00097 int IsotopicCluster_cmpByRT           (const void *p1, const void *p2);
00098 int IsotopicCluster_cmpByMZ           (const void *p1, const void *p2); 
00099 int IsotopicCluster_cmpByAbundance    (const void *p1, const void *p2);
00100 int IsotopicCluster_cmpByNPeaks       (const void *p1, const void *p2);
00101 int IsotopicCluster_cmpByPrimaryPeak2i(const void *p1, const void *p2);
00102 int IsotopicCluster_cmpByScore        (const void *p1, const void *p2);
00103 
00104 int     IsotopicCluster_calcCarbonBounds(IsotopicCluster* cluster);
00105 void    IsotopicCluster_calcRT(IsotopicCluster* IC);
00106 void    IsotopicCluster_calcDeltaMZ (IsotopicCluster* IC);
00107 void    IsotopicCluster_calcTotalAbu(IsotopicCluster* IC);
00108 float   IsotopicCluster_calcAvgSigmaMZ(IsotopicCluster* IC);
00109 
00110 void    IsotopicCluster_setPeakGroup(IsotopicCluster* ic, int peakgroup);
00111 void    IsotopicCluster_fixCharge(IsotopicCluster* IC, int charge);
00112 void    IsotopicCluster_createFromFPeak2i(IsotopicCluster* IC, FPeak2i* pFPeak);
00113 
00114 void    IsotopicCluster_rectangleQuantitation(IsotopicCluster* ic, Map2D* map, Rectangle4i rect);
00115 
00116 int     IsotopicClusterPointer_cmpByPrimaryPeak2i(const void *p1, const void *p2);
00117 void    IsotopicClusterPointerArray_sortByPrimaryPeak2i(IsotopicClusterPointer* ICPArray, int nicp);
00118 
00119 #endif
00120 
00121 

Generated on Tue Feb 7 11:54:26 2006 for libmqobject by  doxygen 1.4.6