tsProfile-class: Class for representing a MS profile

tsProfile-classR Documentation

Class for representing a MS profile


This is class used to represent a metabolite profile obtained with TargetSearch. This class contains the data you are most likely to use in downstream data analysis.


The metabolite profile information (slot info) is a data.frame that contains information regarding each target metabolite in the reference library (object tsLib). The information can be accessed with the method profileInfo. The profile include the following columns,

  • Name The metabolite/analyte name.

  • Lib_RI The reference or expected RI (retention index).

  • Mass_count The number of correlating masses.

  • Non_consecutive_Mass_count Same as mass count, but discounting consecutive masses that correspond with isotopic peaks, which often correlate anyway.

  • Sample_Count_per_Mass The number of samples in which each correlating mass was found. The values are separated by colons (;). The values of the actual masses are in following column.

  • Masses The correlating masses separated by colons (;).

  • RI The average RI detected in the samples.

  • Score_all_masses The similarity score calculated using the average intensity of all the masses that were searched for, regardless of whether they are correlating masses.

  • Score_cor_masses Same as above, but only correlating masses are considered.

Other columns could be present by they are carried over from the metabolite library tsLib object.

If the object is created by the function ProfileCleanUp instead, additional columns will be created with the prefix Cor_ followed by a string, such as Cor_RI. These columns contain information of “collapsed” metabolites that correlate to mean that they could conflict. The collapsed values are often separated by a vertical bar |.

The slots profRT, profRI and profInt contain averaged (median) values for each the matrices in the slots RT, RI, and Intensity. The values are computed only considering the masses that correlate (the other masses are ignored). They represent an average of RT, RI and Intensity per metabolite per sample, given that each selected mass has their own values and often only and average is needed. These matrices are accessed with the methods profileRT, profileRI and profileRT.

Similar to the tsMSdata assignment methods, the “setters” methods are exposed for convenience, though they should not be required. The reason is that all the objects are tightly tied and unexpected modifications could result in unintended errors. Use only if you know what you are doing.

Objects from the Class

Objects of this class are created by the functions Profile or ProfileCleanUp. There is no need to generate objects using new methods.



"data.frame", the metabolite profile information. See details.


"list", a list of RI matrices, one matrix per metabolite, in which rows represent select/top masses and columns correspond to samples.


"list", a list of RT matrices, one matrix per metabolite, in which rows represent select/top masses and columns correspond to samples.


"list", a list of peak-intensity matrices, one matrix per metabolite, and within each matrix, rows represent select/top masses and columns correspond to samples.


"matrix", the profile RI matrix.


"matrix", the profile RT matrix.


"matrix", the profile Intensity matrix.


This class extends tsMSdata directly. Methods that apply to that class apply to tsProfile.



signature(obj = "tsProfile"): get the profile information.


signature(obj = "tsProfile"): set the profile information.


signature(obj = "tsProfile"): get the profile intensity matrix.


signature(obj = "tsProfile"): set the profile intensity matrix.


signature(obj = "tsProfile"): get the profile RI matrix.


signature(obj = "tsProfile"): set the profile RI matrix.


signature(obj = "tsProfile"): get the profile RT matrix.


signature(obj = "tsProfile"): set the profile RT matrix.


signature(object = "tsProfile"): the show function.


For reasons explained in the details section, the methods profileRI<-, profileRT<-, profileInt<-, and profileInfo are considered deprecated and could be removed without notice in the feature.


Alvaro Cuadros-Inostroza

See Also

Profile, ProfileCleanUp, tsMSdata



# some example manipulations using object peakData

# extract the profile information of the metabolite analysis
info <- profileInfo(metabProfile)
# `info` is a data.frame with the information described in details

# extract profiled metabolite intensities
mat <- profileInt(metabProfile)

# It is possible to use the assignment methods such as `retIndex<-`,
# `Intensity<-`, `profileInt`, etc., in these objects, but it isn't
# recommended. Use only if if you know what you are doing.

## Not run: 
  profileInt(metabProfile) <- updatedMetabMatrix
  profileInfo(metabProfile) <- updatedMetabInfo

## End(Not run)

# in the mock examples above, the objects updated* are updated data.frame or
# matrices with metabolite results.

acinostroza/TargetSearch documentation built on May 5, 2024, 10:14 a.m.