Learn R Programming

isopat (version 1.0)

isopattern: Isotopic pattern calculation

Description

The function calculates the isotopic pattern (fine structures) for a given chemical formula. It returns a list of accurate masses, abundances and isotopic compositions. The isotopic characterisitics of all elements contained in a molecule can be defined by the user as argument to the function.

Usage

isopattern(iso_list, compound, limit)

Arguments

iso_list
a list or dataframe with four columns, specifying the isotopic composition of the elements found in the chemical formula of the compound (see dataset iso_list contained in this package): Column one contains the element name, e.g. C. Column two contain
compound
character string of a molecular formula for the compound for which an isotopic pattern needs to be calculated. All counts of all elements must be provided, i.e. C1H4 is a valid argument whereas CH4 is not. Element names must be followed by numbers (ato
limit
abundance limit; isotopic compositions equal to or below that abundance are dropped from further calculations.

Value

  • peaksA peak matrix with rows corresponding to single peaks; sorted by increasing masses. First column = mass. Second column = abundance. Third column = generation number. Fourth column = limit reached? Rest columns = isotopic composition of that isotopologue peak.

Details

Starting from a monoisotopic peak of a given molecule (e.g. C2H6, with atoms of all elements set to those isotopes with highest abundance), the isotopic compositions and the concomitant abundances of isotopologues are iteratively altered towards less abundant isotopes. For a first iteration (generation i=1), [12]C2[1]H6 would hence be changed to both [12]C1[13]C1[1]H6 and [12]C2[1]H5[2]H1. Similarly, the latter two isotopologues then again lead to two combinations each for C and H at the second generation i=2. At each generation level i, a number i of isotopes contained in the monoisotopic peak have been exchanged for less abundant isotopes over all possible combinatorial changes of size i. Abundances are checked for

References

Li, L., Kresh, J., Karabacak, N., Cobb, J., Agar, J. and Hong, P. (2008). A Hierarchical Algorithm for Calculating the Isotopic Fine Structures of Molecules. Journal of the American Society for Mass Spectrometry, 19, 1867--1874.

See Also

iso_list

Examples

Run this code
## firstly, load list of isotope data ##########################################
data(iso_list);
iso_list;

## calculate isotopic peaks for coffein-D9 #####################################
peaks<-isopattern(iso_list,"C8H1N4O2D9",1e-10);
peaks;
# plot with y = absolute abundance
plot(peaks[,1],peaks[,2],type="h",xlab="mass",ylab="absolute abundance");
# plot with y = relative abundance scaled to the most intensive peak
peaks2<-peaks;
peaks2[,2]<-peaks2[,2]/max(peaks2[,2]);
plot(peaks2[,1],peaks2[,2],type="h",xlab="mass",ylab="relative abundance");
# plot with y = relative abundance scaled to the monoisotopic peak
# which, in this case, makes no difference
peaks2<-peaks;
peaks2[,2]<-peaks2[,2]/peaks2[1,2];
plot(peaks2[,1],peaks2[,2],type="h",xlab="mass",ylab="relative abundance");

## calculate isotopic peaks for the hypothetical compound Cl500 ################
# use a too low value for limit -> plot shows only two peaks:
system.time(peaks<-isopattern(iso_list,"Cl500",1e-10));
plot(peaks[,1],peaks[,2],type="h",xlab="mass",ylab="absolute abundance");
# reset limit to a very low value for this "difficult" compound, then plot again:
system.time(peaks<-isopattern(iso_list,"Cl500",1e-100));
plot(peaks[,1],peaks[,2],type="h",xlab="mass",ylab="absolute abundance");

Run the code above in your browser using DataLab