tsLib-class {TargetSearch} | R Documentation |
This is a class representation of a reference library.
Objects can be created by the function ImportLibrary
.
Name
:"character"
, the metabolite or analyte names.RI
:"numeric"
, the expected retention time indices (RI) of the metabolites/analytes.medRI
:"numeric"
, the median RI calculated from the samples.RIdev
:"matrix"
, the RI deviation windows, k = 1,2,3. A three column matrixselMass
:"list"
, every component is a numeric vector containing the selective masses. topMass
:"list"
, every component is a numeric vector containing the top masses. libData
:"data.frame"
, additional library information. spectra
:"list"
, the metabolite spectra. Each component is a two column matrix: m/z and intensity. [
signature(x = "tsLib")
: Selects a subset of metabolites from the library.$name
signature(x = "tsLib")
: Access column name
of libData
slot. libId
signature(obj = "tsLib")
: Returns a vector of indices. length
signature(x = "tsLib")
: returns the length of the library. i.e., number of metabolites.libData
signature(obj = "tsLib")
: gets the libData
slot.libName
signature(obj = "tsLib")
: gets the Name
slot. libRI
signature(obj = "tsLib")
: gets the RI
slot. medRI
signature(obj = "tsLib")
: gets the medRI
slot. refLib
signature(obj = "tsLib")
: Low level method to create a matrix representation of the library.RIdev
signature(obj = "tsLib")
: gets the RI deviations. RIdev<-
signature(obj = "tsLib")
: sets the RI deviations. selMass
signature(obj = "tsLib")
: gets the selective masses. show
signature(object = "tsLib")
: show method. spectra
signature(obj = "tsLib")
: gets the spectra. topMass
signature(obj = "tsLib")
: gets the top masses. Alvaro Cuadros-Inostroza, Matthew Hannah, Henning Redestig
showClass("tsLib") # define some metabolite names libNames <- c("Metab1", "Metab2", "Metab3") # the expected retention index RI <- c(100,200,300) # selective masses to search for. A list of vectors. selMasses <- list(c(95,204,361), c(87,116,190), c(158,201,219)) # define the retention time windows to look for the given selective masses. RIdev <- matrix(rep(c(10,5,2), length(libNames)), ncol = 3, byrow = TRUE) # Set the mass spectra. A list object of two-column matrices, or set to # an empty list if the spectra is not available spectra <- list() # some extra information about the library libData <- data.frame(Name = libNames, Lib_RI = RI) # create a reference library object refLibrary <- new("tsLib", Name = libNames, RI = RI, medRI = RI, RIdev = RIdev, selMass = selMasses, topMass = selMasses, spectra = spectra, libData = libData) # get the metabolite names libName(refLibrary) # set new names libName(refLibrary) <- c("Metab01", "Metab02", "Metab03") # get the expected retention times libRI(refLibrary) # set the retention time index for metabolite 3 to 310 seconds libRI(refLibrary)[3] <- 310 # change the seleccion and top masses of metabolite 3 selMass(refLibrary)[[3]] <- c(158,201,219,220,323) topMass(refLibrary)[[3]] <- c(158,201,219,220,323) # change the retention time deviations RIdev(refLibrary)[3,] <- c(8,4,1)