Write.Results: Save TargetSearch result objects into files

Write.ResultsR Documentation

Save TargetSearch result objects into files

Description

This is a convenient function to save the TargetSearch result into tab-delimited text files.

Usage

Write.Results(Lib, metabProfile,
              quantMatrix=c('quantmass', 'maxint', 'maxobs', 'none'),
              prefix = NULL,
              selmass = FALSE)

Arguments

Lib

A tsLib object.

metabProfile

A tsProfile object. The final result of the package. This object is generated by either Profile or ProfileCleanUp.

quantMatrix

Should an intensity matrix using quantification masses be created? This parameter will be passed to quantMatrix and indicates whether the quantification mass should be either taken as is from the Lib object (as specified by the method quantMass), or chosen based on intensity or observations. The file will have the extension ‘.profile.quantmatrix.txt’, unless this is set to none, in which case the file will not be created.

prefix

A character string. This is a file name prefix for the output text files. If it is set to NULL or NA, then "TargetSearch-YYYY-MM-DD" is used by default, where Y/M/D represents the year, month and day of today's date.

selmass

Logical. This parameter is passed to the function quantMatrix. See that function documentation for its meaning.

Details

The function generates the following tab-delimited text files, where “prefix” corresponds with the selected file prefix.

  • prefix.peak.intensity.txt. Contains information on peak intensity for each target mass in the library per sample.

  • prefix.peak.RI.txt. Contains information on retention index (RI) for each target mass in the library per sample.

  • prefix.profile.info.txt. Contains the profile information for each metabolite. See Profile and ProfileCleanUp for details.

  • prefix.profile.intensities.txt. Contains information on profile intensities per metabolite. This value is an average of all correlating masses normalized to the mean.

  • prefix.profile.ri.txt. Contains information on average retention indices of the correlating masses. This value is an average of all correlating masses.

  • prefix.profile.quantmatrix.txt. The quantification matrix as tab-delimited text file. See quantMatrix for details. If the argument quantMatrix is equal to “none”, then this file is not created.

The functions uses write.table as backend to write the files with parameters set="\t" and quote=FALSE.

Value

This function does not return anything. It just prints a message with the saved files.

Author(s)

Alvaro Cuadros-Inostroza, Matthew Hannah, Henning Redestig

See Also

peakFind, Profile, ProfileCleanUp, tsLib, tsMSdata, tsProfile, quantMatrix

Examples

# load precomputed results from `TSExample`
data(TSExample)

# we need the objects metabProfile and refLibrary. This will create files
# with prefix 'TargetSearch-YYYY-MM-DD' corresponding to today's date
Write.Results(refLibrary, metabProfile)

# change the prefix with the parameter `prefix` to 'my_experiment'
Write.Results(refLibrary, metabProfile, prefix='my_experiment')

acinostroza/TargetSearch documentation built on Nov. 22, 2024, 3:31 p.m.