Last data update: 2014.03.03

R: Obtain normalized count data
getNormalizedDataR Documentation

Obtain normalized count data

Description

This function generates normalized count data from both original count data and calculated normalization factors.

Usage

getNormalizedData(tcc)

Arguments

tcc

TCC-class object.

Details

This function is generally used after the calcNormFactors function that calculates normalization factors. The normalized data is calculated using both the original count data stored in the count field and the normalization factors stored in the norm.factors field in the TCC-class object.

Value

A numeric matrix containing normalized count data.

Examples

# Note that the hypoData has non-DEGs at 201-1000th rows.
nonDEG <- 201:1000
data(hypoData)
summary(hypoData[nonDEG, ])
group <- c(1, 1, 1, 2, 2, 2)

# Obtaining normalized count data after performing the 
# DEGES/edgeR normalization method, i.e., DEGES/edgeR-normalized data.
tcc <- new("TCC", hypoData, group)
tcc <- calcNormFactors(tcc, norm.method = "tmm", test.method = "edger",
                       iteration = 1, FDR = 0.1, floorPDEG = 0.05)
normalized.count <- getNormalizedData(tcc)
summary(normalized.count[nonDEG, ])

# Obtaining normalized count data after performing the TMM normalization
# method (Robinson and Oshlack, 2010), i.e., TMM-normalized data.
tcc <- new("TCC", hypoData, group)
tcc <- calcNormFactors(tcc, norm.method = "tmm", iteration = 0)
normalized.count <- getNormalizedData(tcc)
summary(normalized.count[nonDEG, ])

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(TCC)
Loading required package: DESeq
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: 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: locfit
locfit 1.5-9.1 	 2013-03-22
Loading required package: lattice
    Welcome to 'DESeq'. For improved performance, usability and
    functionality, please consider migrating to 'DESeq2'.
Loading required package: DESeq2
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: GenomicRanges
Loading required package: GenomeInfoDb
Loading required package: SummarizedExperiment

Attaching package: 'DESeq2'

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

    estimateSizeFactorsForMatrix, getVarianceStabilizedData,
    varianceStabilizingTransformation

Loading required package: edgeR
Loading required package: limma

Attaching package: 'limma'

The following object is masked from 'package:DESeq2':

    plotMA

The following object is masked from 'package:DESeq':

    plotMA

The following object is masked from 'package:BiocGenerics':

    plotMA

Loading required package: baySeq
Loading required package: abind
Loading required package: perm
Loading required package: ROC

Attaching package: 'TCC'

The following object is masked from 'package:edgeR':

    calcNormFactors

> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/TCC/getNormalizedData.Rd_%03d_medium.png", width=480, height=480)
> ### Name: getNormalizedData
> ### Title: Obtain normalized count data
> ### Aliases: getNormalizedData
> ### Keywords: methods
> 
> ### ** Examples
> 
> # Note that the hypoData has non-DEGs at 201-1000th rows.
> nonDEG <- 201:1000
> data(hypoData)
> summary(hypoData[nonDEG, ])
    G1_rep1           G1_rep2        G1_rep3           G2_rep1      
 Min.   :   0.00   Min.   :   0   Min.   :   0.00   Min.   :   0.0  
 1st Qu.:   3.00   1st Qu.:   4   1st Qu.:   3.00   1st Qu.:   3.0  
 Median :  20.50   Median :  20   Median :  20.00   Median :  21.0  
 Mean   : 103.36   Mean   : 105   Mean   : 104.45   Mean   : 113.8  
 3rd Qu.:  74.25   3rd Qu.:  68   3rd Qu.:  73.25   3rd Qu.:  68.0  
 Max.   :8815.00   Max.   :9548   Max.   :8810.00   Max.   :9304.0  
    G2_rep2        G2_rep3      
 Min.   :   0   Min.   :   0.0  
 1st Qu.:   3   1st Qu.:   3.0  
 Median :  21   Median :  20.0  
 Mean   : 105   Mean   : 104.6  
 3rd Qu.:  70   3rd Qu.:  70.0  
 Max.   :9466   Max.   :9320.0  
> group <- c(1, 1, 1, 2, 2, 2)
> 
> # Obtaining normalized count data after performing the 
> # DEGES/edgeR normalization method, i.e., DEGES/edgeR-normalized data.
> tcc <- new("TCC", hypoData, group)
> tcc <- calcNormFactors(tcc, norm.method = "tmm", test.method = "edger",
+                        iteration = 1, FDR = 0.1, floorPDEG = 0.05)
TCC::INFO: Calculating normalization factors using DEGES
TCC::INFO: (iDEGES pipeline : tmm - [ edger - tmm ] X 1 )
TCC::INFO: Done.
> normalized.count <- getNormalizedData(tcc)
> summary(normalized.count[nonDEG, ])
    G1_rep1            G1_rep2            G1_rep3            G2_rep1        
 Min.   :   0.000   Min.   :   0.000   Min.   :   0.000   Min.   :   0.000  
 1st Qu.:   2.961   1st Qu.:   4.008   1st Qu.:   2.924   1st Qu.:   3.042  
 Median :  20.235   Median :  20.042   Median :  19.491   Median :  21.292  
 Mean   : 102.027   Mean   : 105.178   Mean   : 101.796   Mean   : 115.390  
 3rd Qu.:  73.290   3rd Qu.:  68.141   3rd Qu.:  71.387   3rd Qu.:  68.946  
 Max.   :8701.005   Max.   :9567.851   Max.   :8585.900   Max.   :9433.395  
    G2_rep2            G2_rep3        
 Min.   :   0.000   Min.   :   0.000  
 1st Qu.:   3.074   1st Qu.:   2.998  
 Median :  21.517   Median :  19.987  
 Mean   : 107.564   Mean   : 104.539  
 3rd Qu.:  71.724   3rd Qu.:  69.956  
 Max.   :9699.190   Max.   :9314.119  
> 
> # Obtaining normalized count data after performing the TMM normalization
> # method (Robinson and Oshlack, 2010), i.e., TMM-normalized data.
> tcc <- new("TCC", hypoData, group)
> tcc <- calcNormFactors(tcc, norm.method = "tmm", iteration = 0)
TCC::INFO: Calculating normalization factors using tmm ...
TCC::INFO: Done.
> normalized.count <- getNormalizedData(tcc)
> summary(normalized.count[nonDEG, ])
    G1_rep1            G1_rep2            G1_rep3            G2_rep1         
 Min.   :   0.000   Min.   :   0.000   Min.   :   0.000   Min.   :    0.000  
 1st Qu.:   2.833   1st Qu.:   3.802   1st Qu.:   2.789   1st Qu.:    3.284  
 Median :  19.359   Median :  19.011   Median :  18.591   Median :   22.986  
 Mean   :  97.610   Mean   :  99.769   Mean   :  97.092   Mean   :  124.570  
 3rd Qu.:  70.117   3rd Qu.:  64.637   3rd Qu.:  68.088   3rd Qu.:   74.431  
 Max.   :8324.342   Max.   :9075.747   Max.   :8189.160   Max.   :10183.853  
    G2_rep2            G2_rep3        
 Min.   :   0.000   Min.   :   0.000  
 1st Qu.:   3.166   1st Qu.:   3.151  
 Median :  22.163   Median :  21.007  
 Mean   : 110.790   Mean   : 109.871  
 3rd Qu.:  73.876   3rd Qu.:  73.524  
 Max.   :9990.114   Max.   :9789.191  
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>