# script to run the TargetSearch analysis # tested with R - 2.9.1 - Windows XP. # Author: Alvaro Cuadros-Inostroza ################################################################ # # # PLEASE READ THE FOLLOWING BEFORE RUNNING THE SCRIPT # # # ################################################################ # INSTRUCTIONS # # 1. This software requires R (>=2.9.0), Bioconductor (>=2.4) and # xcms (>= 1.16.3). If you already have installed them, go to # point 4. # # 2. Install R (>= 2.9.0) from http://www.r-project.org # # 3. Open R and install Bioconductor and xcms by entering: # source("http://bioconductor.org/biocLite.R") # biocLite() # biocLite("xcms") # # 4. Download the latest TargetSearch package (1.1.9 or newer) from # http://bioconductor.org/packages/2.5/bioc/html/TargetSearch.html # and install it manually. In windows: Menu->Packages->Install # packages from local zip files. # # Don't use biocLite() command, since it may install an older # version of TargetSearch. # # 5. Download the CDF files from DropMET http://prime.psc.riken.jp/ # Save them in a working directory, c:\temp, for example, together # with the files 03.samples.txt, 04.rimLimits.txt and 05.library.txt ################################################################# ################################################################# # # # The R-Script begins here. Please Copy&Paste the following # # commands into the R-console. Lines beginning with # are # # comments. # # # ################################################################# # Set working directory. Change if necessary. setwd("c:/temp") # load library library(TargetSearch) # m/z range to be extracted from chromatogramas massRange <- c(75,550) # Import Samples. We assume that all the files are in the same working directory samples <- ImportSamples("03.samples.txt", RIpath=".", CDFpath=".") # Import Retention index Standards rimLimits <- ImportFameSettings("04.rimLimits.txt", row.names = 1) # Perform baseline correction and peak detection. # Parameters: Window = smoothing window # IntThreshold = lowest intensity to be extracted # baseline = (TRUE/FALSE) Perform baseline correction # baseline.opts = a list with baseline options: threshold (0..1); # 0.5 will return a baseline "in the middle" of the noise # (like in LECO) RImatrix <- RIcorrect(samples, rimLimits, massRange=massRange, Window=15, IntThreshold=50, baseline=TRUE, baseline.opts=list(threshold = 0.5)) # Search for posible outliers outliers <- FAMEoutliers(samples, RImatrix) # Import Library: # Use the top 20 masses of the reference spectrum to be search. lib <- ImportLibrary("05.library.txt", RI_dev = c(15,8,3), TopMasses=20) # Performs three step library search lib <- medianRILib(samples, lib) corRI <- sampleRI(samples, lib) peakData <- peakFind(samples, lib, corRI) # Obtain Final Profile metabProfile <- Profile(samples, lib, peakData) finalProfile <- ProfileCleanUp(metabProfile, timeSplit=2, r_thresh=0.85) # Write Results Write.Results(lib, peakData, finalProfile) # spectra Visualisation plotAllSpectra(lib, peakData, pdfFile = "spectrum-constrast-Report.pdf") # Call the GUI TargetSearchGUI()