Learn R Programming

made4 (version 1.46.0)

html3D: Produce web page with a 3D graph that can be viewed using Chime web browser plug-in, and/or a pdb file that can be viewed using Rasmol

Description

html3D produces a pdb file that can be viewed using the freeware protein structure viewer Rasmol and a html web page with a 3D graph that can be rotated and manipulated in a web browser that supports the chime web browser plug-in.

Usage

html3D(df, classvec = NULL, writepdb = FALSE, filenamebase = "output", writehtml = FALSE, title = NULL, scaled=TRUE,xyz.axes=c(1:3), ...)

Arguments

df
A matrix or data.frame containing the x,y,z coordinates. Typically the output from bga such as the \$ls or \$co files, or other xyz coordinates (\$li or \$co) produced by PCA, COA or other dudi
classvec
factor or vector which describes classes in the df. Default is NULL. If specified each group will be coloured in contrasting colours
writepdb
Logical. The default is FALSE. If TRUE a file will be saved which can be read into Rasmol.
writehtml
Logical. The default is FALSE, If TRUE a web html file will be saved which can be viewed in any web browser than supports chime.
filenamebase
Character. The basename of the html or pdb file(s) to be saved. The default is "output", which will save files output.pdb, output.html, if writepdb or writehtml are TRUE respectively.
title
Character, the title (header) of the web page saved if writehtml is TRUE. The default is NULL.
scaled
Logical indicating whether the data should be scaled for best fit. The default is TRUE
xyz.axes
vector indicating which axes to use for x, y and z axes. By default, the first 3 columns of df.
...
further arguments passed to or from other methods

Value

html3D produces the pdb output file which can be read in Rasmol or other molecular structure viewers. html3D produces a html file with a 3D graph that can be rotated and manipulated in a web browser that supports the chime web browser plug-in.

Details

Produces a html file, of a 3D graph which can be rotated using the FREEWARE chime (win, MacOS). Chime can be downloaded from http://www.mdlchime.com/.

html3D will colour samples by classvec if given one, and will produce chime script to highlight groups, spin on/off, and include button for restore for example see http://bioinf.ucd.ie/research/BGA/supplement.html

html3d calls chime3D to produce the html web page with a 3D graph.

See Also

Examples

Run this code
data(khan)
if (require(ade4, quiet = TRUE)) {
khan.bga<-bga(khan$train, khan$train.classes)
}

out.3D <-html3D(khan.bga$bet$ls, khan.bga$fac, writepdb=TRUE, 
filenamebase ="Khan" , writehtml=TRUE)

## Not run: 
# browseURL(paste("file://", file.path(paste(getwd(),"/khan.html", 
# sep="")), sep=""))
# ## End(Not run)

Run the code above in your browser using DataLab