Last data update: 2014.03.03

R: Tools for microarray preprocessing.
summarizeR Documentation

Tools for microarray preprocessing.

Description

These are tools to preprocess microarray data. They include background correction, normalization and summarization methods.

Usage

backgroundCorrectionMethods()
normalizationMethods()
summarizationMethods()
backgroundCorrect(object, method=backgroundCorrectionMethods(), copy=TRUE, extra, subset=NULL, target='core', verbose=TRUE)
summarize(object, probes=rownames(object), method="medianpolish", verbose=TRUE, ...)
## S4 method for signature 'FeatureSet'
normalize(object, method=normalizationMethods(), copy=TRUE, subset=NULL,target='core', verbose=TRUE, ...)
## S4 method for signature 'matrix'
normalize(object, method=normalizationMethods(), copy=TRUE, verbose=TRUE, ...)
## S4 method for signature 'ff_matrix'
normalize(object, method=normalizationMethods(), copy=TRUE, verbose=TRUE, ...)
normalizeToTarget(object, targetDist, method="quantile", copy=TRUE, verbose=TRUE)

Arguments

object

Object containing probe intensities to be preprocessed.

method

String determining which method to use at that preprocessing step.

targetDist

Vector with the target distribution

probes

Character vector that identifies the name of the probes represented by the rows of object.

copy

Logical flag determining if data must be copied before processing (TRUE), or if data can be overwritten (FALSE).

subset

Not yet implemented.

target

One of the following values: 'core', 'full', 'extended', 'probeset'. Used only with Gene ST and Exon ST designs.

extra

Extra arguments to be passed to other methods.

verbose

Logical flag for verbosity.

...

Arguments to be passed to methods.

Details

Number of rows of object must match the length of probes.

Value

backgroundCorrectionMethods and normalizationMethods will return a character vector with the methods implemented currently.

backgroundCorrect, normalize and normalizeToTarget will return a matrix with same dimensions as the input matrix. If they are applied to a FeatureSet object, the PM matrix will be used as input.

The summarize method will return a matrix with length(unique(probes)) rows and ncol(object) columns.

Examples

ns <- 100
nps <- 1000
np <- 10
intensities <- matrix(rnorm(ns*nps*np, 8000, 400), nc=ns)
ids <- rep(as.character(1:nps), each=np)
bgCorrected <- backgroundCorrect(intensities)
normalized <- normalize(bgCorrected)
summarizationMethods()
expression <- summarize(normalized, probes=ids)
intensities[1:20, 1:3]
expression[1:20, 1:3]
target <- rnorm(np*nps)
normalizedToTarget <- normalizeToTarget(intensities, target)

if (require(oligoData) & require(pd.hg18.60mer.expr)){
  ## Example of normalization with real data
  data(nimbleExpressionFS)
  boxplot(nimbleExpressionFS, main='Original')
  for (mtd in normalizationMethods()){
    message('Normalizing with ', mtd)
    res <- normalize(nimbleExpressionFS, method=mtd, verbose=FALSE)
    boxplot(res, main=mtd)
  }
}

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(oligo)
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colnames, do.call, duplicated, eval, evalq,
    get, grep, grepl, intersect, is.unsorted, lapply, lengths, mapply,
    match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, rank,
    rbind, rownames, sapply, setdiff, sort, table, tapply, union,
    unique, unsplit

Loading required package: oligoClasses
Welcome to oligoClasses version 1.34.0
Loading required package: Biobase
Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.

Loading required package: Biostrings
Loading required package: S4Vectors
Loading required package: stats4

Attaching package: 'S4Vectors'

The following objects are masked from 'package:base':

    colMeans, colSums, expand.grid, rowMeans, rowSums

Loading required package: IRanges
Loading required package: XVector
================================================================================
Welcome to oligo version 1.36.1
================================================================================
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/oligo/preprocessTools.Rd_%03d_medium.png", width=480, height=480)
> ### Name: summarize
> ### Title: Tools for microarray preprocessing.
> ### Aliases: backgroundCorrectionMethods normalizationMethods
> ###   summarizationMethods summarize summarize-methods
> ###   summarize,matrix-method summarize,ff_matrix-method backgroundCorrect
> ###   backgroundCorrect-methods backgroundCorrect,matrix-method
> ###   backgroundCorrect,ff_matrix-method
> ###   backgroundCorrect,FeatureSet-method normalize,matrix-method
> ###   normalize,ff_matrix-method normalize,FeatureSet-method
> ###   normalizeToTarget normalizeToTarget-methods
> ###   normalizeToTarget,matrix-method normalizeToTarget,ff_matrix-method
> ### Keywords: manip
> 
> ### ** Examples
> 
> ns <- 100
> nps <- 1000
> np <- 10
> intensities <- matrix(rnorm(ns*nps*np, 8000, 400), nc=ns)
> ids <- rep(as.character(1:nps), each=np)
> bgCorrected <- backgroundCorrect(intensities)
Background correcting... OK
> normalized <- normalize(bgCorrected)
Normalizing... OK
> summarizationMethods()
[1] "medianpolish" "plm"         
> expression <- summarize(normalized, probes=ids)
Calculating Expression
> intensities[1:20, 1:3]
          [,1]     [,2]     [,3]
 [1,] 7350.819 7774.748 8115.473
 [2,] 7574.486 8025.180 7730.021
 [3,] 7226.921 7793.872 8217.797
 [4,] 8083.596 7766.484 7706.753
 [5,] 8214.390 8376.299 8509.542
 [6,] 7164.467 7441.270 8818.366
 [7,] 8686.544 7716.815 7695.056
 [8,] 7840.245 7939.271 8463.759
 [9,] 8038.039 8251.723 8323.451
[10,] 8059.551 7851.070 7347.273
[11,] 7726.883 7896.280 7855.177
[12,] 7665.404 8176.075 8952.094
[13,] 7548.860 7419.295 7721.801
[14,] 8088.949 8268.210 7719.409
[15,] 7629.865 7090.731 7391.822
[16,] 8217.137 8675.214 7559.186
[17,] 7919.741 8303.456 7381.392
[18,] 8259.623 7753.626 7702.706
[19,] 7497.651 8178.471 8000.905
[20,] 7962.395 9015.886 8345.413
> expression[1:20, 1:3]
         [,1]     [,2]     [,3]
1    6.662980 6.588749 6.779933
10   6.670102 6.684988 6.736276
100  6.755639 6.684430 6.650885
1000 6.667891 6.831482 6.654860
101  6.733172 6.615452 6.706348
102  6.694088 6.661835 6.688221
103  6.547246 6.654153 6.661180
104  6.632649 6.666145 6.701642
105  6.793166 6.753807 6.759531
106  6.629170 6.543136 6.578016
107  6.604627 6.625038 6.602894
108  6.602697 6.683210 6.817723
109  6.787335 6.561719 6.760069
11   6.765384 6.878425 6.696037
110  6.671804 6.647032 6.678887
111  6.662872 6.679306 6.706000
112  6.539652 6.853386 6.603099
113  6.677410 6.507237 6.648217
114  6.591452 6.564750 6.717763
115  6.635764 6.669982 6.647493
> target <- rnorm(np*nps)
> normalizedToTarget <- normalizeToTarget(intensities, target)
Normalizing using target... OK
> 
> if (require(oligoData) & require(pd.hg18.60mer.expr)){
+   ## Example of normalization with real data
+   data(nimbleExpressionFS)
+   boxplot(nimbleExpressionFS, main='Original')
+   for (mtd in normalizationMethods()){
+     message('Normalizing with ', mtd)
+     res <- normalize(nimbleExpressionFS, method=mtd, verbose=FALSE)
+     boxplot(res, main=mtd)
+   }
+ }
Loading required package: oligoData
Loading required package: pd.hg18.60mer.expr
Loading required package: RSQLite
Loading required package: DBI
Normalizing with quantile
Normalizing with quantile.robust
Normalizing with quantile.in.blocks
Normalizing with qspline
Normalizing with loess
Normalizing with invariantset
Normalizing with constant
> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>