| Title: | HilbertVisGUI |
|---|---|
| Description: | An interactive tool to visualize long vectors of integer data by means of Hilbert curves |
| Authors: | Simon Anders <[email protected]> |
| Maintainer: | Simon Anders <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 1.71.1 |
| Built: | 2026-05-29 21:56:50 UTC |
| Source: | https://github.com/bioc/HilbertVisGUI |
A kludge to get around a certain problem in using lapply
with '...' ellipsis function arguments.
dotsapply( fun, ... )dotsapply( fun, ... )
fun |
A function that takes one argument |
... |
Arguments to which the function should be applied |
"dotsapply(fun,...)" gives the same result as lapply(
list(...), fun). However, the construction with "list", when used for
variables enumerated explicitely, will result in their duplication.
Assume, for example, that you have three very large vectors a, b, and
c, whose lengths you wish to know. If your write "lapply( list(a,b,c),
length )", R will duplicate all three vectors in memory when constructing the
list, which results in unnecessary use of memory. The alternative "dotsapply(
length, a, b, c )" avoids this. Of course, you could also write "list(
length(a), length(b), length(c) )", which neither causes duplication.
This last possibility is, however, not an option, if, instead of "a,b,c",
you have ellipsed function arguments, i.e. literally "...". In this special
case, dotsapply comes in handy, and as this case arose in
hilbertDisplay, I implemented dotsapply as a kludge and export
it from the package just in case somebody ahs use for it.
A list of function values
Simon Anders, EMBL-EBI, [email protected]
Display one or several long integer vectors in an interactive fashion by means of the Hilbert curve.
See the vignette for a full explanation.
hilbertDisplay( ..., palettePos = colorRampPalette( c( "white", "red" ) )( 300 ), paletteNeg = colorRampPalette( c( "white", "blue" ) )( length(palettePos) ), maxPaletteValue = NULL, naColor = "gray", plotFunc = simpleLinPlot, names=NULL, sameScale=TRUE, pow2=FALSE, portrait=TRUE, fullLengths = NULL )hilbertDisplay( ..., palettePos = colorRampPalette( c( "white", "red" ) )( 300 ), paletteNeg = colorRampPalette( c( "white", "blue" ) )( length(palettePos) ), maxPaletteValue = NULL, naColor = "gray", plotFunc = simpleLinPlot, names=NULL, sameScale=TRUE, pow2=FALSE, portrait=TRUE, fullLengths = NULL )
... |
The data vectors to be visualized. This may be integer or real vectors, either
as ordinary R vectors or as |
palettePos |
The color palette used to visualize positive valued bins in the data. This must be either be a character vector of valid color names. If no palette is supplied, a ramp from white to red is used. |
paletteNeg |
The color palette for bins with negative values. Both palettes must have the same number of colours. |
maxPaletteValue |
The absolute bin value that should correspond to the end of the two palettes. (The beginning of the palettes always represents 0.) Within the graphical user interface, buttons are provided to adjust this interactively. If no value is provided, the median of the absolute values of maxima and minima of the data vectors is used. |
naColor |
The color to be used for bins which contain NAs or correspond to data outside the limits of the data vector. Pass a color name or a triple of RGB values. By default, "gray" is used. |
plotFunc |
An R function that is called if you use the "Linear plot" function
offer by HilbertCurveDisplay's GUI. If you enable this function and then click on a
pixel in the display, the function supplied as |
names |
The names of the sequences. A character vector. If not supplied, the
expressions used in the '...' argument, as reported by |
sameScale |
Setting this argument to |
pow2 |
Setting thsi argument to |
portrait |
Setting this option to |
fullLengths |
This option allows you to manually control the padding of
vectors with |
Returns an invisible NULL.
Simon Anders, EMBL-EBI, [email protected]
random <- c( as.integer( runif(100000)*30 ) ) ramp <- c( as.integer( 0:19999/100 ) ) try( hilbertDisplay( random, ramp ) )random <- c( as.integer( runif(100000)*30 ) ) ramp <- c( as.integer( 0:19999/100 ) ) try( hilbertDisplay( random, ramp ) )
This is a variant of hilbertDisplay that takes up to three long data vector but does not display them in different panels (allowing to switch with the “Previous” and “Next” buttons but instead put them in one picture, using the three colour channels to overlay them. This is look for correlations in spatial distribution of the different data vectors.
hilbertDisplayThreeChannel( dataRed, dataGreen = 0, dataBlue = 0, naColor = col2rgb("gray"), fullLength = max(length(dataRed), length(dataGreen), length(dataBlue)), portrait = FALSE)hilbertDisplayThreeChannel( dataRed, dataGreen = 0, dataBlue = 0, naColor = col2rgb("gray"), fullLength = max(length(dataRed), length(dataGreen), length(dataBlue)), portrait = FALSE)
dataRed |
The data to be displayed in the red colour channel, to be provided as a numeric vector with values between 0 (black) and 1 (bright red). You may either pass an ordinary R vector or an |
dataGreen |
As |
dataBlue |
As |
naColor |
The color to use to indicate NA. |
fullLength |
The vector length that should correspond to the full display. By default, the length of the longest data vector. It may make sense to round up to the next power of two. |
portrait |
Whether to arrange the buttons to the right of the display. Useful on small screens. |
Invisible NULL.
This function is a bit less mature than the function hilbertDisplay. Especially, the GUI functions “Linear plot”, “Previous”, and “Next” are displayed but defunct.
Simon Anders
Plots a small part of the supplied vector.
simpleLinPlot( data, info )simpleLinPlot( data, info )
data |
The data vector, a vector of integers. |
info |
A list with fields describing the context, as described in the help
page for |
This is a very simple function that is called by default by
hilbertDisplay when the user chooses the "Linear plot" option and
clicks on a pixel in the display. It displays a piece of 2000 values of the
data vector, centered around info$bin.
You will often want to replace this function by one tailored to your needs.
Null.
Simon Anders, EMBL-EBI, [email protected]