Last data update: 2014.03.03

R: Graph xy plot of variable (gene) projections from PCA or COA....
plotgenesR Documentation

Graph xy plot of variable (gene) projections from PCA or COA. Only label variables at ends of axes

Description

Graph xy plot of variables but only label variables at ends of X and Y axes. Useful for graphing genes coordinates ($co) resulting from PCA or COA of microarray data.

Usage

plotgenes(coord, nlab = 10, axis1 = 1, axis2 = 2, genelabels = row.names(coord), boxes = TRUE, 
colpoints = "black", ...)

Arguments

coord

a data.frame or matrix or object from ord bga or cia analysis with at least two columns, containing x, y coordinates to be plotted.

nlab

Numeric. An integer indicating the number of variables at ends of axes to be labelled.

axis1

An integer, the column number for the x-axis. Default is 1, so axis 1 is dudivar[,1].

axis2

An integer, the column number for the y-axis. Default is 2, so axis 2 is dudivar[,2].

genelabels

A vector of gene (variable) labels. Default is row.names(coord)

boxes

A logical, indicating whether a box should be plotted surrounding each variable label. The default is TRUE.

colpoints

The colour of the points on the plot. The default is "black".

...

further arguments passed to or from other method.

Details

plotgenes calls the function genes which return an index of the "top" variables at the ends of the x and y axes.

If you wish to return a table or list of the top genes at the end of an axis, use the function topgenes.

Value

An xy plot

Note

plotgenes plots variables using s.var, which is a modified version of s.label.

Author(s)

Aedin Culhane

See Also

See Also as s.var and s.label

Examples

data(khan)
if (require(ade4, quiet = TRUE)) {
khan.ord<-ord(khan$train, classvec=khan$train.classes) 
}
par(mfrow=c(2,2))
#s.var(khan.ord$co, col=as.numeric(khan$train.classes), clabel=0.8)
plotgenes(khan.ord, colpoints="red")
plotgenes(khan.ord, colpoints="red", genelabels=khan$annotation$Symbol)
plotgenes(khan.ord, colpoints="gray", genelabels=khan$annotation$Symbol,boxes=FALSE)

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(made4)
Loading required package: ade4
Loading required package: RColorBrewer
Loading required package: gplots

Attaching package: 'gplots'

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

    lowess

Loading required package: scatterplot3d
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/made4/plotgenes.Rd_%03d_medium.png", width=480, height=480)
> ### Name: plotgenes
> ### Title: Graph xy plot of variable (gene) projections from PCA or COA.
> ###   Only label variables at ends of axes
> ### Aliases: plotgenes
> ### Keywords: multivariate hplot
> 
> ### ** Examples
> 
> data(khan)
> if (require(ade4, quiet = TRUE)) {
+ khan.ord<-ord(khan$train, classvec=khan$train.classes) 
+ }
> par(mfrow=c(2,2))
> #s.var(khan.ord$co, col=as.numeric(khan$train.classes), clabel=0.8)
> plotgenes(khan.ord, colpoints="red")
> plotgenes(khan.ord, colpoints="red", genelabels=khan$annotation$Symbol)
> plotgenes(khan.ord, colpoints="gray", genelabels=khan$annotation$Symbol,boxes=FALSE)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>