Last data update: 2014.03.03

R: Creates a trend-plot of all reporters, binned by dye bias,...
dyebias.trendplotR Documentation

Creates a trend-plot of all reporters, binned by dye bias, with all slides ordered by slide bias.

Description

The aim of this routine is to show the monotonicity of the total dye bias in the (uncorrected) data set. This is to judge whether the total dye bias of one reporter in one hybridization indeed behaves as the product of an intrinsic gene specific dye bias (iGSDB) and a slide specific factor (the slide bias), which is at the heart of the GASSCO method.

Showing the total dye bias of all reporters is too overwhelming, therefore the medians of the total dye bias after binning by intrinsic gene specific dye bias (as given in dyebias$dyebias) are plotted.

Usage

dyebias.trendplot(data, iGSDBs, dyebias.percentile=5,
                  application.subset=TRUE, n.bins=20, order,
                  output=NULL, ylim=c(-1,1), cex=0.3, lty=1, lwd=1,
                  type="median", main="dye bias trend plot",
                  xlab="slide bias rank", ylab="M", sub=NULL, ...)

Arguments

data

The marrayNorm to trendplot.

iGSDBs

A data frame with intrinsic gene-specific dye biases, the same as that used in dyebias.apply.correction, probably returned by
dyebias.estimate.iGSDBs; see there for documentation.

dyebias.percentile

The percentile of intrinsic gene specific dye biases (iGSDBs) for which to highlight the reporters. Default should suffice in almost all cases.

application.subset

The set of reporters that was eligible for dye bias correction; same argument as for dyebias.apply.correction.

n.bins

The number of bins into which to classify the reporters, based on their intrinsic gene-specific dye bias. The median of each bin is plotted.

type

What to print for each bin and hybridization. Valid values are:

  • medianPlot the bin-median: the median of all genes in that bin and hybridization

  • meanPlot the mean of all genes in that bin and hybridization

  • genePlot the single gene that has the lowest squared distance to the bin-median over all hybridizations

  • median.genePlot the single gene that has the median squared distance to the bin-medians over all hybridizations

  • worst.genePlot the single gene that correlates worst with the bin-median over all hybridizations

order

If order==NULL, the slides are sorted by increasing slide bias prior to boxplotting. This is typically done for data that is not yet dye bias corrected. This order is also returned as a value. If order!=NULL, the slides are put into this order before trendplotting. This is typically done for a dye bias-corrected data set, using the order of the uncorrected set.

output

Specifies the output. If NULL, the existing output device is used; if output is one of "X11", "windows", "quartz", a new X11 (Unix)/windows (Windows)/quartz (Mac) device is created. If output is a string ending in one of ".pdf", ".png", ".eps", ".ps" is given, a file of that name and type is created and closed afterwards.

ylim, lty, lwd, main, sub, cex, xlab, ylab

As for matplot()

...

Other arguments are passed on to matplot().

Value

The order obtained, for use in a later call to this same function.

Author(s)

Philip Lijnzaad p.lijnzaad@umcutrecht.nl

References

Margaritis, T., Lijnzaad, P., van Leenen, D., Bouwmeester, D., Kemmeren, P., van Hooff, S.R and Holstege, F.C.P. (2009). Adaptable gene-specific dye bias correction for two-channel DNA microarrays. Molecular Systems Biology, 5:266, 2009. doi: 10.1038/msb.2009.21.

See Also

dyebias.estimate.iGSDBs, dyebias.apply.correction, dyebias.rgplot, dyebias.maplot, dyebias.monotonicity dyebias.monotonicityplot

Examples


                                       

  ## show trend plots of uncorrected and corrected next to each other:
  ylim <- c(-0.6, 0.6)

  layout(matrix(1:2, nrow=1,ncol=2))

  order <- dyebias.trendplot(data=data.norm, 
                        iGSDBs=iGSDBs.estimated, # from e.g. dyebias.estimate.iGSDBs
                        order=NULL,              # i.e., order by increasing slide bias
                        output=NULL,
                        main="before correction",
                        ylim=ylim
                        )

  order <- dyebias.trendplot(data=correction$data.corrected, # from dyebias.apply.correction
                        iGSDBs=iGSDBs.estimated,
                        order=order,             # order by the original slide bias
                        output=NULL,
                        main="after correction",
                        ylim=ylim
                       ) 

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(dyebias)
Loading required package: marray
Loading required package: limma
Loading required package: Biobase
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 object is masked from 'package:limma':

    plotMA

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

Welcome to Bioconductor

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

> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/dyebias/dyebias.trendplot.Rd_%03d_medium.png", width=480, height=480)
> ### Name: dyebias.trendplot
> ### Title: Creates a trend-plot of all reporters, binned by dye bias, with
> ###   all slides ordered by slide bias.
> ### Aliases: dyebias.trendplot
> ### Keywords: hplot misc
> 
> ### ** Examples
> 
> 
>   ## Don't show: 
>      options(stringsAsFactors = FALSE)
> 
>      library(dyebias)
>      library(dyebiasexamples)
Loading required package: GEOquery
Setting options('download.file.method.GEOquery'='auto')
Setting options('GEOquery.inmemory.gpl'=FALSE)
>      data(data.raw)
>      data(data.norm)
> 
>      ### obtain estimate for the iGSDBs:
>      iGSDBs.estimated <- dyebias.estimate.iGSDBs(data.norm,
+                                                  is.balanced=TRUE,
+                                                  verbose=FALSE)
> 
>      ### choose the estimators and which spots to correct:
>      estimator.subset <- dyebias.umcu.proper.estimators(maInfo(maGnames(data.norm)))
> 
>      application.subset <- maW(data.norm) == 1 &
+                    dyebias.application.subset(data.raw=data.raw, use.background=TRUE)
> 
>      ### do the correction:
>      correction <- dyebias.apply.correction(data.norm=data.norm,
+                                             iGSDBs = iGSDBs.estimated,
+                                             estimator.subset=estimator.subset,
+                                             application.subset = application.subset,
+                                             verbose=FALSE)
>   
> ## End(Don't show)                                     
> 
>   ## show trend plots of uncorrected and corrected next to each other:
>   ylim <- c(-0.6, 0.6)
> 
>   layout(matrix(1:2, nrow=1,ncol=2))
> 
>   order <- dyebias.trendplot(data=data.norm, 
+                         iGSDBs=iGSDBs.estimated, # from e.g. dyebias.estimate.iGSDBs
+                         order=NULL,              # i.e., order by increasing slide bias
+                         output=NULL,
+                         main="before correction",
+                         ylim=ylim
+                         )
> 
>   order <- dyebias.trendplot(data=correction$data.corrected, # from dyebias.apply.correction
+                         iGSDBs=iGSDBs.estimated,
+                         order=order,             # order by the original slide bias
+                         output=NULL,
+                         main="after correction",
+                         ylim=ylim
+                        ) 
> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>