mmds.2D.plot {bios2mds}R Documentation

Plots the mmds coordinates onto a 2D space

Description

Displays a scatter plot of the active elements and, if present, of supplementary elements, after a metric MDS analysis.

Usage

mmds.2D.plot(x,project = NULL, title = NULL, axis = c(1, 2), xlim = NULL,
ylim = NULL, outfile.type = NULL, outfile.name = "mmds",new.plot = TRUE,
active.col = x$col[,3], active.alpha = 1, sup.col = project$col[,3], 
active.pch = 20, sup.pch = 3, active.lab = FALSE, sup.lab = FALSE, 
active.cex = 2, sup.cex = 2, active.legend.cex = 2, sup.legend.cex = 2,
active.legend.lwd = 1, sup.legend.lwd = 2, active.lwd = 1, sup.lwd = 4,
legend = TRUE, active.legend.pos = "bottomleft",
sup.legend.pos = "bottomright", active.legend.name = x$group[,1],
sup.legend.name = project$group[,1], active.legend.col = x$group[,2],
sup.legend.col = project$group[,2], outfile.width = NULL, outfile.height = NULL,
box.lwd = 1, cex.axis = 1, cex.lab = 1, sup.legend.text = 1,
active.legend.text = 1, legend.axis = TRUE, grid = TRUE, axes = TRUE)

Arguments

x

an object of class 'mmds', obtained from mmds function.

project

an object of class 'project', obtained from mmds.project function.

title

a string of characters representing the title of the plot. Default is "Metric MDS".

axis

a numeric vector of length two representing the principal components displayed on the plot. Default is c(1, 2).

xlim

a numeric vector representing the range for the x values. Default is full range.

ylim

a numeric vector representing the range for the y values. Default is full range.

outfile.type

a string indicating the extension type of the graph outfile. Default is NULL. If not NULL, this should be one of "pdf", "tiff", "png" or "postscript". In this case, the parameter outfile.name and the forthcoming parameters are activated.

outfile.name

a string ("mmds", default) indicating the name and directory of pdf graph outfile. The extension file is added automaticaly. See outfile.type.

new.plot

a boolean indicating whether a new graphical device should be created (TRUE) or not (FALSE). Default is TRUE.

active.pch

an integer indicating the symbol of active elements. Default is 20, corresponding to dots.

sup.pch

an integer indicating the symbol of supplementary elements. Default is 3, corresponding to crosses.

active.col

a string of characters or character vector representing the color(s) of the active elements. Default is x$col[,3]. It corresponds either to the user-provided colors if the col.group function has been used previously, or to black (filled automaticaly with the mmds function).

active.alpha

a numeric value indicating the alpha value for opacity of active objects. This value must range from 0 (invisible) to 1 (full opacity). Default is 1.

sup.col

a string or character vector representing the color(s) of supplementary elements. Default is project$col[,3]. It corresponds either to the user-provided colors if the col.group function has been used previously, or to magenta (filled automaticaly with the mmds function).

active.lab

a boolean indicating whether labels of active elements should be displayed (TRUE) or not (FALSE). Default is FALSE.

sup.lab

a boolean indicating whether labels of supplementary elements should be displayed (TRUE) or not (FALSE). Default is FALSE.

active.cex

a numeric value indicating the size of the active symbols. Default is 2.

sup.cex

a numeric value indicating the size of the supplementary symbols. Default is 2.

active.legend.cex

a numeric value indicating the size of active symbols in legend. Default is 2.

sup.legend.cex

a numeric value indicating the size of supplementary symbols in legend. Default is 2.

active.lwd

a numeric value indicating the width of active symbols. Default is 1.

sup.lwd

a numeric value indicating the width of supplementary symbols. Default is 4.

active.legend.lwd

a numeric value indicating the width of active symbols in legend. Default is 1.

sup.legend.lwd

a numeric value indicating the width of supplementary objects in legend. Default is 4.

legend

a boolean indicating whether the legend should be displayed (TRUE) or not (FALSE). Default is TRUE.

active.legend.pos

a string indicating the position of the legend for active elements. Default is "topleft".

sup.legend.pos

a string indicating the position of the legend for supplementary elements. Default is "topright".

active.legend.name

a string vector indicating the names of the active groups. Default is x$group[,1]. It corresponds either to the user-provided groups if the col.group function has been used previously, or to "NoGroup" (filled automaticaly with the mmds function).

sup.legend.name

a string vector indicating the names of the sup groups. Default is project$group[,1]. It corresponds either to the user-provided groups if the col.group function has been used previously, or to "NoGroup" (filled automaticaly with the mmds function).

active.legend.col

a string vector indicating the colors of the different active groups. Default is x$group[,2]. It corresponds either to the user-provided colors if the col.group function has been used previously, or to black (filled automaticaly with the mmds function).

sup.legend.col

a string vector indicating the colors of the different sup groups. Default is project$group[,2]. It corresponds either to the user-provided colors if the col.group function has been used previously, or to magenta (filled automaticaly with the mmds function).

outfile.width

a numeric value in inches indicating the width of graph outfile. Default differs by outfile.type. See pdf, png, postscript. The resolution for tiff and png figures is 150 dpi.

outfile.height

a numeric value in inches indicating the height of graph outfile. Default differs by outfile.type. The resolution for tiff and png figures is 150 dpi. See pdf, codetiff, png, postscript.

box.lwd

a numeric value indicating the border width of graph box and legend box. Default is 1.

cex.axis

a numeric value indicating the character size for the x and y axes. Default is 1.

cex.lab

a numeric value indicating the character size for the labels of the x and y axes. Default is 1.

sup.legend.text

a numeric value indicating the character size of the supplementary tag in legend. Default is 1.

active.legend.text

a numeric value indicating the character size of active tag in legend. Default is 1.

legend.axis

a boolean indicating whether axis name should be displayed (TRUE) or not (FALSE). Default is TRUE.

grid

a boolean indicating whether grid should be displayed (TRUE) or not (FALSE). Default is TRUE.

axes

a boolean indicating whether x and y axes should be displayed (TRUE) or not (FALSE). Default is TRUE.

Details

If mmds.2D.plot is used after the col.group function, the elements are colored by the color scheme provided in the .csv file (see col.group for details). If the col.group function has not been used, the default colors are black and magenta for active and supplementary elements.

mmds.2D.plot helps identify patterns in data and compare active and supplementary elements.

active.alpha argument is helpful for visualization of supplementary elements because it allows the symbols of supplementary elements to be in the foreground as compared to active elements.

Value

Produces a scatter plot on the active graphical device.

Note

mmds.2D.plot requires alpha function from scales package.

Author(s)

Julien Pele and Jean-Michel Becu

See Also

plot.PCA function from FactoMineR package.
png, pdf, postscript functions (default R package).

Examples

# scatter plot of human GPCRs onto the first two axes obtained from MDS analysis
# with projection of GPCRs from D. melanogaster as supplementary elements:
data(gpcr)
active <- gpcr$dif$sapiens.sapiens
mmds_active <- mmds(active,group.file=system.file(
"csv/human_gpcr_group.csv",package = "bios2mds"))
mmds.2D.plot(mmds_active, active.alpha = 0.5, active.lab = TRUE)

# with group information
sup <- gpcr$dif$melanogaster.sapiens
mmds_sup <- mmds.project(mmds_active, sup,group.file=system.file(
"csv/drome_gpcr_group.csv",package = "bios2mds"))
mmds.2D.plot(mmds_active,mmds_sup)

[Package bios2mds version 1.2.3 Index]