Last data update: 2014.03.03

R: visualize the sample relations
plotSampleRelationR Documentation

visualize the sample relations

Description

plot the sample relations based on MDS or hierarchical clustering

Usage

plotSampleRelation(x, subset = NULL, cv.Th = 0.1, standardize = TRUE, method = c("cluster", "mds"), dimension = c(1, 2), color = NULL, main = NULL, pch=NULL, addLegend=TRUE, ...)

Arguments

x

a LumiBatch object, ExpressionSet object or a matrix with each column corresponding to a sample

subset

the subset probes used to determine the sample relations. If it is one number, then randomly selected "number" of probes will be used. If not provide, all the probes will be used.

cv.Th

the threshold of the coefficient of variance of probes used to select probes to estimate sample relations

standardize

standardize the expression profiles or not

method

"MDS" or "hierarchical clustering"

dimension

the principle components to visualize the MDS plot

color

the color for each sample during plot. Only support the "mds" method

main

the title of the plot

pch

use symbols instead of text to label the samples

addLegend

Whether to add legend to MDS (two-dimensional PCA) plot

...

Other parameters used by plot function.

Details

Estimate the sample relations based on selected probes (based on large coefficient of variance (mean / standard variance)). Two methods can be used: MDS (Multi-Dimensional Scaling) or hierarchical clustering methods.

Value

Invisibly return the hierarchical clustering results (if 'cluster' method used) or coordinates of the mds plot (if 'mds' method used) .

Author(s)

Pan Du

See Also

lumiQ, LumiBatch, , plot,ExpressionSet-method

Examples


## load example data
data(example.lumi)

## plot the sample relations with MDS
## the color of sample is automatically set based on the sample type
plotSampleRelation(example.lumi, col=c('100US', '95US:5P', '100US', '95US:5P'))

## plot the sample relations with hierarchical clustering
plotSampleRelation(example.lumi, method='cluster')

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(lumi)
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 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")'.

Setting options('download.file.method.GEOquery'='auto')
Setting options('GEOquery.inmemory.gpl'=FALSE)
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/lumi/plotSampleRelation.Rd_%03d_medium.png", width=480, height=480)
> ### Name: plotSampleRelation
> ### Title: visualize the sample relations
> ### Aliases: plotSampleRelation
> ### Keywords: hplot
> 
> ### ** Examples
> 
> 
> ## load example data
> data(example.lumi)
> 
> ## plot the sample relations with MDS
> ## the color of sample is automatically set based on the sample type
> plotSampleRelation(example.lumi, col=c('100US', '95US:5P', '100US', '95US:5P'))
> 
> ## plot the sample relations with hierarchical clustering
> plotSampleRelation(example.lumi, method='cluster')
> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>