geneImager {compdiagTools}R Documentation

geneImager

Description

This function creates a 'compdiag style' blue-yellow cluster plot. With no given filename the image is plotted to x11(). If a filename is given the image is plotted into a file and a corresponding HTML image map is returned. The links provided in the map are generated either from annotProbes elements themselves, or (if they exist) from their associated element names names(annotProbes).

Usage

geneImager(data, chip, 
           cluster="both",
           dendro="both",
           center = TRUE,
           scale=FALSE,
           outputPath=".",
           file=NULL,
           zlim=NULL,
           annotSamples=NULL,
           annotProbes=NULL,
           forceExceed=FALSE,
           x_max=NULL,
           y_max=NULL,
           hide.colorbar = FALSE,
           sample.group = NULL,
           group.bgc = NULL,
           group.fgc = NULL,
           heightScale = 1,
           ...)

Arguments

data numeric matrix of the values to be plotted
chip the chip name as character string to look up gene symbols.
cluster Determines if the data should be clustered. Possible options are: FALSE, "both", "probes" (rows), "samples" (columns)
dendro Determines if dendrograms should be plotted. Possible options are: FALSE, "both", "probes" (rows), "samples" (columns)
center Boolean - indicates if row-wise centering (mean subtract) should be performed.
scale Boolean - indicates if a row-wise scaling should be performed.
file determines the output filename (if no filename is given the output is plotted to x11()). This is relative to outputPath. The generated HTML uses only this part of the full filename.
outputPath optional output path for the file.If file is other than NULL, its concatenation with outputPath is where the image is written.
zlim c(lower,upper) limits on logarithmic scale for colorbar. If not given the limits are calculated from the data as the 2.5% quantile and 97.5% quantile. Data is always truncated according to zlim.
annotSamples Vector of character strings for sample annotation. The x. element in annotSamples has to correspond to the x. column of data.
annotProbes Vector of character strings for probe annotation. The x. element in annotProbes has to correspond to the x. row of data. If this vector is a named vector, associated element names are used as link in the image map. If the vector is not named, the elements themselves are used as link. This can also be NULL, in which case labels are guessed from rownames, or FALSE, where annotations are omitted.
forceExceed Boolean - indicates if internal ploting limits should be exceeded. All given annotations are plotted. Works only in connection with file output
x_max numerical value - maximal size of the x component of the heatmap region (in centimeters), if NULL internal limits are used
y_max numerical value - maximal size of the y component of the heatmap region (in centimeters), if NULL internal limits are used
hide.colorbar avoid showing the color bar on the right hand side.
sample.group one group label per sample is expected. This vector is used to sort samples such that samples with same group labels are grouped together. Clustering overwrites this option. The factor values are displayed on top of the image.
group.bgc background colors used for background of group annotations. Colors coded as character strings must be provided. The vector is recycled, if there are more groups than color codes. The default (NULL) causes geneImager to use alternating shades of grey.
group.fgc similar to group.bgc for the foreground (text) colors.
heightScale scale the height of the figure (not the data).
... further arguments passed on to bitmap

Value

If a filename is given: String representing an HTML image map, including <img> tag. If no filename is given: output is printed to x11()

Examples

library(hgu95av2)

probes    <- ls(hgu95av2GENENAME)[1:30]
symbols   <- unlist(mget(probes,hgu95av2SYMBOL))

probeAnnot <- symbols
names(probeAnnot) <- probes

expr.data <- cbind(matrix(rnorm(450,3),30,15),matrix(rnorm(450,0),30,15))
expr.data[,1:30] <- expr.data[,sample(1:30)]

geneImager(expr.data, annotProbes=probeAnnot, scale=TRUE, cluster="samples",
           dendro="samples", file="outfile.png")

# using geneImager together with geneLister
imageMap  <- geneImager(expr.data,annotProbes=probeAnnot,scale=TRUE,cluster="samples",dendro="samples",file="example.png")

htmlTable <- geneLister(probes,chip="hgu95av2",annotGO=FALSE)

write(c(imageMap,htmlTable),file="example.html")


[Package compdiagTools version 1.5.3 Index]