Institute for Advanced Biosciences Keio University
MathDAMP Mathematica package for differential analysis of metabolite profiles
Home Overview Examples Downloads TriDAMP References Contact
MathDAMP > Examples > MathDAMP source > Core Functionality > Extracting chromatograms/electropherograms from data

Extracting chromatograms/electropherograms from data

DAMPGetIntensities[msdata,mz] returns a list of signal intensities from msdata corresponding to m/z mz.
DAMPGetChromatogram[msdata,mz] returns a chromatogram/electropherogram (list of {time,signal intensity}) from msdata corresponding to m/z mz. Since the m/z values in msdata are of type Real, the mz parameter is multiplied by 1. to convert it to a Real type value (for cases when it is passed as an Integer).
The _?(Chop[1. mz-#]==0&) construct is the argument of the Position function to match values slightly different due to roundoff or truncation errors.

DAMPGetIntensities[msdata_, mz_] := msdata〚1, Position[msdata〚2〛, _ ? (Chop[1. mz - #] 0&)] 〚1, 1〛〛

DAMPGetChromatogram[msdata_, mz_] := Transpose[{msdata〚3〛, DAMPGetIntensities[msdata, mz]}]