NormScaling: Normalisation methods based on scaling

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/NormScaling.R

Description

Normalise a metabolomic data matrix according to a specified scaling method.

Usage

1
2
NormScaling(featuredata, method = c("median", "mean", "sum", "ref"),
  refvec = NULL, saveoutput = FALSE, outputname = NULL, ...)

Arguments

featuredata

featuredata A data frame in the featuredata format. This is a dataframe with metabolites in columns and samples in rows. Unique sample names should be provided as row names.

method

A character string indicating the required scaling-based normalization method. Must be one of "median", "mean", "sum", or "ref". See NormalizeMets Vignette for details.

refvec

A reference vector to be used with the method "ref".

saveoutput

A logical indicating whether the normalised data matrix should be saved as a .csv file.

outputname

The name of the output file if the output has to be saved.

...

Arguments to other functions

Details

The normalisation methods based on scaling include normalisation to a total sum, or by the median or mean of each sample, and are denoted by "sum", "median", and "mean" respectively. The method "ref" normalises the metabolite abundances to a specified reference vector.

Value

The result is an object of class alldata.

Author(s)

Alysha M De Livera, Gavriel Olshansky

References

De Livera, Alysha M De, M. Aho-Sysi, Laurent Jacob, J. Gagnon-Bartch, Sandra Castillo, J.A. Simpson, and Terence P. Speed. 2015. Statistical Methods for Handling Unwanted Variation in Metabolomics Data. Analytical Chemistry 87 (7). American Chemical Society: 3606-3615.

See Also

normFit.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
   ## Reading the data
     data(mixdata)
     featuredata <- mixdata$featuredata
     sampledata<-mixdata$sampledata
     metabolitedata<-mixdata$metabolitedata
     refvec<-featuredata[,which(metabolitedata$type =="IS")[1]]
    
    ## Normalise by the median
    norm_med <- NormScaling(featuredata, method = "median")
    
    ## Normalise by a reference vector, in this case an internal standard
    norm_is <- NormScaling(featuredata, method = "ref", 
        refvec=refvec)

    ## Normalise by the sum
    norm_sum <- NormScaling(featuredata, method = "sum")

   ## Rla Plots after normalising by the median
    RlaPlots(norm_med$featuredata, group= sampledata$batch)

NormalizeMets documentation built on May 1, 2019, 10:26 p.m.